Thanks Tim, but I'm focused on sp Spatial classes only. 

Stefan

> Am 14.04.2014 um 01:28 schrieb Tim Keitt <tkeitt@utexas.edu>:
> 
> 
> 
> 
>> On Sun, Apr 13, 2014 at 1:36 PM, Stefan Jelkovich <stefjelko@gmail.com> wrote:
>> Hi all,
>> 
>> I’m struggling with the creation of a SpatialPoints/SpatialPointsDataFrame object containing MultiPoints. Is this possible at all?
>> 
>> # SinglePoints are that easy:
>> library(sp)
>> data(meuse)
>> coordinates(meuse) <- ~x+y
>> 
>> # MultiPolygons are that easy:
>> p1 <- Polygon(cbind(x=c(0, 0, 10, 10, 0), y=c(0, 10, 10, 0, 0)))
>> p2 <- Polygon(cbind(x=c(13, 13, 17, 17, 13), y=c(13, 17, 17, 13, 13)))
>> lp <- list(p1, p2)
>> pls <- Polygons(lp, ID="1")
>> mp <- SpatialPolygons(list(pls))
>> 
>> How can I put all the meuse data points in one MultiPoint object?
> 
> Dunno if this helps, but:
> 
> > library(rgdal2)
> > mpobj = MULTIPOINT(x = rnorm(10), y = rnorm(10))
> > mpobj
> MULTIPOINT (-0.150418982066854 1.228174844682584,-0.014968491947256 1.80 ... 
> > mpobj[[1]]
> POINT (-0.150418982066854 1.228174844682584) 
> > mpobj[[2]]
> POINT (-0.014968491947256 1.808892868472069) 
> > draw(mpobj)
> 
> THK
>  
>> 
>> Stefan
>> 
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> 
> 
> 
> -- 
> http://www.keittlab.org/

	[[alternative HTML version deleted]]

