parents (lat/lon method) | URL | Parameters | Example | Query | Response
parents (entity method) | URL | Parameters | Example | Query | Response
There are two parents methods. One takes a latitude/longitude coordinate pair and returns that location's parent location entities. The other takes an entity's guid and returns the entity's parent location entities. The entity parent hierarchies are:
- lat/lon_location -> neighborhood -> city
- business -> neighborhood -> city
- POI -> neighborhood -> city
- intersection -> neighborhood -> city
- user-entity -> neighborhood -> city
- neighborhood -> city
If there are no parent entities (for example, a city entity has no parents), the result value is [], the empty list.
parents (lat/lon method) [Top]
Returns the parent entities of a specific latitude/longitude coordinate pair. For example, the point at 37.563475, 122.323219 is in Downtown > San Mateo.
http://api.geoapi.com/v1/parents
Parameters [Top]
- lat:
- Required.
- Latitude coordinate.
- Format: Positive or negative floating point number.
- lon:
- Required.
- Longitude coordinate.
- Format: Positive or negative floating point number.
- apikey:
- Required.
- The application's GeoAPI key.
- Format: String.
- pretty:
- Optional.
- Enables easier to read prettified JSON in result.
- Format: Set equal to 1 to enable prettification.
- jsoncallback:
- Optional.
- Return response in JSONP format. JQuery has nice support for JSONP callbacks.
- Format: JSON prefix string.
This method is also used in the Location Check-In demo.
http://api.geoapi.com/v1/parents?lat=37.563475&lon=-122.323219&apikey=demo&pretty=1
{
"query": {
"params": {
"lat": 37.563475,
"lon": -122.323219
},
"type": "point-parents" },
"result": {
"parents": [
{
"guid": "downtown-san-mateo-ca",
"meta": {
"geom": {
"type": "Polygon",
"coordinates": [...]
},
"guid": "downtown-san-mateo-ca",
"type": "neighborhood",
"name": "Downtown",
"views": []
}
},
{
"guid": "san-mateo-ca",
"meta": {
"geom": {
"type": "Polygon",
"coordinates": [...]
},
"guid": "san-mateo-ca",
"type": "city",
"name": "San Mateo",
"views": []
}
}
]
}
}
parents (entity guid method) [Top]
Returns the parent entities of a guid-specified entity. For example, the entity with guid ritual-coffee-roasters-san-francisco-ca-94110 is in Mission District > San Francisco.
http://api.geoapi.com/v1/e/<guid>/parents
Parameters [Top]
- guid:
- Required.
- Any valid GeoAPI guid.
- Format: String.
- apikey:
- Required.
- The application's GeoAPI key.
- Format: String.
- pretty:
- Optional.
- Enables easier to read prettified JSON in result.
- Format: Set equal to 1 to enable prettification.
- jsoncallback:
- Optional.
- Return response in JSONP format. JQuery has nice support for JSONP callbacks.
- Format: JSON prefix string.
http://api.geoapi.com/v1/e/ritual-coffee-roasters-san-francisco-ca-94110/parents?apikey=demo&pretty=1
{
"query": {
"params": {
"guid": "ritual-coffee-roasters-san-francisco-ca-94110"
},
"type": "entity-parents"
},
"result": {
"parents": [
{
"guid": "mission-san-francisco-ca",
"meta": {
"geom": {
"type": "Polygon",
"coordinates": [...]
},
"guid": "mission-san-francisco-ca",
"type": "neighborhood",
"name": "Mission",
"views": []
}
},
{
"guid": "san-francisco-ca",
"meta": {
"geom": {
"type": "MultiPolygon",
"coordinates": [...]
},
"guid": "san-francisco-ca",
"type": "city",
"name": "San Francisco",
"views": []
}
}
]
}