Skip to content
Back to formatted view

Raw Message

Message-ID: <200703261902.l2QJ2aPf009484@pantheon-po13.its.yale.edu>
Date: 2007-03-26T19:02:34Z
From: Andrew Niccolai
Subject: PBSmapping to SpatialPolygonsDF
In-Reply-To: <Pine.LNX.4.44.0703260839580.24212-100000@reclus.nhh.no>

Is there a pre-existing function or a clever way to pull a PBSmapping object
of class "Polyset", "data.frame" into a SpatialPolygonsDataFrame?

I found the SpatialPolygons2PolySet function and was hoping that there is a
way to go the other direction.

I have created a voronoi tessellation for a set of 627 points and then
clipped that by the convex hull of those points.  The object looks like
this:

> class(cb.tess)
[1] "PolySet"    "data.frame"
> names(cb.tess)
[1] "PID" "POS" "X"   "Y"  
> head(cb.tess)
  PID POS        X        Y
1   1   1 945062.2 860290.8
2   1   2 945073.5 860273.0
3   1   3 945062.7 860272.6
4   1   4 945062.5 860272.7
5   1   5 945055.9 860277.4
6   1   6 945057.8 860291.4
> tail(cb.tess)
  PID POS        X        Y
1 626   9 944972.3 859813.1
2 627   1 945009.7 859794.3
3 627   2 944993.8 859769.0
4 627   3 944985.3 859763.3
5 627   4 944990.9 859804.2
6 627   5 945008.2 859804.6

I would like to slip back into the world of SPDF if possible.

Thanks in advance for help, suggestions or code.

cheers

Andrew Niccolai
Doctoral Candidate
Yale School of Forestry
203-432-5144