-
Notifications
You must be signed in to change notification settings - Fork 9
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
Provide different resolutions (feature request) #17
Comments
@z3tt In the new version of the package we hope to push soon, we have a "Simplified" toggle, which lets the user choose between the simplified and unsimplified files for each case. Is that what you're after? (Also - I'm looking for testers of the updated package, so let me know if you're interested - [email protected] :) ). |
Sounds as it's similar --- just trying to keep the computation time low and the borders clean when plotting e.g. the whole world. |
Hi @z3tt @DanRunfola , Thank you for your feedback! I'm glad to hear that you're interested in the updated version of the package. Indeed, in the new version, we have included both simplified and unsimplified variants for each case. This toggle allows users to choose the level of detail they prefer, balancing computation time and the clarity of borders when plotting large geographical areas. Simplified one takes less time. Below, you can see a comparison of the geometry between the simplified and unsimplified cases: I hope this addresses your concerns and meets your needs. Cheers, |
Hi @rohith4444, I was just using the simplified version for the global admin-0 level and realized it is still way too detailed. Looking at the object sizes of the simplified and unsimplified geodata both are actually identical. library(ggplot2)
library(rgeoboundaries)
library(rmapshaper)
## using rgeoboundaries type options
world_detail <- rgeoboundaries::gb_adm0(type = "unsimplified")
world_simple <- rgeoboundaries::gb_adm0(type = "simplified")
object.size(world_detail)
#> 163002152 bytes
object.size(world_simple) ## same!
#> 163002152 bytes
ggplot(world_simple) + geom_sf() + theme_void() ## same for world_detail I think with respect to file size, computing time, and "readability", a version with a level of detail like this would be useful: ## simplify borders with ms_simplify
world_simplified <- ms_simplify(world_detail, keep = .01, keep_shapes = TRUE)
object.size(world_simplified)
#> 1963160 bytes
ggplot(world_simplified) + geom_sf() + theme_void() Or maybe even more simplified: world_simplified <- ms_simplify(world_detail, keep = .004, keep_shapes = TRUE)
object.size(world_simplified)
#> 815272 bytes
ggplot(world_simplified) + geom_sf() + theme_void() First and foremost, the two versions are the same on a global scale. |
Hi @dickoa et al, thanks for the package!
I think it would be great if other data variants with different resolutions / levels of detail would be available as well (called
scale
in the rnaturalearth package). I am aware that one can do it afterwards but would be nice to "just" have it available without any further processing.Cheers,
Cédric
The text was updated successfully, but these errors were encountered: