0fnt
0fnt

Reputation: 8661

Check if coordinates lie in a region

If I have a (latitude,longitude) pair, is there a way to determine whether it lies in a 'region'. By region I mean the 'highlighted' result of an query in google maps. For example, when I search for Manhattan, a red region is highlighted. Does Google/Bing provide an API to query if a given coordinate lie in such a region? I am aware of the containsLocation API call that tells me if a coordinate lies in a polynomial already defined as a set of coordinates. The problem here is me not having all the coordinates that can define Delhi

Upvotes: 1

Views: 2420

Answers (1)

rbrundritt
rbrundritt

Reputation: 17954

Bing Maps provides an API called the GeoData API where you can pass in a coordinate and it will return the boundary information for the intersecting location (city in this case). https://msdn.microsoft.com/en-us/library/dn306801.aspx

Another method as mentioned by others in the comments is to use a reverse geocoding service. By passing in your coordinates it will return the name of the city in which that coordinate is in. Bing Maps also has a Reverse Geocoding service:

https://msdn.microsoft.com/en-us/library/ff701710.aspx

Upvotes: 1

Related Questions