[Edited to correct typo]
First you need to define polygons for each of the boroughs.
If you don't have the data from some source, like the Census Bureau,
and you only want NYC boroughs, then you can define them by tracing
them in a utility like this:
http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/tracker.html
Once you've done that, add the polygons to the code of your mashup,
for example
var Manhattan = new GPolygon.fromEncoded( ... etc.
Finally, after geocoding, test the latlon you got from the geocoder
using
if (Manhattan.getBounds().containsLatLng(latlng)) {
alert('Point is in Manhattan');
}
http://code.google.com/apis/maps/documentation/reference.html#GLatLng...
--
Marcelo - http://maps.forum.nu
--
On Feb 19, 9:14 pm, MikeTek <[email protected]> wrote:
> Hey all,
>
> I was interested in determining if a particular geocoded address (by
> using the longitude / latitude of that address) fell within new york
> city's limits (so the island of manhattan, or specifically queens, or
> specifically brooklyn).
>
> I was thinking it would be simply checking if the address's long/lat
> is greater than/less than certain long/lats that would be related to
> manhattan, however i'm not sure where to go from here.
>
> Could anyone provide some thoughts or resources on taking this
> further?
> I understand there is a 'locality' field returned by google in xml
> format, however I think i would like to try this (if possible) relying
> solely on longitude/latitude
>
> Thanks so much!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---