-
Notifications
You must be signed in to change notification settings - Fork 0
Lesson 3B: Improve performance, reduce payload
High Definition (HD) data is not alway necessary. Performance counts for developers. So: simplify your data, reduce the payload and improve performance.
Performance counts for developers. Why? Because performance counts for impatient users.
The only way a spatial data platform will work is if it performs well. What this performance should be, relates to the nature of the data set. Not every dataset needs to have an uptime of 100% and query speeds below 10ms. However, the authority of the dataset and the publisher of the spatial data, should be aware that developers will not use their data, if they cannot offer a reliable service.
Spatial datasets are often highly accurate, highly detailed and are quite large in number of objects and megabytes. Suppose you have such a nice and superb HD data set, and have intentions to publish gigabytes of data on the web. If you do nothing about reduction or simplification, your dataset will be useless for quick-responsive apps and services.
Good performance, fast data loading due to server-side data reduction and simplification.
Use these tips & tricks to reduce data:
- Compression: use HTTP compression techniques to improve transfer speed and bandwidth utilization.
- Simplification: simplify geometric shapes and lower coordinate precision to reduce response size.
- Filtering: let users include filters in their requests based on space, theme, and time.
- Clustering: use server-side clustering, that is geohashing.
Phase 2 of the testbed concluded that another way of reducing the payload can be publishing centroids instead of the full polygon, so-called feature collapse. This is basically a geospatial transformation from polygons to points.
It depends on the purpose, zoom levels and so forth which compression, simplification or reduction is the best.
Example simplification for CBS Gemeente Amersfoort: https://geo4web.apiwise.nl/gemeente/GM0307.
Original geometry of the GeoJSON feature (134Kb):

Using QGIS we apply a simplification factor of 1.0 and reduce the coordinate precision to 6 (default: 15).
The compressed geometry of the GeoJSON feature (16Kb):

So we have reduced the file size of the GeoJSON feature to 12% of its original size.
Now we zoom in...

On a 1:500-scale we see the difference...
