Skip to content

v.in.gns

Imports US-NGA GEOnet Names Server (GNS) country files into a GRASS vector points map.

v.in.gns input=name [output=name] [--overwrite] [--verbose] [--quiet] [--qq] [--ui]

Example:

v.in.gns input=name

grass.script.run_command("v.in.gns", input, output=None, overwrite=False, verbose=False, quiet=False, superquiet=False)

Example:

gs.run_command("v.in.gns", input="name")

Parameters

input=name [required]
    Name of input uncompressed GNS file from NGA (with .txt extension)
output=name
    Name for output vector map
--overwrite
    Allow output files to overwrite existing files
--help
    Print usage summary
--verbose
    Verbose module output
--quiet
    Quiet module output
--qq
    Very quiet module output
--ui
    Force launching GUI dialog

input : str, required
    Name of input uncompressed GNS file from NGA (with .txt extension)
    Used as: input, file, name
output : str, optional
    Name for output vector map
    Used as: output, vector, name
overwrite: bool, optional
    Allow output files to overwrite existing files
    Default: False
verbose: bool, optional
    Verbose module output
    Default: False
quiet: bool, optional
    Quiet module output
    Default: False
superquiet: bool, optional
    Very quiet module output
    Default: False

DESCRIPTION

v.in.gns imports US-NGA GEOnet Names Server (GNS) country files (Gazetteer data) into a GRASS vector points map. The country files can be downloaded from the NGA GNS Web Server (see below). The script generates a vector point map. Only original files can be processed (unzip compressed file first). These GNS files are encoded in UTF-8 which is maintained in the GRASS database.

NOTES

The current DB connection is used to write the database table.

Generally, column names longer that 10 characters are shortened to 10 characters to meet the DBF column name restrictions. If this is a problem consider choosing another database driver with db.connect.

To filter outliers (points outside of a country), the v.select module can be used to perform point-in-polygon tests. v.select saves only the GNS points falling into a country polygon into the new points map.

SEE ALSO

db.connect, v.select

REFERENCES

GEOnet Names Server files for countries and territories
Column names explanations

AUTHOR

Markus Neteler, MPBA Group, ITC-irst, Trento, Italy

SOURCE CODE

Available at: v.in.gns source code (history)
Latest change: Thursday Feb 20 13:02:26 2025 in commit 53de819