How to select features by a polygon?

2,698 views
Skip to first unread message

smilewoo

unread,
Feb 4, 2009, 3:11:54 AM2/4/09
to KML Developer Support - Google Earth Browser Plugin
I wonder if google earth api support to select features by a polygon?

fraser [Earth API Guru]

unread,
Feb 4, 2009, 8:32:23 AM2/4/09
to KML Developer Support - Google Earth Browser Plugin
Hi,

Sorry, not so sure what you mean...
Do you mean you wish to select all the features that are polygons or
somthing else?

F.

AlanHale

unread,
Feb 5, 2009, 12:28:32 PM2/5/09
to KML Developer Support - Google Earth Browser Plugin
I'm guessing he/she means "can you draw a polygon around a group of
placemarks or other polygons and select them". As you might in a
desktop GIS or Mapserver application. And I'm guessing the answer is
no.

Cheers

Alan
> > I wonder if google earth api support to select features by a polygon?- Hide quoted text -
>
> - Show quoted text -

shsavage

unread,
Feb 5, 2009, 2:02:13 PM2/5/09
to KML Developer Support - Google Earth Browser Plugin
Hi,

If you want to draw a polygon on your map and select features
inside it, then it can be done, but it involves quite a lot of
javascript to empower digitizing on the browser, plus a spatial search
program running on your server that would send the search results back
to the browser or to Google Earth. The Digital Archaeological Atlas
of the Holy Land (http://daahl.ucsd.edu) has a "Spatial Search"
function that does it; you draw a search polygon and get back sites
that are in the search region first as a list of sites in regular
HTML, then you can select the sites to map, and they are pushed ack to
the client as a .kml file.

-Steve

AlanHale

unread,
Feb 10, 2009, 6:40:38 AM2/10/09
to KML Developer Support - Google Earth Browser Plugin
I was very interested to see this example - very impressive. Thanks
Steve. Although the example is using Google Maps to pull out KML which
is then displayed in the GE client, rather than the plugin, I guess
something similar could be done with the plugin.

Alan

Roman N

unread,
Feb 13, 2009, 4:14:50 PM2/13/09
to KML Developer Support - Google Earth Plug-in
This can also be done on the client side, albeit with usually much
worse performance. You can use Mike Williams' EPoly class to iterate
through all points and see if the polygon contains them:

http://econym.googlepages.com/epoly.htm

This will probably have decent performance only up to a few hundred
points, at best.

- Roman
Reply all
Reply to author
Forward
0 new messages