Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Filter out small areas and use polygon-gamma for large ones
This should fill in gaps between water bodies, prevent colouring bugs
and not over-represent water at low zooms
  • Loading branch information
pnorman committed Aug 14, 2014
1 parent ad99638 commit d8afe6f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion project.mml
Expand Up @@ -213,7 +213,7 @@
],
"Datasource": {
"type": "postgis",
"table": "(SELECT\n way, \"natural\", waterway, landuse, name\n FROM planet_osm_polygon\n WHERE\n (waterway IN ('dock', 'riverbank', 'canal')\n OR landuse IN ('reservoir','basin')\n OR \"natural\" IN ('lake','water','land','glacier','mud'))\n AND building IS NULL\n ORDER BY z_order, way_area) AS water_areas",
"table": "(SELECT\n way, \"natural\", waterway, landuse, name, way_area/(!pixel_width!*!pixel_height!) AS way_pixels\n FROM planet_osm_polygon\n WHERE\n (waterway IN ('dock', 'riverbank', 'canal')\n OR landuse IN ('reservoir','basin')\n OR \"natural\" IN ('lake','water','land','glacier','mud'))\n AND building IS NULL\n AND way_area/(!pixel_width!*!pixel_height!) > 0.01\n ORDER BY z_order, way_area) AS water_areas",
"extent": "-20037508,-20037508,20037508,20037508",
"key_field": "",
"geometry_field": "way",
Expand Down
9 changes: 9 additions & 0 deletions water.mss
Expand Up @@ -17,11 +17,17 @@
[waterway = 'canal'] {
[zoom >= 9]::waterway {
polygon-fill: @water-color;
[way_pixels >= 4] {
polygon-gamma: 0.75;
}
}
}

[landuse = 'basin'][zoom >= 7]::landuse {
polygon-fill: @water-color;
[way_pixels >= 4] {
polygon-gamma: 0.75;
}
}

[natural = 'lake']::natural,
Expand All @@ -30,6 +36,9 @@
[waterway = 'riverbank']::waterway {
[zoom >= 6] {
polygon-fill: @water-color;
[way_pixels >= 4] {
polygon-gamma: 0.75;
}
}
}

Expand Down

0 comments on commit d8afe6f

Please sign in to comment.