How to determinate in which polygon am I ?

35 views
Skip to first unread message

David B.

unread,
Sep 27, 2011, 4:28:31 PM9/27/11
to KML Developer Support - KML Server Side Scripting

Hi,

I would like to be able to determine, for a given position(lat and
long), in which polygon that position is located.

For example, if a have a KML file in which every state is represented
by a polygon, I would like to be able to tell in which state a given
set of lat and long is located.

Can I do this with a scripting server language ? With Google API ?

Thanks for your help!

David B.

Rossko

unread,
Oct 2, 2011, 10:57:38 AM10/2/11
to KML Developer Support - KML Server Side Scripting
> I would like to be able to determine, for a given position(lat and
> long), in which polygon that position is located.

There are well-known algorithms
http://www.google.com/search?q=point+in+polygon+testing

> For example, if a have a KML file in which every state is represented
> by a polygon, I would like to be able to tell in which state a given
> set of lat and long is located.

You can parse the KML to extract the poly coordinates into whatever
environment you are working in.
Reply all
Reply to author
Forward
0 new messages