protomaps / basemaps

Basemap PMTiles generation and cartographic styles for OpenStreetMap data and more
https://maps.protomaps.com/
Other
347 stars 44 forks source link

fix #200 generalize boundaries line features #223

Closed nvkelso closed 6 months ago

nvkelso commented 6 months ago

Fixes #200.

OSM boundaries were quite detailed at mid- and high-zooms, and NE boundaries were a bit too detailed at low zooms.

Solution is to variably adjust the pixel tolerance from 0.1 to 0.4 to reduce file size and visual complexity, while preserving some details on fractional zoom in.

After:

Screenshot 2024-03-25 at 1 33 51 PM

Before:

Screenshot 2024-03-25 at 1 29 18 PM
sonarcloud[bot] commented 6 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

nvkelso commented 6 months ago

For good measure, tile size drops 20-40% across the board.

                z0  z1  z2  z3  z4  z5  z6  z7  z8  z9  z10  z11  z12  z13  z14  z15  all
NEW  boundaries 196  247  362  583  894 1.4k 3.3k  2k 4.8k 3.2k 8.2k 3.6k  2k  1k  738  590 8.2k
OLD   boundaries 241  351  566  892 1.3k 1.9k 8.7k 5.1k  12k 7.6k  14k 6.8k 3.3k 1.4k  884  850  14k