Place Hierarchy Webservices
The administrative and other hierarchies of places: the children of a place, all places above it, its neighbours and siblings, and the features it contains. The username parameter is required on every request.
See also: GeoNames webservices · all webservices on one table
Children
Returns the children (admin divisions and populated places) for a given geonameId. The children are the administrative divisions within an other administrative division, like the counties (ADM2) in a state (ADM1) or also the countries in a continent. The leafs are populated places, other feature classes like spots, mountains etc are not included in this service. Use the search service if you need other feature classes as well.
Parameters
| Parameter | Value | Description |
|---|---|---|
| geonameId | integer | the geonameId of the parent |
| maxRows | integer (optional) | number of rows returned, default is 200 |
| style | SHORT, MEDIUM, LONG, FULL (optional) | verbosity of the returned document; default MEDIUM. With FULL each child carries its admin codes (adminCode1, adminCode2 ... down to the level of the child itself, for a second-order division its adminCode2) and admin names, and also its alternate names, time zone, bounding box and elevation; the document is much larger, so use it only when you need these |
| hierarchy | 'tourism', 'geography' or 'dependency' (optional) | allows to use other hierarchies than the default administrative hierarchy: 'tourism' for tourism regions, 'geography' for geographical regions and 'dependency' for dependencies |
Result
A list of GeoName records, as XML or JSON. The admin codes of the children (adminCode2 of a second-order division, for example) are only in the FULL style.
Examples
Regions of ItalyMunicipalities of the canton of Echternach, Luxembourg, with their admin codesTourism hierarchy: islands of the CanariesDependency hierarchy: dependencies of the UKGeographic hierarchy: regions of HK
Hierarchy
Returns all GeoNames higher up in the hierarchy of a place name.
Parameters
| Parameter | Value | Description |
|---|---|---|
| geonameId | integer | the geonameId for the hierarchy |
Result
A list of GeoName records, ordered by hierarchy level. The top hierarchy (continent) is the first element in the list.
Example
Neighbours
Returns all neighbours for a country or administrative division. Coverage: all countries on country level, and lower levels as specified in the supported levels.
Parameters
| Parameter | Value | Description |
|---|---|---|
| geonameId | integer | the geonameId for the neighbours (country or ADM) |
| country | string | the country code (alternative parameter instead of the geonameId) |
Result
The neighbours of a toponym, currently only implemented for countries.
Example
Contains
Returns all features within the GeoName feature for the given geonameId. It only returns contained features when a polygon boundary for the input feature is defined.
Parameters
| Parameter | Value | Description |
|---|---|---|
| geonameId | integer | the geonameId for the enclosing feature |
| featureClass | string (optional) | filter by featureClass |
| featureCode | string (optional) | filter by featureCode |
Result
The enclosed features (only when a polygon boundary is available).
Example
Siblings
Returns all siblings of a GeoNames toponym with feature class A.
Parameters
| Parameter | Value | Description |
|---|---|---|
| geonameId | integer | the geonameId for the siblings |
Result
A list of GeoNames records (feature class A) that have the same administrative level and the same father.