💡 [REQUEST] - Minify geojson files #97
Labels
dev 🦍
Development Team
enhancement 🪄
New feature or request
good first issue 🤝
Good for newcomers
high priority 🫡
High Priority
perf 🏃
Issues or enhancements related to the performance
Start Date
8/21/23
Implementation PR
No response
Reference Issues
No response
Summary
Several of the geojson files we use are needlessly detailed and slowing down performance. There are two basic ways to reduce a spatial file:
In the examples section I list several geojson files that could benefit from one or both of these treatments. For dissolve, you can use built-in geopandas (Python, see link above). For simplifying lines, I recommend Visvalingam’s algorithm, which is not implemented in geopandas, but is in this handy online interface: https://mapshaper.org/
Basic Example
I think it's possible to reduce files <= 4 MB down to 250 KB or less, and the hydro file to < 1 MB with minimal loss of visual detail.
Drawbacks
We may lose a bit of visual detail, but in theory the loading time and lagginess would be cut by 40%--well worth the tradeoff.
Unresolved questions
We are trying to preserve final.geojson at maximum detail, but it is the biggest file (23 MB). If performance problems persist, we may need to reduce that as well.
The text was updated successfully, but these errors were encountered: