Extract all addresses\ LatLng in the polygon

5,541 views
Skip to first unread message

Hassan Kool

unread,
Sep 6, 2010, 1:01:58 AM9/6/10
to Google Maps JavaScript API v3
Hi all,
I have been doing this from days but no success yet, please guide me:
My application is selecting a specific area and send updated
information to all the addresses.
I was able to draw a polygon on map. I want to extract all the
addresses or LatLang with in that polygon.
Mostly I found the solution for searching point in a polygon, In my
case I don't have any points.. I need all points with in polygon.

warmest,
Hassan

Rossko

unread,
Sep 6, 2010, 5:35:05 AM9/6/10
to Google Maps JavaScript API v3
> I was able to draw a polygon on map. I want to extract all the
> addresses or LatLang with in that polygon.

The API doesn't provide any facilities to find all the addresses in a
polygon.

There are an infinite number of lat-long points within any polygon.

Are you trying to search through your own data to see what is inside
the polygon?
Are you trying to find all the markers on your map that are within the
polygon?
Point-in-polygon is probably exactly what you need ; iterate through
all your markers and test each one in turn.

Hassan Kool

unread,
Sep 7, 2010, 8:25:32 AM9/7/10
to Google Maps JavaScript API v3
Please be Kind with me here, I do know the algorithm for searching a
point in a polygon.
my problem is I dont have any data, what I want to try is "pick all
the latlng points with the polygon.
yes the points can be infinite and didn't knew API dose not support
it.
Is there any alternate way picking multiple latlng within a polygon??



> The API doesn't provide any facilities to find all the addresses in a
> polygon.
>
> There are an infinite number of lat-long points within any polygon.
>
>

Rossko

unread,
Sep 7, 2010, 12:28:27 PM9/7/10
to Google Maps JavaScript API v3
> my problem is I dont have any data, what I want to try is "pick all
> the latlng points with the polygon.

I'm still not sure what you are trying to achieve?

If you decided not to pick all the lat/long points but perhaps only
those at 1 nanometre intervals, it would be possible to write some
code to do that, but it will still be rather a lot of points.

If you want some external service to provide you with all the postal
addresses within a polygon, I don't know of one at all. Although
www.geonames.org does some clever things, have a look.

Maps.Huge.Info (Google Maps API Guru)

unread,
Sep 7, 2010, 1:29:40 PM9/7/10
to Google Maps JavaScript API v3
You're pretty much out of (free) luck with what you're trying to do.
There is no free API that will return that information. This type of
information is extremely valuable and will set you back a fortune if
you pursue this with a commercial direct mail provider. The best you
could do is get things like street names or even address ranges and
that's only if you're looking in the US. If that's the case, look at
the Census Tiger database. It contains all the (well, most) streets
and their address ranges in the US. There's some data for Canada as
well but that's another database.

That's about the best you'll be able to do for free.

-John Coryat

http://maps.huge.info

http://www.usnaviguide.com

http://www.zipmaps.net

Alekhya Datta

unread,
Nov 22, 2010, 7:31:36 AM11/22/10
to google-map...@googlegroups.com
Dear Sir,

I would like to know whether it is possible to extract all addresses/LatLng in the polygon (for India) by using Google API Premier. Please let me know, if possible.

Thank you!!!!

Regards,
Alekhya Datta.

Rossko

unread,
Nov 22, 2010, 8:56:11 AM11/22/10
to Google Maps JavaScript API v3
> I would like to know whether it is possible to extract all
> addresses/LatLng in the polygon (for India) by using Google API
> Premier.

Nope.

Please read the preceeding answers.

There are an infinite number of lat/long in any polygon, so you can't
get those in a single lifetime.
You can calculate lat/longs at intervals inside the polygon. The
closer the intervals, the more calculation to do.
You could then reverse geocode the lat/longs to get addresses. You
might miss some, if the geocoder doesn't know them (all geocoders are
imperfect). You'd need some logic to detect duplicated "hits". It
will probably take a long time ; geocoders usually have rate and
volume query limits. You might set up your own database and search
that ; then you won't be constrained by limits and you can limit the
data to be searched to a smaller subset that you are interested in.

Alekhya Datta

unread,
Nov 22, 2010, 11:42:58 PM11/22/10
to Google Maps JavaScript API v3
Dear Sir,

I want to access/extract all the possible markers of any particular
City/Location in India by using any Google Maps APIs (Public/Premier).
Please let me know whether it is possible or not. If possible please
ensure me some guidelines.

For example:

City Name: Xyz
Now what I intend to do is to capture and extract all the markers such
as schools/shops/multiplexes/hospitals etc which are linked/located to
that city (Xyz).

Thank you!!!

Regards,
Alekhya Datta.

Rossko

unread,
Nov 23, 2010, 3:56:41 AM11/23/10
to Google Maps JavaScript API v3
> I want to access/extract all the possible markers of any particular
> City/Location in India by using any Google Maps APIs (Public/Premier).
> Please let me know whether it is possible or not.

Not possible.

blob

unread,
Nov 23, 2010, 4:00:48 AM11/23/10
to Google Maps JavaScript API v3
> I want to access/extract all the possible markers of any particular
> City/Location in India by using any Google Maps APIs (Public/Premier).
> Please let me know whether it is possible or not.

Just as said before, this is not possible with the Google Maps APIs.

Will Cadell

unread,
Nov 24, 2010, 2:40:44 PM11/24/10
to google-map...@googlegroups.com
If you are looking for markers of specific things like shops etc, perhaps you could use the (points of interest) POI bit of the API? i see there is a medical and a businesses POI. this would enable you to create a basemap of your features emphasised on a map. If you are looking to actually extract a database of markers, then you are looking at writing a urllib script and systematically sampling the google geocoding db, which I am sure they will not thank you for!

w
Reply all
Reply to author
Forward
0 new messages