Skip to content
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

Slim down geojson #27

Closed
5 of 7 tasks
abettermap opened this issue Nov 17, 2017 · 2 comments
Closed
5 of 7 tasks

Slim down geojson #27

abettermap opened this issue Nov 17, 2017 · 2 comments

Comments

@abettermap
Copy link

abettermap commented Nov 17, 2017

It's kinda meaty, ~2ish MB now. Make it smaller via:

  • Remove unneeded fields (e.g. SHAPE_LEN, etc.)
  • Simplify/reduce vertices
  • Reduce coordinate precision (e.g. 40.374187379751248 to 40.37419)
  • Minify and commit

Other:

  • Test it: zoom in really far, see if vertices look suffish
  • Screenshot the old-vs-new savings (just cuz)
  • Document procedures (use ogr2ogr if no Node-based modules available)

Wishlist: topojson!

@abettermap
Copy link
Author

Savings

Almost 90%:
image

Still precise enough?

If not, I can slim it down more, but this project deals with large precinct-level data so probably fine as-is. Still looks deese around 1:27000 scale:

image

...albeit a bit rougher at 1:6900:

image

TopoJSON savings

Just for shits and giggles (mostly giggles), topojson cuts the slimmed GeoJSON by another 50%:

image

We would need to adapt the MapBox code to handle it, but it's plenty doable.

@deidyomega
Copy link
Contributor

Considering the size reduction. I think it's close enough. This isn't for land surveying, this is for getting a general idea.

Great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants