[OSM-talk] NGA Country Files Converter into OSM format

Ævar Arnfjörð Bjarmason avarab at gmail.com
Fri Feb 20 00:34:48 GMT 2009

On Thu, Feb 19, 2009 at 10:13 PM, Ivan Garcia <capiscuas at gmail.com> wrote:
> Hi all,
> I recently discovered the site available by the US Army with millions of
> world geonames (towns, etc) here
> [1] http://earth-info.nga.mil/gns/html/namefiles.htm
> The OSM wiki says that there is no legal problem using it, altought we
> should put the source tag
> [2] http://wiki.openstreetmap.org/wiki/SWDB#GEOnet_Names_Server
> Here is the XML explanations of the CVS that you can download from the link
> [1],
> [3]
> http://meta.wikimedia.org/wiki/Mass_content_adding/Geographic_data/Using_NGA_data/Localization/Description_of_Names_Files_for_Countries_and_Territories_Format/English
> The question is ? Anybody has developed a script to convert this CVS into a
> KML or OSM file containing all the towns of a country?
> This can be very useful for countries in developing countries almost empty.

They're called GNS files, if you search around the mailing lists
you'll find some information about them, there's also a sparse page on
the wiki:


Here's a program to convert them (somewhat) which I modified from
another program I found on the wiki:


Here's an example of GNS (in)accuracy (originally from

OSM data now: http://flickr.com/photos/avarab/3133771125/sizes/o/
GNS data: http://flickr.com/photos/avarab/3133777841/sizes/o/
OSM and GNS data side by side:

As you can see the GNS data is prone to miss mountain peaks by a few
kilometers, place farms in the middle of lakes and other "this was
made by throwing darts at a globe" stuff like that.

Things are generally pretty topographically correct, and can be useful
in cases where you can move the nodes according to landsat data, local
knowledge or other stuff like that.

On my ever-expanding TODO list where nothing gets done I have a "write
a viable user-powered GNS importer for OSM" item, basically:

* Go through the entire GNS dataset and split it up by country/type of
feature (e.g. one .osm file for peak, one for farms, one for glaciers
* Present a web interface where users can download e.g. "peaks in
Zimbabwe that haven't been uploaded"
* The user will then open the .osm file in his editor, move nodes
around according to local knowledge/landsat and upload them
* The uploaded node will have a gns:UFI (unique feature ID) key and
won't appear in the next extract of "peaks in Zimbabwe that haven't
been uploaded"

This (or something like it) is IMO the only non-sucky way to import
GNS data, it has been imported as-is in some places like the Faroe
Islands (which has no active mappers), but I wouldn't like a mass
import of raw GNS data in any are which I edit, having a bunch of
nodes which are off by few dozen meters to a few kilometers isn't
acceptable quality for OSM. Especially for datasets such as these
which you can merge with the OSM data on your own if you really want
to use them.

More information about the talk mailing list