readShapeSpatial失败,简化了mapshaper.org形状

时间:2014-09-25 16:16:08

标签: r mapping mapshaper

因此,我正在绘制我国的邮政地区,它是一个巨大的,540万行的数据帧。我不需要每一个小小的扭曲和转弯的边界,所以我非常兴奋地发现mapshaper.org。看似很容易,我只是把我的.shp文件扔进去了,它吐出了10%大小的文件!优秀!

没有..现在它没有玩readShapeSpatial ...希望我不需要提供shapefile(我可以跟踪它,如果这些部分真的有必要的话)

原始代码,作品:

canada.shp <- readShapeSpatial("canada", verbose=TRUE, delete_null_obj=TRUE)

新地图,不是:

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()显示:

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)

0 个答案:

没有答案