Ci-dessous, une copie de la doc de geonames, adaptée à ce proxy. Lien vers la doc originale
Webservice Type: XML or JSON
Url: geonames.php/children?
geonames.php/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. So far only 'tourism' is implemented.
Result: returns a list of GeoName records
Example, regions of Italy:
https://ensweb.users.info.unicaen.fr/tp/lieu-parent/geonames.php/children?geonameId=3175395
Example for a tourism hierarchy, islands for the Canaries:
https://ensweb.users.info.unicaen.fr/tp/lieu-parent/geonames.php/children?geonameId=2593110&hierarchy=tourism
Webservice Type : XML or JSON
Url : geonames.php/hierarchy?
geonames.php/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:
https://ensweb.users.info.unicaen.fr/tp/lieu-parent/geonames.php/hierarchy?geonameId=2657896
Webservice Type : XML or JSON
Url : geonames.php/neighbours?
geonames.php/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:
https://ensweb.users.info.unicaen.fr/tp/lieu-parent/geonames.php/neighbours?geonameId=2658434
Webservice Type : XML or JSON
Url : geonames.php/contains?
geonames.php/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:
https://ensweb.users.info.unicaen.fr/tp/lieu-parent/geonames.php/contains?geonameId=2746385
Webservice Type : XML or JSON
Url : geonames.php/siblings?
geonames.php/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:
https://ensweb.users.info.unicaen.fr/tp/lieu-parent/geonames.php/siblings?geonameId=3017382
This work is licensed under a
Creative Commons Attribution 3.0 License.
Url | » | geonames.php/search? |
Result | » | returns the names found for the searchterm as xml or json document, the search is using an AND operator |
Parameter | Value | Description |
---|---|---|
q | string (q,name or name_equals required) | search over all attributes of a place : place name, country name, continent, admin codes,... (Important:urlencoded utf8) |
name | string (q,name or name_equals required) | place name only(Important:urlencoded utf8) |
name_equals | string (q,name or name_equals required) | exact place name |
name_startsWith | string (optional) | place name starts with given characters |
maxRows | integer (optional) | the maximal number of rows in the document returned by the service. Default is 100, the maximal allowed value is 1000. |
startRow | integer (optional) | Used for paging results. If you want to get results 30 to 40, use startRow=30 and maxRows=10. Default is 0, the maximal allowed value is 5000 for the free services and 25000 for the premium services |
country | string : country code, ISO-3166 (optional) | Default is all countries. The country parameter may occur more than once, example: country=FR&country=GP |
countryBias | string (option), two letter country code ISO-3166 | records from the countryBias are listed first |
continentCode | string : continent code : AF,AS,EU,NA,OC,SA,AN (optional) | restricts the search for toponym of the given continent. |
adminCode1, adminCode2, adminCode3 | string : admin code (optional) | code of administrative subdivision |
featureClass | character A,H,L,P,R,S,T,U,V (optional) | featureclass(es) (default= all feature classes); this parameter may occur more than once, example: featureClass=P&featureClass=A |
featureCode | string (optional) | featurecode(s) (default= all feature codes); this parameter may occur more than once, example: featureCode=PPLC&featureCode=PPLX |
cities | string (optional) | optional filter parameter with three possible values 'cities1000', 'cities5000','cities15000' used to categorize the populated places into three groups according to size/relevance. See the download readme for further infos |
lang | string ISO-636 2-letter language code; en,de,fr,it,es,... (optional) | place name and country name will be returned in the specified language. Default is English. Feature classes and codes are only available in English and Bulgarian. Any help in translating is welcome. |
type | string xml,json,rdf | the format type of the returned document, default = xml |
style | string SHORT,MEDIUM,LONG,FULL (optional) | verbosity of returned xml document, default = MEDIUM |
isNameRequired | boolean (optional) | At least one of the search term needs to be part of the place name. Example : A normal search for Berlin will return all places within the state of Berlin. If we only want to find places with 'Berlin' in the name we set the parameter isNameRequired to 'true'. The difference to the name_equals parameter is that this will allow searches for 'Berlin, Germany' as only one search term needs to be part of the name. |
tag | string (optional) | search for toponyms tagged with the specified tag |
operator | string (optional) | default is 'AND', with the operator 'OR' not all search terms need to be matched by the response |
charset | string (optional) | default is 'UTF8', defines the encoding used for the document returned by the web service. |
fuzzy | float (optional) | default is '1', defines the fuzziness of the search terms. float between 0 and 1. The search term is only applied to the name attribute. |
east,west,north,south | float (optional) | bounding box, only features within the box are returned |
searchlang | string (optional) | in combination with the name parameter, the search will only consider names in the specified language. Used for instance to query for IATA airport codes. |
orderby | string (optional)[population,elevation,relevance] | in combination with the name_startsWith, if set to 'relevance' than the result is sorted by relevance. |
inclBbox | string (option) [true] | include Bbox info, regardelss of style setting. (normally only included with style=FULL |
Example 3 bounding box : https://ensweb.users.info.unicaen.fr/tp/lieu-parent/geonames.php/search?q=london&south=0&north=70&west=-120&east=-10&maxRows=10
JSON
https://ensweb.users.info.unicaen.fr/tp/lieu-parent/geonames.php/searchJSON?q=london&maxRows=10
JSON is easier to use in Javascript than XML, as a browser security feature will no allow you to call an xml service from an other domain. A simple example using the json service on googlemaps is here
'name' and 'toponymName'
The response returns two name attributes. The 'name' attribute is a localized name, the preferred name in the language passed in the optional 'lang' parameter or the name that triggered the response in a 'startWith' search. The attribute 'toponymName' is the main name of the toponym as displayed on the google maps interface page or in the geoname file in the download. The 'name' attribute is derived from the alternate names.
Fuzzy Search
With the parameter 'fuzzy' the search will find results even if the search terms are incorrectly spelled.
Example: https://ensweb.users.info.unicaen.fr/tp/lieu-parent/geonames.php/search?q=londoz&fuzzy=0.8
Reverse Geocoding
Reverse geocoding is the process of finding a place name for a given latitude and longitude. GeoNames has a wide range of reverse geocoding webservices.
RDF - Semantic Web
https://ensweb.users.info.unicaen.fr/tp/lieu-parent/geonames.php/search?q=london&maxRows=10&type=rdf
With the parameter type=rdf the search service returns the result in RDF format defined by the GeoNames Semantic Web Ontology.
This work is licensed under a Creative Commons Attribution 2.5 License.