v.in.geonames(1)
π v.in.geonames β the GRASS GIS manual, but make it bestie π
okay so you found the v.in.geonames(1) page in the GRASS GIS User's Manual and honestly? slay. this lil icon imports geonames.org country files into a vector points map and it is so much easier than it sounds. let's get into it π¦
β¨ NAME β¨
v.in.geonames β bestie, it imports geonames.org country files into a vector points map. that's the whole job. iconic behaviour only π
π KEYWORDS π
vector, import, gazetteer β iykyk π
πΈ SYNOPSIS πΈ
v.in.geonames
v.in.geonames --help
v.in.geonames input=name output=name [--overwrite] [--help]
[--verbose] [--quiet] [--ui]
β Flags β
--overwriteβ lets your output files just overwrite whatever's already there. no cap, it will absolutely replace existing files, so vibe check your directory first π--helpβ prints the usage summary, for when you need a lil refresher π«Ά--verboseβ verbose module output, aka it tells you everything it's doing. main character energy--quietβ quiet module output. shhh π€«--uiβ forces the GUI dialog to launch, if you're feeling clicky β¨
π Parameters π
input=name[required] β the name of your uncompressed geonames file (with.txtextension). unzip it first, bestie, i'm begging πoutput=name[required] β the name for your output vector map. pick something cute π
π¦ DESCRIPTION π¦
so v.in.geonames imports Geonames.org country files (that's Gazetteer data, fancy) into a GRASS vector points map. you can download the country files from the GeoNames Data Dump Server β go get 'em.
β οΈ only original files can be processed, so unzip the compressed file first. fr fr, don't skip this step.
these Geonames files are encoded in UTF-8, and that encoding is maintained in the GRASS database. no encoding drama, we love to see it π
π NOTES π
v.in.geonames calls v.in.ascii to import data into GRASS. teamwork makes the dream work π«Ά
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 to meet the DBF column name restrictions. if that's a problem for you, consider choosing another database driver with db.connect (eg. to SQLite driver). periodt. π
the main 'geoname' table has these fields, and i'm listing every single one because we don't gatekeep:
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
look at all those fields. obsessed. π
π EXAMPLE π
download and import geonames for Czech Republic. literally three lines, we love a low-effort slay:
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 β go read those next, bestie, they're the friend group π«Ά
π AUTHOR π
Markus Neteler β thank you for your service, legend π
β SOURCE CODE β
available at: v.in.geonames source code (history)
accessed: Saturday Jan 17 05:41:53 2026
main index | vector index | topics index | keywords index | graphical index | full index
okay that's the whole page, you're officially a v.in.geonames girlie now π
this was the GRASS 8.4.2 Reference Manual, Β© 2003-2025 GRASS Development Team, and yeah we're living in the GRASS 8.4.2 era. go import some points, you got this π¦β¨
π¦ where this page comes from
- fedora 44: grass 8.4.2-4.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms