-
Notifications
You must be signed in to change notification settings - Fork 12
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
Implement more mapshaper commands #12
Comments
@ateucher, you're doing very fine work. Unfortunately, my domain ignorance is preventing me from helping much, but I am following along. Let me know if I can do anything. |
Thanks @timelyportfolio! I'm really close to having something that people can kick the tires of. I'm trying to get all the methods implemented and tested for the five core functions checked above ( Any time you want to try to incorporate your widget is fine by me - but no rush :) |
Could you also add the convert feature. It might come in handy for converting to/from various formats w/o needing rgdal. |
Hi @bhaskarvk, thanks for the note. By convert, do mean the As for the topojson read issue, could you open up an issue in https:/github.com/ropensci/geojsonio? |
Hello, |
Hi @ifoxfoot - just to be clear, are you referring to implementing the mosaic command available in the mapshaper javascript library? Or a mosaic in the ArcGIS sense? If the former, then happy to add it to the roadmap, but if the latter it would be out of scope as mapshaper (and hence rmapshaper) doesn't deal with raster data. |
@ateucher the one in the mapshaper library. I want to flatten some polygons together. Thanks for responding! |
You should be able to achieve what you're after with library(rmapshaper)
library(sf)
#> Linking to GEOS 3.10.2, GDAL 3.4.2, PROJ 8.2.1; sf_use_s2() is TRUE
m = rbind(c(0,0), c(1,0), c(1,1), c(0,1), c(0,0))
p = st_polygon(list(m))
n = 10
l = vector("list", n)
for (i in 1:n)
l[[i]] = p + 3 * runif(2)
s = st_sfc(l)
plot(s, col = sf.colors(categorical = TRUE, alpha = .5)) i = st_intersection(s)
plot(i, col = sf.colors(categorical = TRUE))
title("non-overlapping intersections") s_geojson <- rmapshaper:::sf_to_GeoJSON(s)
j <- apply_mapshaper_commands(s_geojson, "-mosaic") |>
rmapshaper:::GeoJSON_to_sf()
plot(st_as_sfc(j), col = sf.colors(categorical = TRUE)) Created on 2022-10-27 with reprex v2.0.2 |
https://github.com/mbloch/mapshaper/wiki/Command-Reference
The text was updated successfully, but these errors were encountered: