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

Edzer Pebesma edzer.pebesma at uni-muenster.de
Sat Jun 22 11:13:32 CEST 2013


sp::spplot has an identify argument that, what TRUE, returns the points
identified; does not work for lines, polygons, grids.

sp::bubble() has the same functionality.

Have a nice weekend!

On 06/22/2013 03:25 AM, Robert J. Hijmans wrote:
> 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()

If you do this, I'm not sure whether identify() can still find out that
it was spdf that was plotted.

>>
>>  [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
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> 

-- 
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
83 33081, Fax: +49 251 8339763 http://ifgi.uni-muenster.de



More information about the R-sig-Geo mailing list