Location
These tools turn a place name into coordinates, using the GeoNames gazetteer of the world's populated places, administrative areas and physical features. Many places share a name, so a lookup returns every match together with the details that tell them apart — the country it is in and what kind of place it is.
The coordinates come back as a fuzzy location, the same form the knowledge graph location tools use, so a match can be given straight to UpdateNodeLocations to say where the thing a node represents is.
Finds a list of possible locations given a place name.
Parameters
| Name | Type | Description |
|---|---|---|
locationName | string | The name of the location. The whole name must match, but any capitalization will do. |
Returns
A list of extended locations, most populous first, or an empty list if nothing matches. Each one holds:
| Field | Description |
|---|---|
location | The fuzzy location of the place: a single longitude, latitude and altitude. The altitude is 0.0 where the gazetteer records no elevation. |
CountryCode | The ISO country code of the country the place is in, for example GB. |
Type | The kind of place its GeoNames feature code stands for, for example capital of a political entity for the code PPLC. |
CountryName | The name of the country the code stands for, for example United Kingdom. Empty where the code is not one of ISO 3166-1. |
TopLevelRegionName | The first-order administrative division the country code and the GeoNames admin1 code name together, for example England for GB.ENG. Empty where the pair is not one GeoNames knows. |
SecondaryRegionName | The second-order administrative division the country code and the GeoNames admin1 and admin2 codes name together, for example Greater London for GB.ENG.GLA. Empty where the three are not ones GeoNames knows. |
Notes
At most 100 places are returned, so that a very common name cannot swamp the
caller. Names are matched in full: search for London rather than Lond.