[R-sig-Geo] identify methods for sp-class objects

Robert J. Hijmans r.hijmans at gmail.com
Sat Jun 22 03:25:47 CEST 2013


Barry

See:
library(raster)
?click
?select

identity could be a better name than click. And I am sure you can
improve these functions.
Robert



On Fri, Jun 21, 2013 at 10:55 AM, Barry Rowlingson
<b.rowlingson at lancaster.ac.uk> wrote:
> Has anyone written a set of 'identify' methods for sp-class objects?
>
> For example, given a spatial polygons data frame, I want to do:
>
> plot(spdf)
> identify()
>
>  [click click click]
>
> [1] 23 NA 5
>
> showing my mouse clicks were over polygon 23, no polygon, polygon 5.
>
> For overlapping spdfs, an option might be:
>
> identify(multi=TRUE)
>
> which would return a list of polygon indices under each click.
>
> For spatial line structures, a similar function would either return
> the nearest line feature, or all line features within a tolerance.
>
> Similarly for SpatialPoints.
>
> If these don't exist in some package, then I have a job for the weekend...
>
> Barry
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo



More information about the R-sig-Geo mailing list