开发者

How does Facebook perform Geocoding?

I'm working on an application on Android that creates events on facebook. I am facing a strange problem and I could use some help.

Facebook's API at http://developers.facebook.com/docs/reference/api/event/ is not helpful at all since it doesn't clarify what is needed and what is the dependence for each set of values.

First, I create an event by setting values for the fields: owner id, name, start_time, end_time, location, city, state, country, latitude, longitude and privacy. I do it like that :

data.put("owner", myId);

data.put("name", eventName + "1");
data.put("description", eventDescription);
data.put("start_time", eventStartTime);
data.put("end_time", eventEndTime);
data.put("location", eventLocation);

//data.put("venue", eventLocation);
//data.put("street", "Street here");
data.put("city", "City here"); 
data.put("state", "State here");
data.put("country", "Country here");            
data.put("latitude", Double.toString(eventLat));
data.put("longitude", Double.toString(eventLng));

data.put("privacy", eventVisibility);

I have hardcoded the coordinates to be 59.2101 for latitude and 18.0401 for longitude.

After a make a post at facebook Graph API, I get back an id containing the event's id. When I then see the JSON that contains the info about that event at the browser by going to https://graph.facebook.com/XXXXX where XXXXX is the event's newly created id and I can see that the coordinates of the venue are not the ones that I had previously set but different ones which are the ones that correspond to those that geocode returns for the specific city and country. Obviously, Facebook is doing its own geocoding/开发者_运维知识库reverse geocoding based on the provided street, city and country and ignores the coordinates that are sent.

So the question is, does anyone know how exactly Facebook treats the creation of a venue, which are the required fields and if there is any way to override the coordinates that it sets and use the those I pass to facebook ?

Any help will be greatly appreciated.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜