Using Facebook's Graph API, I am trying to download the information for businesses within a fixed radius (in meters) from a given latitude and longitude. I am using an access token. I am importing the information into R using the function callAPI(url,token)
Here's the information I entered for the URL
https://graph.facebook.com/search?q=coffee&type=place¢er=37.76,-122.427&distance=1000
Documentation for this is here:
https://developers.facebook.com/docs/places/search/
I tried it for this particular latitude, longitude, and radius. These were the ones given in the example. I got 24 businesses. However, if I try to enter in any longitude and latitude other than that one, I get nothing.
Can someone help me understand why this doesn't work? I don't get why it works for one latitude and longitude but not another.
Related
I'm building a weather app for Apple Watch only and the app is working. The strange thing is that I think that the coordinates that Openweathermap is using are not accurate.
I live in a small town in The Netherlands and that is recognised when I type it in on the website of Openweathermap. It returns also the coordinates on this website with 4 decimal places for the latitude and three decimal places for the longitude.
I generate the URL with coordinates, this results in a long number (I've printed this to the console) and the return is much shorter.
These coordinates are the real coordinates of my city, when I compare it to the coordinates from this website: https://www.where-am-i.net are those the same that my app is showing. The code I'm using is:
locationManager.desiredAccuracy = kCLLocationAccuracyBest
Changing to:
locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation
(this is not recommended unless device is plugged in)
With other words, does anyone know why the coordinates of openweathermap are different from the real coordinates and is there a solution for this. Because the app is now giving an other name back for the city that I'm located in.
The only thing I can think of is is dat my city is not recognised by open weather, but based on the location it will get de weather for the location with their coordinates, but will keep the city name in place. The outcome is the same.
How to get the coordinates of the polygon area:
http://wikimapia.org/#lang=en&lat=49.964473&lon=36.262436&z=12&m=b&show=/20421408/Chervonozavodsky-district
You need to use the place.Search function of The Wikimapia API and enter the latitude, longitude and the name of the place as parameters.
The API returns a lot of data separated in blocks. The one you are interested in is the geometry.
You can make tests with the Wikimapia API to filter the results to your needs. With the lat lon parameters and the district name you provided I was able to get the area you needed as the first result.
The places[0].polygon is what you need. A JSON array of coordinates.
Here´s the url I used to get the results:
http://api.wikimapia.org/?key=example&function=place.search&q=Chervonozavodsky-district&lat=49.964473&lon=36.262436&format=json&pack=&language=en&data_blocks=geometry%2C&page=1&count=1
Note that in this example i made the request for a JSON result. But you can also ask for a XML if you prefer.
Hope it helps!
I have city address and state on my server.
I need to fetch data in my iPhone application as per distance range (i.e in miles).
Please give some proper suggestions.
You can use Google Geocoding to get Lat-Long form address.
For example :
http://maps.google.com/maps/api/geocode/json?sensor=false&address=newyork,us
address — The address that you want to geocode.
You can use the google geolocation service, where it will get the Lat long from the address or vice-a-versa.
Please read the FAQ for the same.
Another is Foursquare which also nice to use and provides good data.
This will solve your issue.
You can travel to each of your cities and measure the highest position of some stars.
Through the altitude relation you can calculate then you current latitude.
The longitude is a bit more complicated. You need an accurate clock and a table/chart of star positions/times. Then you take measure the time of the highest position of some stars and compare it to your table. with the difference of this two values you can calculate the longitude of the city.
But there are already people who did that and share their results.
hello i want distance between two place ... means i have two places latitude and longitude then i want distance between that two place
i want something like this...
http://maps.google.com/maps?saddr=23.029772,72.527871&daddr=23.1901748,72.0127743
not like php or .net or java function that give calculate distance ...
if i search result by function it give me 55.61 output for this latitude and logitude and in map it give me 65.5 output. how can i get this in json ot xml or any other formate ?
...there's an in-built function in iOS that will do this for you. Check out the CLLocation documentation. Particularly distanceFromLocation:, which as the name suggests returns the difference between two locations in meters. You can create a CLLocation object using lat and lon.
If you don't want a straight line distance, you need to use the Google Directions API, which is well documented here: http://code.google.com/apis/maps/documentation/directions/
I want to make a application that calculates the distance between the user's current location and the nearest something (store, whatnot). Is there any way to obtain the real distance (following public roads ) instead of a direct distance (line from point A to B) ??
Thank you
Use google API to get the route and distance:
http://code.google.com/apis/maps/documentation/directions/
I don't think you can get the route (following roads) from MKMapKit.
The google maps API will return the route (following roads) as a set of latitude and longitude coordinates. It will also return the calculated distance.