Skip to content

Writing SpatialPolygonsDataFrame object to an ESRI Shape File format? `

2 messages · Rick Reeves, Roger Bivand

#
Thanks for earlier help finding the new SpatialPolygons classes..
My final (for now) question, that I can't answer from various
documents is:

How to write my SpatialxxxxDataFrame object to an ESRI Shape File?

the previous method I used was:

writeSRDFShape(SRDF, OutputShapeFileRoot)

I have both a SpatialPolygon and SpatialPolygonDataFrame objects to use
as input...

Thanks, RR
#
On Wed, 21 Dec 2005, Rick Reeves wrote:

            
The functions are wrappers in maptools using sp classes, but because 
shapefiles have to have dbf, the easy wrapper takes a 
SpatialPolygonDataFrame object:

writePolyShape(obj, file="whatever")

with reading now being readShapePoly()

We haven't managed to write a correct *.prj file yet, but would like to - 
I think the code is in GDAL and PROJ.4 with examples in GRASS, but I 
haven't done it - help would be welcome!

Best wishes,

Roger