simplify mml by using !pixel_width! and !pixel_height!
- Dominant language
- CartoCSS
- Stars
- 703
- Forks
- 222
- PR merge metrics
- No merged PRs in 30d
Description
Instead of setting "by hand" thresholds for way_area in
https://github.com/mapbox/osm-bright/blob/master/osm-bright/osm-bright.osm2pgsql.mml#L71
https://github.com/mapbox/osm-bright/blob/master/osm-bright/osm-bright.osm2pgsql.mml#L51
you can declare only one layer with `way_area > 10000` replaced by
`way_area >= !pixel_width! * !pixel_height! * 4`.
This will only select polygons that are approximately bigger than two pixels square (2*2 = 4). Result is good enough...
Contributor guide
Research direction
Open osm-bright/osm-bright.osm2pgsql.mml at the referenced lines 51 and 71 and compare the two way_area layer thresholds. Consolidate the duplicated selection using the pixel-size expression described in the issue, then inspect the generated configuration or map output to confirm that the resulting polygon selection is acceptable.
Written by the indexing model from the issue text.
Assessment
- Domain
- design
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100