Hi!

I have a set of shapefiles, each one with one single polygon, and I
want to end up with one single SpPolDF including all polygons.
I read the set of shapefiles with readOGR() and thus get one SpPolDF
for each polygon.
I (unsuccessfully)  try:
> delme <- rbind.SpatialPolygonsDataFrame(BesosBoundary,TerBoundary)
Error in validObject(.Object) :
  invalid class "SpatialPolygons" object: non-unique Polygons ID slot values
Calls: rbind.SpatialPolygons ... SpatialPolygons -> new -> initialize
-> initialize -> validObject

> delme <- rbind.SpatialPolygonsDataFrame(BesosBoundary[1],TerBoundary[1])
Error in validObject(.Object) :
  invalid class "SpatialPolygons" object: non-unique Polygons ID slot values
Calls: rbind.SpatialPolygonsDataFrame ... SpatialPolygons -> new ->
initialize -> initialize -> validObject

> delme <- 
> rbind.SpatialPolygonsDataFrame(besosbound...@polygons,terbound...@polygons)
Error in as(x, "SpatialPolygons") :
  no method or default for coercing "list" to "SpatialPolygons"
Calls: rbind.SpatialPolygonsDataFrame -> do.call -> lapply -> FUN -> as

and some other variants.

Any help on how to do this? A solution would be using joinPolys from
maptools (the polygons do not overlap), but think that
rbind.SpatialPolygonsDataFrame() is better suited for this operation.

Agus

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to