Monday, January 31, 2011

[Google Maps API v2] Re: Using Geolocation to determine a custom territory

On Jan 31, 8:55 pm, Marc Stevens <marc.steven...@gmail.com> wrote:
>
> I would like to automate that so the territory code can be determined
> by the application.  I know how to get the geolocation from an address
> and vice-versa, but I don't know how to map out our custom territory
> areas.
>
> Any pointers on where to start?

A link to see how things are currently organised would have helped,
but a hint is "Point in polygon analysis". Define your territories as
polygons; get the point you're interested in; find which polygon
contains it. It's a useful four-word search phrase for your favourite
search engine.

For five polygons you might be able to do it client-side, defining
your shapes as GPolygon objects -- in which case Mike's EPoly
extension will do the job for you with its .Contains() method.
http://econym.org.uk/gmap/epoly.htm (Another hint: you don't need to
add polygons to the map until you're ready to display them, but you
can analyse them without adding them to a map)

Server-side methods are scalable -- click anywhere in England on the
map at http://www.achurchnearyou.com/parishfinder.php and the point
will identify one of 16000 polygons. Its details are then sent back to
the browser for display.

--
You received this message because you are subscribed to the Google Groups "Google Maps API V2" group.
To post to this group, send email to google-maps-api@googlegroups.com.
To unsubscribe from this group, send email to google-maps-api+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate