GeoNames Home | Postal Codes | Download / Webservice | About |
search

Place Hierarchy Webservices

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.

Webservice Type: XML or JSON
Url: api.geonames.org/children?
api.geonames.org/childrenJSON?
Parameters:
geonameId: the geonameId of the parent
maxRows: number of rows returned, default is 200
hierarchy: this optional parameter allows to use other hiearchies then the default administrative hierarchy. Possible values. 'tourism' for tourism regions, 'geography' for geographical regions and 'dependency' for dependencies .
Result: returns a list of GeoName records

Example, regions of Italy:
http://api.geonames.org/children?geonameId=3175395&username=demo
Example for a tourism hierarchy, islands for the Canaries:
http://api.geonames.org/children?geonameId=2593110&username=demo&hierarchy=tourism
Example for a dependency hierarchy, dependencies of the UK
http://api.geonames.org/children?geonameId=2635167&username=demo&hierarchy=dependency
Example for a geographic hierarchy, regions of HK
http://api.geonames.org/children?geonameId=1819730&username=demo&hierarchy=geography




Hierarchy
Returns all GeoNames higher up in the hierarchy of a place name.

Webservice Type : XML or JSON
Url : api.geonames.org/hierarchy?
api.geonames.org/hierarchyJSON?
Parameters :
geonameId : the geonameId for the hierarchy
Result : returns a list of GeoName records, ordered by hierarchy level. The top hierarchy (continent) is the first element in the list

Example, hierarchy of Zurich, Switzerland, Europe:
http://api.geonames.org/hierarchy?geonameId=2657896&username=demo



Neighbours
Returns all neighbours for a country or administrative division. (coverage: all countries on country level, and lower levels as specified here: supported levels)

Webservice Type : XML or JSON
Url : api.geonames.org/neighbours?
api.geonames.org/neighboursJSON?
Parameters :
geonameId : the geonameId for the neighbours (country or ADM)
country: the country code (alternative parameter instead of the geonameId)
Result : returns the neighbours of a toponym, currently only implemented for countries

Example, neighbours of Switzerland:
http://api.geonames.org/neighbours?geonameId=2658434&username=demo



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.

Webservice Type : XML or JSON
Url : api.geonames.org/contains?
api.geonames.org/containsJSON?
Parameters :
geonameId : the geonameId for enclosing feature
featureClass: filter by featureClass (optional)
featureCode: filter by featureCode (optional)
Result : enclosed features (only when polyon boundary is available)

Example, features on island Texel:
http://api.geonames.org/contains?geonameId=2746385&username=demo



Siblings
Returns all siblings of a GeoNames toponym with feature class A.

Webservice Type : XML or JSON
Url : api.geonames.org/siblings?
api.geonames.org/siblingsJSON?
Parameters :
geonameId : the geonameId for the siblings
Result : returns a list of GeoNames records (feature class A) that have the same administrative level and the same father

Example, Siblings of France:
http://api.geonames.org/siblings?geonameId=3017382&username=demo




Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 License.

 

 

 

 

九州体育网