How to convert from shape into polygon in R? There was shape2poly(shapefiles) but this function have been removed

StackOverflow https://stackoverflow.com/questions/17281009

  •  01-06-2022
  •  | 
  •  

문제

How to convert from shape into polygon in R? There was shape2poly(shapefiles) but this function have been removed, are shapefiles, maptools, spdep still packages for handling maps in R?

도움이 되었습니까?

해결책

I tend to use the OGR stuff, as it lets me work with data from a range of sources (geodatabases, kml, etc).

library(rgdal)
mylayer <- readOGR(dsn="/path/to/folder/containing/shapefile",
                   layer="shapefilename-minus-dot-shp")
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top