Questions tagged «maptools»

5
通过R中的属性将SpatialPolygonsDataFrame子集化(即删除多边形)的简单方法
我想简单地基于@data数据框中的相应属性值从SpatialPolygonsDataFrame对象中删除一些多边形,以便我可以绘制一个简化的/细分的shapefile。到目前为止,我还没有找到一种方法来做到这一点。 例如,假设我要从此世界shapefile中删除所有面积小于30000的多边形。我该怎么做? 或者,类似地,我该如何删除Antartica? require(maptools) getinfo.shape("TM_WORLD_BORDERS_SIMPL-0.3.shp") # Shapefile type: Polygon, (5), # of Shapes: 246 world.map <- readShapeSpatial("TM_WORLD_BORDERS_SIMPL-0.3.shp") class(world.map) # [1] "SpatialPolygonsDataFrame" # attr(,"package") # [1] "sp" head(world.map@data) # FIPS ISO2 ISO3 UN NAME AREA POP2005 REGION SUBREGION LON LAT # 0 AC AG ATG 28 Antigua and Barbuda 44 83039 …
75 r  mapping  spatial  maptools 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.