Facebook Graph Api checkins in geographical area - python

Well i want to use facebook's graph api to get checkins from a specific geo-graphical location with python.
In the api documentation area i didn't find the right combinations of api parameters to get it done;
http://developers.facebook.com/docs/reference/api/checkin/
For example , if i want to get all checkins in coffee-shops in Harvard-square(Boston) what would be the api call ? (without going into specifying every coffee-shop in that location)
thanks.

You can search for coffee places as follows:
https://graph.facebook.com/search?q=coffee&type=place.
You can then narrow narrow your search to a specific location and distance by adding the center parameter (with latitude and longitude) and an optional distance parameter:
https://graph.facebook.com/search?q=coffee&type=place&center=37.76,-122.427&distance=1000
This is documented by Facebook here.

Related

Can I use google distance API to caculate distance between a zipcode to a location(location name)?

Does anybody know if it is possible to use google distance API to get a distance value between a location name and a zipcode?
I know it can be done for 2 locations or 2 zipcodes. I am not sure if it would work for a location and zipcode.
If so, could you please share a sample code for that in python?

API to explore Transportation Mode given Geo-Points

I’m new to here-aip, and I’m not sure if my needs can be addressed via service offering (I'm open to other location like services / utilities).
I have a list of (ordered) geo-points describing a transit (already taken place in the past) and I would like to get a clue of a feasible transportation mode in which this transit had taken place (e.g.: this looks like a train trip!).
input example :
lon
lat
121.240436
24.952392
121.24043
24.95239
121.240436
24.952392
121.23966
24.952605
121.23964
24.9526
121.23964
24.95227
121.23964
24.95227
121.239683
24.952316
121.23967
24.95232
121.240149
24.951126
121.24016
24.95111
I have thought about providing the list of points as a constraint and receive the estimated duration using each transportation mode (then on my side I can compare the possible duration with the actual duration and conclude the transportation mode).
I currently understand that if I provide two points (e.g. start and end) I can get a duration estimation and route, but I need more then that (e.g. if the actual transit is circular, providing start point and end point will not be meaningful).
Any ideas?
You can make use of VIA parameter to define the multiple waypoints while calculating the route.
Please refer the below link for more details.
https://developer.here.com/documentation/routing-api/dev_guide/topics/use-cases/via.html
And Refer below example which explain how we can use the VIA parameter in the request.
https://router.hereapi.com/v8/routes?apikey={YOUR_API_KEY}&origin=52.542948,13.37152&destination=52.523734,13.40671&via=52.529061,13.369288&via=52.522272,13.381991&return=polyline,summary,actions,instructions,turnByTurnActions&transportMode=car&departureTime=2022-04-05T20:45:00-07:00

Bing API - Incorrect JSON format to distance matrix

i am tryiing to pass parameters in bing map distance matrix api with request.get(url,parameter) but it is not passing in correct order
i tried this
enter code here
parameters = {
'origins':[47.6044,-122.3345],
'destinations':{"latitude":47.6731,"longitude":-122.2057},
"travelMode": "driving",
'key':api_for_bing
}
but it gives the response :
'https://dev.virtualearth.net/REST/v1/Routes/DistanceMatrix?origins=47.6044&origins=-122.3345&destinations=latitude&destinations=longitude&travelMode=driving&key=my_key'
can any one help me with this.
while it shoud be like this
'https://dev.virtualearth.net/REST/v1/Routes/DistanceMatrix?origins=47.6044,-122.3345;47.6731,-122.1185;47.6149,-122.1936&destinations=47.4747,-122.2057&travelMode=driving&key=my_key'
First, you probably want to hide your personal Bing Maps Key. Second, there are sample calls available at https://learn.microsoft.com/en-us/bingmaps/rest-services/examples/distance-matrix-example
Your call above only shows one start and one destination which is not actually a matrix but rather just a single route. If you are not actually looking for multiple routes then you probably should use the Routing API (Directions Manager)rather than Distance Matrix.

How to find all points along a route between two points on google map using python

I need to find latitudes and longitudes of all points that lie along the route between two points (start point and end point, both represented as lat-long pair) in the google map. I have 1 million start points and the corresponding 1 million end points. So, basically I would have 1 million routes and I need to find all points that lie along each of these 1 million routes, separately. I do not want to call google javascript api, because there is a restriction on the no of calls that one can make per day. Also, this will not scale. Can anyone please suggest, how can I do it using python and some offline api/tool for google map?
You say you represent a route as start/end point, you have to consider that for each pair of start and end points you can have more than one route (depending on the mode of travel, etc.).
This is why you need routing. If you don't want to use Google's directions API you can check OpenStreetMap's routing APIs or roll your own router using existing libraries and engines on OSM data.
Similar question: Calculating shortest path on maps (Google Maps, Openstreetmaps, etc)

Django and location based app

I'm building a django app that requires to display (on google map) items near the user current location. (ie. the nearest coffee shop kind of request).
I haven't decided how I will capture those items' location in db.
The requirements aren't final but I'm guessing the user will want to sort by distance, etc.
My question is what solution should I look into?
I looked at geodjango but it seems to be an overkill.
Could you please tell me what solution you would use and why?
Thanks everyone!
You will need to use RDBMS like MySQL or postgresql. Then, create your objects (e.g: cafeshops) with latitude and longitude as flout. Get the user's latitude and longitude and look it up via sin and cos functions.
You will need to write a raw sql query to look up objects based on their latitude and longitude.
Read this: http://www.scribd.com/doc/2569355/Geo-Distance-Search-with-MySQL
Take a look at this: Filter zipcodes by proximity in Django with the Spherical Law of Cosines
and this: latitude/longitude find nearest latitude/longitude - complex sql or complex calculation

Categories

Resources