Query for Geographic lat/lng Coordinates rename
author:
contributor:
published:
updated:
source uri:
Freebase Apps Help Topic /freebase/apps/help_topic
Status:
Summary
Latitude/longitude coordinates are stored in [`/location/geocode`](http://www.freebase.com/type...
Content
Latitude/longitude coordinates are stored in [`/location/geocode`](http://www.freebase.com/type/schema/location/geocode) nodes, such as [this one](http://www.freebase.com/view/guid/9202a8c04000641f8000000001143e1e), but typically in your app you're dealing with [`/location/location`](http://www.freebase.com/type/schema/location/location) topics. So you would have to query for the geocode node(s) associated with a location topic. For example, if you want to find the lat/lng of San Francisco, do:
> var o = acre.freebase.mqlread({
> "id" : "/en/san_francisco",
> "type" : "/location/location",
> "geolocation" : [{
> "latitude" : null,
> "longitude" : null,
> "optional" : true
> }]
> });
>
> if (o.result["geolocation"].length > 0) {
> var geocode = o.result["geolocation"][0];
> ... do something with geocode.latitude and geocode.longitude ...
> }
> var o = acre.freebase.mqlread({
> "id" : "/en/san_francisco",
> "type" : "/location/location",
> "geolocation" : [{
> "latitude" : null,
> "longitude" : null,
> "optional" : true
> }]
> });
>
> if (o.result["geolocation"].length > 0) {
> var geocode = o.result["geolocation"][0];
> ... do something with geocode.latitude and geocode.longitude ...
> }
Recent Discussions about Query for Geographic lat/lng Coordinates
There is no discussion about this document.
Start the Discussion »