[R-sig-Geo] warning at creating SpatialPolygonsDataFrame and error at saving through rgdal

Agustin Lobo alobolistas at gmail.com
Mon Nov 29 13:21:31 CET 2010


Hi!

I create a SPDF with a function
HypNAr = meta2sppol()

that ends up with:

sitios <- 1:length(noms)
row.names(datos) <- sitios
SpatialPolygonsDataFrame(dummy, data=datos, match.ID = T)

but get:

Warning message:
In data.row.names(row.names, rowsi, i) :
  some row.names duplicated: 2 --> row.names NOT used

I do not understand, as I define the row names as a sequence of
integers, how can they be duplicated?
I can plot the SPDF and the data slot is correct, but when I try to
save as shapefile:

> writeOGR(HypNAr,dsn="HypNAr",layer="HypNAr",driver="ESRI Shapefile",verbose=T)
Error in writeOGR(HypNAr, dsn = "HypNAr", layer = "HypNAr", driver =
"ESRI Shapefile",  :

	GDAL Error 1: Invalid index : -1
Calls: writeOGR -> .Call
In addition: There were 11 warnings (use warnings() to see them)

Is this error related to the previous warning?

Thanks!

Agus



More information about the R-sig-Geo mailing list