Is one address in a region of 4 intersections?

8 views
Skip to first unread message

Henryk Sarat

unread,
Aug 12, 2011, 8:34:57 PM8/12/11
to google-map...@googlegroups.com
have an interesting problem where I want to see if a pair of Latitude/Longitude points are within the region of 4 other specified ones. An application of this is specifying 4 intersections and seeing if the address is within that region. With the Google Maps Geocoding API (http://code.google.com/apis/maps/documentation/geocoding/) it's easy to convert the intersections into the long/lat and if the area is a perfect rectangle it's easy.... but what if the street is curvey? Does something like this already exist?

geoco...@gmail.com

unread,
Aug 12, 2011, 9:37:20 PM8/12/11
to Google Maps JavaScript API v3
You could possibly use the directions service to get the polylines for
the roads, use those polylines to create a polygon (or not), then do
point in polygon analysis to see if the address is inside that
polygon.

-- Larry

Henryk Sarat

unread,
Aug 14, 2011, 5:53:02 PM8/14/11
to google-map...@googlegroups.com
I was wondering if there was something like this already built, because this seems like a common problem that should have already been solved (at least in my eyes). Maybe there's a way to request this from google?

geoco...@gmail.com

unread,
Aug 14, 2011, 11:58:27 PM8/14/11
to Google Maps JavaScript API v3
On Aug 14, 2:53 pm, Henryk Sarat <henryksa...@gmail.com> wrote:
> I was wondering if there was something like this already built, because this
> seems like a common problem that should have already been solved (at least
> in my eyes).

Not a very common problem (at least from my experience on the v2 and
v3 map API groups.

> Maybe there's a way to request this from google?

Not currently, you could always add a feature request.

-- Larry
Reply all
Reply to author
Forward
0 new messages