Jane (rusers.sh) wrote
>>>>>>  Does anybody know how to convert points to the SHP polygons?
>>>>>>  OR whether we can generate some SHP polygons randomly in R?
>>>>>> ##Example##
>>>>>> win<-owin(c(0,1),c(0,1))
>>>>>> pp <- runifpoint(10) #generate 10 points
>>>>>> #i want to change these 10 points into 10 SHP polygons,something
like

>>  What i want to get is the the class of SpatialPolygons(sp) based on the
>> generated Voronoi tessellation.
>>  Any ideas or suggestions are greatly appreciated.

Here is a quicker solution, (still using the spatstat library):
polys <- as(dirichlet(pp), 'SpatialPolygons')

dirichlet() gives you the Dirichlet/Voronoi tesselation, and as() coerces
it to SpatialPolygons, which can then be exported to a shapefile using
rgdal.

Bjarke Christensen

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to