[R-sig-Geo] Conversion of a SpatialPolygonsDataFrame into a ESRI file

Pınar Aslantas Bostan aslantas at metu.edu.tr
Tue Mar 20 12:36:24 CET 2012


Dear Cristina,

For this purpose I use "write.table" function.

my code is this;

write.table(dem, file="D:\\Data\\dem_outputs.txt", quote = TRUE, dec = ".",
qmethod = c("escape", "double"))

# "dem" is SpatialPixelsDataFrame in my study.

then you can add your data as txt file in ArcGis.

I hope this helps.

Best wishes,
Pinar


-----Original Message-----
From: r-sig-geo-bounces at r-project.org
[mailto:r-sig-geo-bounces at r-project.org] On Behalf Of Cristina Silva
Sent: Tuesday, March 20, 2012 1:11 PM
To: r-sig-geo at r-project.org
Subject: [R-sig-Geo] Conversion of a SpatialPolygonsDataFrame into a ESRI
file

Dear all,

I need to export a SpatialPolygonsDataFrame to a shapefile to  be read by
ArcGIS. I have used several packages and functions to do this with different
results.

1) with maptools, function writePolyShape: The file .prj is not created

2) with spsurvey, function sp2shape: Doesn't work, gives the following
message "Error: Opening .prj file in C function writeShapeFilePolygon"

3) with rgdal, function writeOGR:

  * with data projected (transforming longlat into utm) or not (longlat:
    the file is read by ArcGIS. However, when I try to open the
    Attributes table, it gives the message that could not load the data
    from the data source, suggests to refresh (which is not possible)
    and opens an empty table, although having the number of columns and
    lines of the data. Looking for the info of each polygon in the map,
    the data are displayed for each individual record. So, the data
    exist but are not acessible from the Attributes Table.
  * To display the Attributes Table, I had to convert the .dbf file in
    .csv and export again as a .dbf.

Is there any better way to make this conversion?

Cristina

--
------------------------------------------
Cristina Silva
INRB/L-IPIMAR
Unidade de Recursos Marinhos e Sustentabilidade Av. de Brasmlia, 1449-006
Lisboa Portugal
Tel.: 351 21 3027096
Fax: 351 21 3015948
csilva at ipimar.pt


	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list