Created
January 4, 2018 08:04
-
-
Save Jianghao/3b66ee682f643605f1ebe18bec37bc4c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# method 1 | |
Sys.setlocale("LC_TIME", "C") | |
options(encoding = "gbk") | |
shp <- maptools::readShapePoly("**.shp") | |
proj4string <- CRS("+proj=longlat +datum=WGS84") | |
proj4string(shp) <- proj4string | |
# method 2 | |
library(rgdal) | |
shp <- readOGR("**.shp", layer = "**", use_iconv = TRUE, encoding = "UTF-8") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
write_sf(obj = sf, dsn = dsn, layer_options = "ENCODING=GBK", driver = "ESRI Shapefile")