Trying to determine the N / S / E / W side of a street from the Google Maps API

We've used the Google Maps API to get some specific GIS information, but we're struggling to get the side of the street where the address or geocode is located. I have looked through the stackoverflow and google maps api groups but don't see too many other people who want / need this.

As an example 40 St Marks Ave, Brooklyn, NY

is on the S (south) side of the street, we can see this if we build it using Google Maps, but I don't see where this information is returned when we create an API call.

If this is something the API doesn't really return, do any of you have a clever way to figure it out? I scratched my head over this and started to think that I was just not looking at it completely right.

btw, we definitely need the street information side returned as compass coordinates (aka N / S / W / E).

Thank.

+3


source to share


2 answers


If I needed it, I would:



  • See if ROOFTOP geocodes are available in the area of โ€‹โ€‹interest (they are for 40 St Marks Ave, Brooklyn, NY "location_type": "ROOFTOP"), if ROOFTOP geocodes are not available it probably won't work.
  • get directions from this point to yourself (should give you the closest location on the road): example
  • calculate [bearing] (from street to building or vice versa, whichever gives you what you need).
  • use this to determine the direction of the compass.
0


source


A simple solution that comes to mind is to use a timestamp on multiple shots when driving on the street. From there we can find out the direction of movement and find out if the building was on the left or right of the street.



-2


source







All Articles