Skip to content
Prev 9234 / 29559 Next

Writing ArcGIS Shapefiles from R; advice?

Shapefiles don't have separate layers, and one layer can only have one
geometry type (point, line, or polygon). GDAL can treat a single
folder with multiple shapefiles as if each shapefile were a separate
layer in a single dataset, but that is just GDAL functionality,
reflecting the OGR model, and is supported by other vector formats.

I'm not very familiar with Arc? products, so I'm not 100% on this, but
I think you would need to write each separate set of polygons, each
with an individual depth value, to a separate shapefile and proceed
from there. I don't know anything about how to get Arc to understand
configurations of shapefiles, but perhaps you could use one of the
other ESRI formats such as E00 (guessing here, I'll have a closer look
at the OGR formats - see rgdal's ogrDrivers() for the ones available
on your system).

If your SpatialPolygonsDataFrame really has multiple duplicate (in
X/Y) polygons with the separate depths, you can subset it for
individual depths with "[" and write those out individually:

e.g.

depth0 <- splydf[splydf$depth == 0, ]

HTH

Cheers, Mike
On Wed, Sep 8, 2010 at 8:07 AM, Gavin Simpson <gavin.simpson at ucl.ac.uk> wrote: