[R-sig-Geo] Writing ArcGIS Shapefiles from R; advice?

Gavin Simpson gavin.simpson at ucl.ac.uk
Wed Sep 8 00:07:26 CEST 2010


Dear List,

Firstly, a confession: I'm not a GIS expert and I have next to no
experience of using ArcGIS or shapefiles. Apologies if anything I write
below is stupid!

I have an ESRI ASCII grid file that I have read into R and successfully
(with the help of this list) processed it into a
SpatialPolygonsDataFrame object (via SpatialPixelsDataFrame). I have
unionised the polygons to a set of depth intervals, so all the
individual polygons associated with depths (say) between 1 and 2 m are
given the same ID; there are several depth intervals, therefore several
IDs. This is fine, and I'm happy with this, but I need to export this
object to ESRI Shapefile(s).

I have exported the whole SpatialPolygonsDataFrame object to a single
shapefile but when my colleagues open this in ArcGIS, there is a single
layer for all depth levels and they'd like to be able to have a layer
per polygon ID. Is this possible, to write out the
SpatialPolygonsDataFrame object such that ArcGIS knows that each polygon
ID is a separate layer?

I have worked out how to break apart the SpatialPolygonsDataFrame object
into the equivalent but with a single ID (depth interval), and have
written those out into separate shapefiles, one per depth interval,
which when loaded into ArcGIS are represented by separate layers, but
dealing with more than a few shapefiles at once is proving
"difficult" (!??!) for some, hence if it were possible to produce a
single shapefile with separate "layers" that might solve that particular
issue.

Second Q is; is there a way to include information about how ArcGIS
displays each layer/shapefile? For example, we'd like to give each
layer/shapefile a particular fill colour, so that when loaded by a user
into ArcGIS, the particular depth polygons have a nice gradient
representing depth. Is this even remotely possible from within R, or is
this something ArcGIS does and is separate from the shapefile per se?

Currently I am using writeOGR to read out these objects to ESRI
shapefiles.

The reason I ask these questions is because we have a lot of these lake
bathymetries and dealing with them in ArcGIS (to get separate layers and
colour those layers accordingly) by hand is a non starter and we don't
want to start writing VB scripts in Arc at this stage.

Thanks in advance for any pointers or suggestions you may have. And
apologies again for showing my ignorance as regards shapefiles.

All the best,

Gavin

-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Dr. Gavin Simpson             [t] +44 (0)20 7679 0522
 ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
 Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%



More information about the R-sig-Geo mailing list