Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201894

st_simplify dTolerence with decimal degree

$
0
0

I'm trying to reduce the size of sf object by applying st_simplify. CRS is 4267 and try to play around with the right level of dTolerance. I understand that the unit of dTolerance has to be that of the CRS, so I started with 0.1, but I constantly getting this error message.

test <- st_read("comm_sf.shp") %>%
+   st_simplify(preserveTopology = T,
+               dTolerance = 0.1)
Simple feature collection with 11321 features and 21 fields
geometry type:  MULTIPOLYGON
dimension:      XY
bbox:           xmin: -124.4375 ymin: 24.5441 xmax: -66.94983 ymax: 49.00249
epsg (SRID):    4326
proj4string:    +proj=longlat +datum=WGS84 +no_defs
Warning message:
In st_simplify.sfc(st_geometry(x), preserveTopology, dTolerance) :
  st_simplify does not correctly simplify longitude/latitude data, dTolerance needs to be in decimal degrees

I play around with both setting dTolerance = 1000 (in case it's in meters) and dTolerance = 0.1 (in case it's in long/lat), but I get the same error message. This happens with CRS = 4267 as well. How can I fix this?


Viewing all articles
Browse latest Browse all 201894

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>