Skip to content

CRS problem with Polyset2SpatialPolygons (maptools, PBSmapping)

2 messages · Delphine Antoniucci, Roger Bivand

#
On Thu, 10 Mar 2011, Delphine Antoniucci wrote:

            
No, it isn't obvious. PBSmapping "knows" unprojected (geographical 
coordinates) and UTM (projected coordinates) with a zone number. It does 
not provide facilities to store any other values.
So if you examine the projection of:

attr(SpatialPolygons2PolySet(mapproj), "projection")

you'll see that it is set to "1", to signal that it is not "LL" or "UTM". 
This is copied in joinPolys() to the output object.

PolySet2SpatialPolygons() was written assuming that the limitations of the 
PolySet representation of coordinate reference systems should be 
respected. For the future, I'll have it insert as.character(NA) and issue 
a warning.

For now, I suggest using spTransform() in rgdal on the input objects to 
transform them to CRS("+proj=longlat +ellps=GRS80") and back out on 
return. I hope that no datum shift will take place, you'd need to check 
whether the initial and final coordinates matched.

Hope this helps,

Roger