Reputation: 590
My requirement is to save the specific are from the GMap. For example, I want to save the location are of NewYork city and once any vehicle entered in this area then we will get an alert. Vehicle updating his information through GPS. Please suggest me if anyone having some experience about it.
Upvotes: 1
Views: 194
Reputation: 553
I'm not sure what you mean exactly by "save the specific are from the GMap".
If you mean that you'd like to save a 'viewport' then you could retrieve the viewport coordinates for a particular search and use that as a defined area. Viewports are just large squares though, so this will include areas that are not 'New York City'
If you want to be more precise - i.e. to flag a car as it enters Manhattan, you would need a more detailed KMZ for the Manhattan New York City area.
The New York City Department of City Planning (DCP) provide KMZ's of all the boroughs which could be used to achieve a more accurate view of the area of interest. You could stitch them together to create an 'official' NYC city limits polygon. https://www.google.com/fusiontables/DataSource?dsrcid=1767628
To determine if a vehicle has entered any of these areas you would need to perform a 'Point-in-Polygon' test against the KML polygon(s).
There are previous discussions on how to do that Here and Here
Hope that helps
Upvotes: 2