Query for Geographic lat/lng Coordinates rename

author:

contributor:

published:

updated:

source uri:

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 ...
> }


Created by: dfhuynh via Cookbook Jun 4, 2009
Last edited by: dfhuynh via Cookbook Jul 9, 2009

Recent Discussions about Query for Geographic lat/lng Coordinates

There is no discussion about this document.

Start the Discussion »
Explore the Data
View all the data we have for Query for Geographic lat/lng Coordinates
Flag this Document
Why do you want to flag this document?