[R-sig-Geo] converting between SpatialPolygonsDataFrame polygons and gpc.poly objects

Roger Bivand Roger.Bivand at nhh.no
Mon Jun 6 10:59:17 CEST 2011


On Mon, 6 Jun 2011, brwin338 wrote:

>
> Good Evening
> I have spent a good deal of time reading the list and the book "Applied Spatial Data Analysis with R" and as well as trying to figure this one out but can't quite seem to get it.
> I would appreciate it greatly if someone could direct me to a site (or send me an example) describing how I could do the following:
>
> (1) I have a SpatialPolygonDataFrame (SPDF) object.
> (2) I want to convert the SPDF object's polygons into a list of gpc.poly objects.
> (3) I then perform a set of operations on the list of gpc.poly objects (this one works fine with a set of artificial data) giving me a second list of gpc.poly objects.
> (4) I then want to convert the second list of gpc.poly objects back into a SPDF object where I can then add information into the the new SPDF at data data frame.
>
> Any help would be appreciated.

Briefly, don't. The gpclib package has a bad license, and should be 
avoided. Apart from triangle splitting of polygons, everything that gpclib 
does can be done in rgeos, which additionally provides SPDF/gpc.poly 
interfaces and mimics gpclib code if you need to use that syntax 
(internally it converts back to SPDF). So, please use rgeos, not gpclib.

Roger

>
> Joe
>
>
>
> .
>
>
>
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no



More information about the R-sig-Geo mailing list