-
Notifications
You must be signed in to change notification settings - Fork 524
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
Add a target-size option to -simplify #365
Comments
To prevent simplification from introducing gaps between files, you will have to import the files together, so mapshaper can identify shared boundaries. You may need to use the Import the files using the
To apply a consistent amount of simplification across multiple files, you can use the I don't support adding a Cheers, |
I see... the suggestion I gave you would only work if the shapes fit together perfectly to begin with. It looks like the boundaries of the source polygons might not match exactly. An alternative method is to merge all the unsimplified shapes into a single layer, remove any gaps or overlaps using the edited to add The -clean command has a |
This issue has been responded-to... closing. |
Thank you very, very mutch, to point me to the right direction. Mapshapers billions of command line options are in the end pretty cool, but for first-time-users it is confusing. I changed the command to:
But i get the following error:
To fix that is was forcing mapshaper to add missing fields:
But still get an error:
All input files are valid GeoJSON files, but the structure is different: Properties of each Polygon / MultiPolygon are not important to me, i only need the shapes for my application. But for debugging (team of developers) it would be interesting to keep the properties. There is no need to merge the values in my case. Keep the original properties for each splitted output would be fine. Dropping them from output would be ok. Sad thing is, that
failing. Is there an option to extract the first Polygon / MultiPolygon from each input file? By the way i really love the "precision" option! |
It looks like For compatibility with Shapefiles and other reasons, mapshaper applies some restrictions that are not present in the GeoJSON spec. You can resolve the error by deleting the id field ( |
@mbloch Is there a build-in way to keep the original filenames after split? Or do i have to prepare the input files by adding a |
If you work with GeoJSON from OpenStreetmap Admin Boundaries you may not need the high precision provided. To get faster download, less JavaScript parse-time and less render-time you may want to reduce the details in such a shape file.
A
target-file-size
(e.g.target-size=6KB
) option to-simplify
in a batch process (build process; command line tool) would be better than trying to find a value forpercentage
(e.g.percentage=10%
) combined with some try-and-error to bring data down to desired file size.Please implement a
target-file-size
option. The result does not have to be exactly 6KB (6144 bytes) - it would be ok, to bring file size below this threshold - so 5840 bytes and similar would be perfect.Related question:
What command line options do you suggest when someone wants to process e.g. >70 shapes which "touch" each other and if you want to apply the same "simplification" to adjacent shapes - so the result is not getting gaps nor overlapping. (and also remove existing overlapping and existing gaps)? Is there a
-sync-shapes
feature and a multiple-files feature?Example for illustration:
The text was updated successfully, but these errors were encountered: