[R-sig-Geo] PBSMapping package: what are the default units for calcArea() results

Rick Reeves reeves at nceas.ucsb.edu
Wed Oct 18 20:08:23 CEST 2006


I am using the PBSMapping package calcVoronoi() routine to calculate 
ROIs surrounding elements in
an imported ESRI point shape file. Point coords are in decimal lat/long.

here is the gist of the code.....

sites <- read.csv("ThreeCountyPoints.csv")

coordinates(sites) = c("LonDD","LatDD")

events <- 

Vpolys <-calcVoronoi(events)

plotPolys(Vpolys) # the voronois look good.

polyData <- calcArea(Vpolys)

# polyData's Z attribute contains numbers in the magnitude.01 - .0001

Two questions:

1) What are the units of polyData.Z , and how can I convert them to km**2 ?

    If I try to convert the units to UTM, as suggested in the PBSMapping 
user guide, as below,

    attr(Vpolys,"zone") <- 9
    VpolysUTM <- convUL(Vpolys)

I get the error:
--> Error in convUL(Vpolys) : Missing or invalid projection attribute.

2) Can you suggest a way in which I could clip the Voronois in the 
polySet using
     as a clipping polygon the county boundary polygons contained in a 
     (TcPoly), generated  from an incoming polygon shapefile (also 
lat/lon DD):

TriCounty <-read.shape("TriCountyPolyDD.shp")
TcPolys = Map2poly(TriCounty)

# here are the contents of the TriCountyPolyDD shapefile:
# GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",

Please see attached jpg for the 'big picture'

Many thanks for any suggestions!

Rick Reeves

Rick Reeves	
Scientific Programmer / Analyst	
National Center for Ecological Analysis and Synthesis
UC Santa Barbara
reeves at nceas.ucsb.edu
805 892 2533

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PbsVoronoiWCty.jpg
Type: image/jpeg
Size: 28543 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20061018/32f4b5ee/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reeves.vcf
Type: text/x-vcard
Size: 339 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20061018/32f4b5ee/attachment.vcf>

More information about the R-sig-Geo mailing list