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.txtextension, 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 databasenameβ 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 characterscc2β alternate country codes, comma separated, ISO-3166 2-letter country code, 60 charactersadmin1 codeβ fipscode (subject to change to iso code), isocode for the us and ch, see fileadmin1Codes.txtfor display names of this code; varchar(20)admin2 codeβ code for the second administrative division, a county in the US, see fileadmin2Codes.txt; varchar(80)admin3 codeβ code for third level administrative division, varchar(20)admin4 codeβ code for fourth level administrative division, varchar(20)populationβ integerelevationβ in meters, integergtopo30β average elevation of 30'x30' (ca 900mx900m) area in meters, integertimezoneβ 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
- alpine 3.24: grass-gis-doc 8.5.0-r1 Β· GPL-2.0-or-later
- ubuntu stonking: grass-doc 8.5.0-1ubuntu1 Β· 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