[R-sig-Geo] Interior of Polygons

Roger Bivand Roger.Bivand at nhh.no
Fri Apr 20 19:36:16 CEST 2012


On Fri, 20 Apr 2012, Kemp, Michael wrote:

> Hey Jesús,
> See getKMLcoordinates() in the maptools package to extract the 
> coordinates of the polygons and the points from the kml file.  Then, 
> point.in.polygon() in the sp package should be able to do what you want.

Or rather easier use readOGR() in rgdal to read the file, possibly 
preceded by ogrListLayers() if you do not know the layer name; OGR has a 
KML driver. Then use the over() methods in the sp package.

Hope this helps,

Roger


> Regards,
> Michael
>
> From: r-sig-geo-bounces at r-project.org [mailto:r-sig-geo-bounces at r-project.org] On Behalf Of Alonso Nanclares, Jesús Alberto
> Sent: Friday, April 20, 2012 8:50 AM
> To: r-sig-geo at r-project.org
> Subject: [R-sig-Geo] Interior of Polygons
>
> Hi dear members of the list,
>
> I have a KML file with the coordinates of some polygons and a set of bi-dimensional points, and I'm facing the problem of classifying the points in the respective polygons. Does anyone know how to define the interior of polygons, or of a different way to solve the problem? Any idea is well received.
>
> Thank you so much,
>
> Jesús Alberto Alonso Nanclares
> Consultor Junior
> Business Intelligence
>
> C/ Anabel Segura 7
> 28108 Alcobendas (Madrid)
> España
>
> T +34 914 807 877
> jaalonson at indra.es<mailto:jaalonson at indra.es>
> www.indracompany.com<http://www.indracompany.com>
>
> [indra]
>
>
> ________________________________
> Este correo electrónico y, en su caso, cualquier fichero anexo al mismo, contiene información de carácter confidencial exclusivamente dirigida a su destinatario o destinatarios. Si no es vd. el destinatario indicado, queda notificado que la lectura, utilización, divulgación y/o copia sin autorización está prohibida en virtud de la legislación vigente. En el caso de haber recibido este correo electrónico por error, se ruega notificar inmediatamente esta circunstancia mediante reenvío a la dirección electrónica del remitente.
> Evite imprimir este mensaje si no es estrictamente necesario.
>
> This email and any file attached to it (when applicable) contain(s) confidential information that is exclusively addressed to its recipient(s). If you are not the indicated recipient, you are informed that reading, using, disseminating and/or copying it without authorisation is forbidden in accordance with the legislation in effect. If you have received this email by mistake, please immediately notify the sender of the situation by resending it to their email address.
> Avoid printing this message if it is not absolutely necessary.
>

-- 
Roger Bivand
Department of Economics, NHH Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no


More information about the R-sig-Geo mailing list