area locations nearby using reverse geocoding provide different results - reverse-geocoding

I am using googles reverse geocoding to lookup sub localities and neighbourhoods.
Both of the below coordinates are extremely close to one another and are both within victoria island in Nigeria however only the first reference shows the neighbourhood.
Shows vitoria island in the response under neighbourhoods
http://maps.googleapis.com/maps/api/geocode/json?latlng=6.428291386098148,3.4191928832085523&sensor=false
Doesn't show victoria island in the response under neighbourhoods from the first address components
http://maps.googleapis.com/maps/api/geocode/json?latlng=6.427779639540112,3.420051190093318&sensor=false
Can anyone shed some light on this? Is there a way to get better results? I have tried yahoo place finder but no luck there either.

Related

Travel API doesn't work for cities outside of the US - why?

I have been trying out the travel API from sabre, been testing APIs (for example InstaFlights Search or destination finder) and it works only for US cities (departure and destination). I've been testing them on sabres website (so this has nothing to do with my code). I don't assume that sabre API is only for US domestic flights as that would be too strange, so does anyone know why I'm getting 404 when I try to put a non-US city as departure or destination?
Thanks a lot!
EDIT:
Random international flights options do work and some don't.
For example MUC-LHR ( Munich to London) works when I change the point of sale country to DE but doesn't work for MUC - JFK for example.
Are you hitting CERT or PROD? Not all of Sabre content is available in CERT, so that might be why you're seeing such odd results.

Geocoding with rails search

I've been running into some location based searches using the Google Maps API (more of a structural issue on my end than any criticism of the mapping api)
For example, if a user searches for "Victoria, Canada" it will bring up results for "Victoria, Canada" as expected. However, if a user searches for "Canada," google returns a longitude and latitude for the middle of the country, which is essential for correctly centering the map. However, it will not display any results since the nearest location is too far away from the location returned by google. I'm filtering out results that are about 20 miles away.
Can the Google Maps API return anything that I could use to tell if a user has entered a state or country name? If not, has anyone developed a work around solution?
Ideally, I would like to avoid just ordering the results by nearest location. I don't want items for "Spain" showing up at the bottom of a list when a user searches for "United States." I would try to determine if the query is a state or country prior to the search, but this seems very daunting task given the different possible spelling of country and region names. If I was only expecting english spellings, it would be a much easier approach.
Assuming this is a form on a site that has a controller parse the form and send the request to Google's API, you could break the form out into address, city, state, and country (if needed) form elements then make the address and city required fields.
I'm doing a similar approach with a site I'm building using Google Places API and it seems to work for me.

Why is the Foursquare API only generating results for certain coordinates?

I am using the Foursquare API to read JSON pages filled with the trending venues in areas. I tried generating a link as they explain to, but venues are only returned for the coordinates, 40.7, -74 – the ones they give as an example on their site. This can be seen using their API Explorer:
The trending restaurants are returned for the coordinates they give as an example, as can be seen at this link: https://developer.foursquare.com/docs/explore#req=venues/trending%3Fll%3D40.7,-74
But trying coordinates for San Francisco, for instance – 37.755516, -122.44812 – doesn't return anything, although it also doesn't show an error: https://developer.foursquare.com/docs/explore#req=venues/trending%3Fll%3D37.755516,-122.44812
I tried both links with my own Client ID and Client Secret outside of the explorer, but again I only got results for 40.7, -74. This leads me to believe that it must be the coordinates I'm giving it, although I cannot figure out why.
Many thanks in advance.
Not all points have trending venues nearby. If the check-in volume in the area is low, or no venues are especially busy at the moment, there will be no trending venues.
Here is a spot in San Francisco that, at the time of this writing, has trending venues: https://developer.foursquare.com/docs/explore#req=venues/trending%3Fll%3D37.786793,-122.405211
You can try increasing the "radius" parameter to capture more trending venues nearby. Here is an example of your query with a higher radius, so it captures more venues: https://developer.foursquare.com/docs/explore#req=venues/trending%3Fll%3D37.755516,-122.44812%26radius%3D20000

google places - Get a list of street addresses from a lat/long

I need to be able to search for addresses within the radius of 500M-1000M from a lat-long. Google places seems to be able to do this and give it to me in JSON which is awesome, but it is only returning businesses and establishments. I want every postal address in this radius. I have tried adding:
&types=street_address but it returns no results.
Is this possible and has anyone got any info on how to do this.
Have you tried the Google Maps API Web Services
- in the Viewport Biasing section you can set bounds.

OSM API how to get all suburbs by city?

Can someone tell me how to get a list of suburbs by city (name,id,whatever) in OpenStreetMap API? I can't find any detailed documentation and the API is pretty abstract.
I'm looking at extended API, Xapi. I found how I can get nods and filter only suburbs, but I don't know how to set the city value.
http://www.informationfreeway.org/api/0.6/node[place=suburb]
Any other way or API is welcomed. Looked at geonames and google maps, but haven't found what I'm looking for. I need a list of all suburbs in Zagreb/Croatia and a way to check if a specific street is in that suburb. OSM has a pretty good and accurate data as I can see, but I'm having troubles with this API.
Have you tried setting the bounding box and then filtering the results to ensure that they are actually within Zagreb?
Here's a URL using a bounding box created on openstreetmap.org
http://open.mapquestapi.com/xapi/api/0.6/node[place=suburb][bbox=15.807,45.761,16.18,45.875]
This gives you names, but since I'm still new to OSM, I'm not quite sure how you establish their admin level and whether they actually lie within Zagreb or just within that bounding box. There may be further requests that could establish this info.
For your purposes I would use OSM Server Side Script
here is the documentation