New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
s2_simplify() #51
Comments
Doesn't |
!!!! Very cool, definitely the way to go. |
Still working on the details, but this is looking really good in #70! library(s2)
library(sf)
#> Linking to GEOS 3.7.2, GDAL 2.4.2, PROJ 5.2.0
st_as_sfc.s2_geography <- function(x) st_as_sfc(s2_as_binary(x))
germany <- s2_data_countries("Germany")
germany %>% st_as_sfc() %>% plot() withr::with_par(list(mfrow = c(2, 2)), {
s2_simplify(germany, 1e2) %>% st_as_sfc() %>% plot(main = "0.1 km")
s2_simplify(germany, 1e3) %>% st_as_sfc() %>% plot(main = "1 km")
s2_simplify(germany, 1e4) %>% st_as_sfc() %>% plot(main = "10 km")
s2_simplify(germany, 1e5) %>% st_as_sfc() %>% plot(main = "100 km")
}) Created on 2020-07-08 by the reprex package (v0.3.0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's possible to get some simplification using
s2_options(snap_radius = <radians>)
, but it doesn't truly simplify in the same way thatsf::st_simplify()
does. Also, BigQuery ST_SIMPLIFY() is a thing, so it must be possible somewhere.Created on 2020-06-21 by the reprex package (v0.3.0)
Points can probably be simplified by snap + union, there is a dedicated class for simplifying polylines, but I haven't seen a polygon simplifier yet.
The text was updated successfully, but these errors were encountered: