vtdata library
Public Member Functions | Protected Attributes | List of all members
Countries Class Reference

Public Member Functions

bool ReadCountryList (const char *fname)
 
void ParseRawCountryFiles (const char *path_prefix, bool bNativeNames)
 
void ParseRawCountry (int i, bool bNativeNames)
 
void WriteGCF (const char *fname)
 
bool WriteSingleSHP (const char *fname)
 
bool WriteSHPPerCountry (const char *prefix)
 
void Free (bool progress_callback(int)=0)
 
bool ReadGCF (const char *fname, bool progress_callback(int)=NULL)
 
bool FindPlace (const char *country, const char *place, DPoint2 &point)
 
bool FindPlaceWithGuess (const char *country, const char *place, DPoint2 &point, bool bUTF8=false)
 

Protected Attributes

vtArray< Country * > m_countries
 
vtString m_path
 

Detailed Description

This class parses and utilizes a subset of the information from the GEOnet Names Server.

See http://earth-info.nga.mil/gns/html/ for the description of the data and the raw data files.

From the 700 MB of raw source files, a compact 'GCF' file containing only the geographic coordinate and a single name string are extracted for each populated place.

The GCF (75 MB) can be then loaded and used for rough geocoding of international addresses

Member Function Documentation

bool Countries::FindPlaceWithGuess ( const char *  country,
const char *  place,
DPoint2 geo,
bool  bUTF8 = false 
)

Find a location given its country and placename. If successful, it returns true and places the coordinate in 'geo'.

Parameters
countryCountry input
placePlace intput - this is generally a town or city
geoIf successful, receives the resulting point
bUTF8Important! If your country and place names are UTF8 strings, pass true. Otherwise they are assumed to be ANSI (western europe).