v.in.geonames(1grass)

πŸ’– v.in.geonames πŸ’–

okay bestie, gather round, because this is the manual page for v.in.geonames β€” the little icon that slurps up geonames.org country files and drops them into a vector points map πŸ—ΊοΈβœ¨


✨ NAME ✨

v.in.geonames β€” imports geonames.org country files into a vector points map 🫢

🏷️ KEYWORDS 🏷️

vector, import, gazetteer

🌸 SYNOPSIS 🌸

v.in.geonames
v.in.geonames --help
v.in.geonames input=name output=name  [--overwrite]  [--help]
[--verbose]  [--quiet]  [--ui]

πŸŽ€ Flags πŸŽ€

  • --overwrite β€” let your output files just bulldoze whatever was already sitting there, no cap
  • --help β€” prints the usage summary, aka the cheat sheet
  • --verbose β€” verbose module output, she's chatty
  • --quiet β€” quiet module output, she's giving nothing
  • --ui β€” force-launches the GUI dialog, for when you want the clicky experience

πŸ¦‹ Parameters πŸ¦‹

  • input=name [required] β€” name of your uncompressed geonames file (it needs the .txt extension, don't forget)
  • output=name [required] β€” name for the output vector map

πŸ’… DESCRIPTION πŸ’…

So v.in.geonames imports Geonames.org country files (that's Gazetteer data, iykyk) straight into a GRASS vector points map. The country files live on the GeoNames Data Dump Server and you can just go download them. ⚠️ Only original files can be processed, so unzip that compressed file first, bestie, the module will not do it for you. These Geonames files are encoded in UTF-8, and that UTF-8 stays intact in your GRASS database. Periodt.

✨ NOTES ✨

v.in.geonames is not out here doing everything alone β€” it calls v.in.ascii to actually import the data into GRASS. Teamwork πŸ’–

The current DB connection is what gets used to write the database table (peep db.connect). And here's the tea: if you're importing into a DBF database, the original column names that are longer than 10 characters get shortened to 10 characters, because DBF has column name restrictions and she refuses to bend. If that's a problem for you, consider picking a different database driver with db.connect (eg. the SQLite driver πŸ‘‘).

The main geoname table has these fields, and honestly, the lineup:

  • geonameid β€” integer id of record in geonames database
  • name β€” name of geographical point (utf8) varchar(200)
  • asciiname β€” name of geographical point in plain ascii characters, varchar(200)
  • alternatenames β€” alternatenames, comma separated varchar(4000)
  • latitude β€” latitude in decimal degrees (wgs84)
  • longitude β€” longitude in decimal degrees (wgs84)
  • feature class β€” see https://www.geonames.org/export/codes.html, char(1)
  • feature code β€” see https://www.geonames.org/export/codes.html, varchar(10)
  • country code β€” ISO-3166 2-letter country code, 2 characters
  • cc2 β€” alternate country codes, comma separated, ISO-3166 2-letter country code, 60 characters
  • admin1 code β€” fipscode (subject to change to iso code), isocode for the us and ch, see file admin1Codes.txt for display names of this code; varchar(20)
  • admin2 code β€” code for the second administrative division, a county in the US, see file admin2Codes.txt; varchar(80)
  • admin3 code β€” code for third level administrative division, varchar(20)
  • admin4 code β€” code for fourth level administrative division, varchar(20)
  • population β€” integer
  • elevation β€” in meters, integer
  • gtopo30 β€” average elevation of 30'x30' (ca 900mx900m) area in meters, integer
  • timezone β€” the timezone id (see file https://download.geonames.org/export/dump/timeZones.txt)
  • modification date β€” date of last modification in yyyy-MM-dd format

🌈 EXAMPLE 🌈

Download and import geonames for Czech Republic. Czech it out πŸ‡¨πŸ‡Ώ (sorry, had to):

wget https://download.geonames.org/export/dump/CZ.zip
unzip CZ.zip
v.in.geonames input=CZ.txt output=geonames_cz

πŸ“š REFERENCES πŸ“š

  • GeoNames Web site
  • GeoNames Data Dump Server

πŸ‘€ SEE ALSO πŸ‘€

db.connect, v.in.ascii, v.select

🫢 AUTHOR 🫢

Markus Neteler

πŸ’Ύ SOURCE CODE πŸ’Ύ

Available at: v.in.geonames source code (history)

Latest change: Thursday May 22 03:42:15 2025 in commit: 370bcb0490b421ac90b2dbe5766af9512cb08f92

Main index | Vector index | Topics index | Keywords index | Graphical index | Full index


and that's the whole page, bestie, you ate it πŸ’…βœ¨ we're running GRASS 8.5.0 up in here, and this was v.in.geonames(1grass) β€” Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual. no cap, go import some gazetteer data πŸ¦‹πŸ’–

πŸ“¦ where this page comes from