Interior of Polygons
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