8

Is there any such API where given a location (in terms of latlong), I could find whether the given point is on road/street or not. And if possible also gives me nearest street/road to that location. I found API from [Find nearby Streets] -> http://www.geonames.org/maps/us-reverse-geocoder.html#findNearbyStreets , but it just gives solution for US. Help me if u know of any better solution/algorithm. ( I am particularly interested in India.)

Kara
  • 6,115
  • 16
  • 50
  • 57
Swati
  • 153
  • 1
  • 5
  • 10

3 Answers3

8

You can use the Google Maps Geocoding API which does exactly that: https://developers.google.com/maps/documentation/geocoding/intro

Take a look at the "Reverse Geocoding" section.

PsyGik
  • 3,535
  • 1
  • 27
  • 44
Mathias Schwarz
  • 7,099
  • 23
  • 28
5

Google maps api provides reverse Geocoding api, you need to pass lat and long values to get address

http://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&sensor=true_or_false

Check this http://code.google.com/apis/maps/documentation/geocoding/#JSON

Sandeep Manne
  • 6,030
  • 5
  • 39
  • 55
  • Thank You Sandeep and Mathias. Could any of you tell me if there is a way by which I can know that the given lat long lies on a road or not. Basically I want to eliminate points which are not on street in my app, i.e. if anybody is using my app sitting at home, I do not want that lat long to be stored. – Swati Jul 09 '11 at 08:48
  • Is there any way to plot such points on nearest road's lat long? – Suresh Prajapati Sep 22 '17 at 12:53
1

Much simpler with OSRM (nearest) webservice. Look at my answer here:

https://stackoverflow.com/a/30403046/4640499

Community
  • 1
  • 1
Jonatas Walker
  • 13,583
  • 5
  • 53
  • 82