[R] basic spatial query

Roger Bivand Roger.Bivand at nhh.no
Mon Jan 28 12:41:12 CET 2008


 <jgarcia <at> ija.csic.es> writes:

> 
> Hello;
> Please coud you advise me of a simple way to select points (x,y
> coordinates) that fall within a polygon.
> I've got a set of polygons, each one defined by an arbitrary number of
> points, and several points inside each polygon.
> I know this is simple with a GIS, but I'd rather do it inside R.

If your data are geographical, please see ?"overlay-methods" in the sp package.
You may also choose to follow up this question on the R-sig-geo list. There are
also ways of doing this at a lower level (without creating sp objects first) in
at least the splancs package, say if the data are not geographical.

Roger
 

> Thanks and best regards,
> Javier
> -----
> 
> ______________________________________________
> R-help <at> r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
>



More information about the R-help mailing list