So I'm mapping out the postal regions of my country and it's an enormous, 5.4million row dataframe. I don't need every single little twist and turn of the boundries, so I was super excited to discover mapshaper.org. Seemed easy enough, I just threw my .shp file into it, and it spit back a file 10% of the size! Excellent!
Nope.. now it doesn't play with readShapeSpatial... Hopefully I won't need to provide the shapefile (i can track it down if that parts really necessary)
Original code, works:
canada.shp <- readShapeSpatial("canada", verbose=TRUE, delete_null_obj=TRUE)
New map, doesn't:
canada.shp <- readShapeSpatial("simplecanada", verbose=TRUE, delete_null_obj=TRUE)
Shapefile type: Polygon, (5), # of Shapes: 1621
Error in `rownames<-`(`*tmp*`, value = c("0", "1", "2", "3", "4", "5", :
attempt to set 'rownames' on an object with no dimensions
In addition: Warning message:
In .Map2PolyDF(Map, IDs = IDvar, proj4string = proj4string, force_ring = force_ring, :
Null objects with the following indices deleted: 895
traceback() reveals:
4: stop("attempt to set 'rownames' on an object with no dimensions")
3: `rownames<-`(`*tmp*`, value = c("0", "1", "2", "3", "4", "5",
"6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16",
"17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27",
"28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38",
"39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49",
"50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60", (ETC!!!!)
2: .Map2PolyDF(Map, IDs = IDvar, proj4string = proj4string, force_ring = force_ring,
delete_null_obj = delete_null_obj, retrieve_ABS_null = retrieve_ABS_null)
1: readShapePoly("simplecanada",
verbose = TRUE, delete_null_obj = TRUE)
readOGR()
of thergdal
package?