Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify landcover layer generalisation SQL (#1255)
I was reading through the SQL used to generalise the landcover layer ([`layers/landcover/generalized.sql`](https://github.com/openmaptiles/openmaptiles/blob/596f44aa26bf3711cd5775d111105e09a34916a0/layers/landcover/generalized.sql)) and I noticed that when creating the generalised landcover tables for zooms 9-13, the SQL was doing something like this: ```sql SELECT * FROM simplify_vw_z13 WHERE ST_NPoints(geometry) < 50 UNION ALL SELECT * FROM simplify_vw_z13 WHERE ST_NPoints(geometry) >= 50 AND ST_NPoints(geometry) < 300 ``` As in, the simplification/clustering of landcover generalisations was being done in two steps: once for polygons with fewer than fifty points, and once for polygons with 50+ points. As far as I can see, there's no benefit to doing this — it's probably just an artefact of the dev work done for the [original pull request](#1035). Of course, I might be completely missing the reason for clustering polygons into two groups (<50 points and 50+ points). But assuming I haven't, I've created this pull request to simplify the SQL used in the generalisation, merging the two steps into something like this: ```sql SELECT * FROM simplify_vw_z13 WHERE ST_NPoints(geometry) < 300 ``` The effect is to slightly reduce the number of landcover features (polygons with <50 points can now be clustered/unioned with those 50+), and to reduce the time taken to generalise the landcover tables (in a small test using OSM's Iceland data I saw a 7% reduction in the time spent). It doesn't alter the features that are shown on the map. Builds upon work from commits 4a1b0af and da689f9.
- Loading branch information