The GeoNames Data Set - Maple Programming Help

Home : Support : Online Help : Statistics and Data Analysis : DataSets Package : Builtin : DataSets/Builtin/GeoNames

The GeoNames Data Set

Built-in Data Sets

 • The DataSets package features two built-in data sets: Country and GeoNames.
 • The built-in data sets are accessed by creating a Reference to either data set.

The GeoNames Data set

 • The GeoNames data set contains geographic information on all of the countries of the world.
 • The data in the GeoNames data set is taken from www.geonames.org, a worldwide geographical database with a search function, browsable maps, and downloadable data files.
 • The first column in the GeoNames data set is always the GeoNamesid column.

The following creates a new reference to the GeoNames data set:

 > with(DataSets):
 > ref := Reference("Builtin", "Geonames");
 ${\mathrm{ref}}{≔}\left[\begin{array}{ccccc}{\mathrm{Geonames \left(GeoNamesid\right)}}& {\mathrm{Name}}& {\mathrm{Type}}& {\dots }& {\mathrm{\left(7 more\right)}}\\ {\mathrm{68}}& {\mathrm{Boneh-ye Mehdi}}& {"section of populated place"}& {\dots }& {}\\ {\mathrm{121}}& {\mathrm{Lab Sefid}}& {"locality"}& {\dots }& {}\\ {\mathrm{166}}& {\mathrm{Gorizi}}& {"locality"}& {\dots }& {}\\ {⋮}& {⋮}& {⋮}& {\ddots }& {}\\ {\mathrm{\left(1155858 more\right)}}& {}& {}& {}& {}\end{array}\right]$ (1)

The GeoNames data set contains a collection of geographic information. The GetHeaders command returns a list containing the names for all of the data set variables in the GeoNames data set. The following table shows all of the available data variables:

 City/County Country Latitude Longitude Name Population Province/State/Region Time Zone Type

It is possible to search the data set by indexing into the Reference object. For example, to see all of data on Uppsala, Sweden:

 > place := ref[[Country = "Sweden", Name = "Uppsala"]][2];
 ${\mathrm{place}}{≔}\left[\begin{array}{ccccc}{\mathrm{Geonames \left(GeoNamesid\right)}}& {\mathrm{Name}}& {\mathrm{Type}}& {\dots }& {\mathrm{\left(7 more\right)}}\\ {\mathrm{2666218}}& {\mathrm{Uppsala}}& {"first-order administrative division"}& {\dots }& {}\end{array}\right]$ (2)

To return (get) a specific variable, say Population, from this data subset:

 > GetData(place[..,Population]);
 $\left[\begin{array}{r}341977\end{array}\right]$ (3)

The WorldMap object can display entries from the GeoNames data set on a world map projection:

 > Display(Builtin:-WorldMap(place));
 >

More examples for interacting with the GeoNames data set can be found on the Reference help page.