Skip to content

Commit

Permalink
water: render waterway=fish_pass
Browse files Browse the repository at this point in the history
  • Loading branch information
TheJJ committed Feb 8, 2023
1 parent 6591d7b commit 5189857
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 24 deletions.
2 changes: 1 addition & 1 deletion indexes.sql
Expand Up @@ -3,7 +3,7 @@
CREATE INDEX planet_osm_line_ferry ON planet_osm_line USING GIST (way) WHERE route = 'ferry' AND osm_id > 0;
CREATE INDEX planet_osm_line_label ON planet_osm_line USING GIST (way) WHERE name IS NOT NULL OR ref IS NOT NULL;
CREATE INDEX planet_osm_line_river ON planet_osm_line USING GIST (way) WHERE waterway = 'river';
CREATE INDEX planet_osm_line_waterway ON planet_osm_line USING GIST (way) WHERE waterway IN ('river', 'canal', 'stream', 'drain', 'ditch');
CREATE INDEX planet_osm_line_waterway ON planet_osm_line USING GIST (way) WHERE waterway IN ('river', 'canal', 'stream', 'drain', 'ditch', 'fish_pass');
CREATE INDEX planet_osm_point_place ON planet_osm_point USING GIST (way) WHERE place IS NOT NULL AND name IS NOT NULL;
CREATE INDEX planet_osm_polygon_admin ON planet_osm_polygon USING GIST (ST_PointOnSurface(way)) WHERE name IS NOT NULL AND boundary = 'administrative' AND admin_level IN ('0', '1', '2', '3', '4');
CREATE INDEX planet_osm_polygon_military ON planet_osm_polygon USING GIST (way) WHERE (landuse = 'military' OR military = 'danger_area') AND building IS NULL;
Expand Down
2 changes: 1 addition & 1 deletion indexes.yml
Expand Up @@ -14,7 +14,7 @@ line:
river:
where: waterway = 'river'
waterway:
where: waterway IN ('river', 'canal', 'stream', 'drain', 'ditch')
where: waterway IN ('river', 'canal', 'stream', 'drain', 'ditch', 'fish_pass')
polygon:
# The polygon table is by far the largest, and generally the slowest
name:
Expand Down
2 changes: 1 addition & 1 deletion openstreetmap-carto.lua
Expand Up @@ -47,7 +47,7 @@ local linestring_values = {
natural = {cliff = true, earth_bank = true, tree_row = true, ridge = true, arete = true},
power = {cable = true, line = true, minor_line = true},
tourism = {yes = true},
waterway = {canal = true, derelict_canal = true, ditch = true, drain = true, river = true, stream = true, tidal_channel = true, wadi = true, weir = true}
waterway = {canal = true, derelict_canal = true, ditch = true, drain = true, river = true, stream = true, fish_pass = true, tidal_channel = true, wadi = true, weir = true}
}

-- Objects with any of the following key/value combinations will be treated as polygon
Expand Down
8 changes: 4 additions & 4 deletions project.mml
Expand Up @@ -204,7 +204,7 @@ Layer:
THEN 'yes' ELSE 'no' END AS int_tunnel,
'no' AS bridge
FROM planet_osm_line
WHERE waterway IN ('river', 'canal', 'stream', 'drain', 'ditch')
WHERE waterway IN ('river', 'canal', 'stream', 'drain', 'ditch', 'fish_pass')
AND (bridge IS NULL OR bridge NOT IN ('yes', 'aqueduct'))
ORDER BY COALESCE(layer,0)
) AS water_lines
Expand Down Expand Up @@ -571,7 +571,7 @@ Layer:
WHERE barrier IN ('chain', 'city_wall', 'ditch', 'fence', 'guard_rail',
'handrail', 'hedge', 'retaining_wall', 'wall')
OR historic = 'citywalls'
AND (waterway IS NULL OR waterway NOT IN ('river', 'canal', 'stream', 'drain', 'ditch'))
AND (waterway IS NULL OR waterway NOT IN ('river', 'canal', 'stream', 'drain', 'ditch', 'fish_pass'))
) AS features
) AS line_barriers
properties:
Expand Down Expand Up @@ -899,7 +899,7 @@ Layer:
THEN 'yes' ELSE 'no' END AS int_tunnel,
'yes' AS bridge
FROM planet_osm_line
WHERE waterway IN ('river', 'canal', 'stream', 'drain', 'ditch')
WHERE waterway IN ('river', 'canal', 'stream', 'drain', 'ditch', 'fish_pass')
AND bridge IN ('yes', 'aqueduct')
ORDER BY COALESCE(layer,0)
) AS waterway_bridges
Expand Down Expand Up @@ -2175,7 +2175,7 @@ Layer:
OR waterway = 'canal' AND tunnel = 'flooded'
THEN 'yes' ELSE 'no' END AS int_tunnel
FROM planet_osm_line
WHERE (waterway IN ('river', 'canal', 'stream', 'drain', 'ditch')
WHERE (waterway IN ('river', 'canal', 'stream', 'drain', 'ditch', 'fish_pass')
OR "natural" IN ('bay', 'strait'))
AND (tunnel IS NULL OR tunnel != 'culvert')
AND name IS NOT NULL
Expand Down
28 changes: 11 additions & 17 deletions style/water.mss
Expand Up @@ -52,6 +52,7 @@

#water-lines::casing {
[waterway = 'stream'],
[waterway = 'fish_pass'],
[waterway = 'ditch'],
[waterway = 'drain'] {
[int_tunnel = 'no'] {
Expand Down Expand Up @@ -144,6 +145,7 @@
}

[waterway = 'stream'],
[waterway = 'fish_pass'],
[waterway = 'ditch'],
[waterway = 'drain'] {
[int_intermittent != 'yes'][zoom >= 14],
Expand Down Expand Up @@ -174,23 +176,27 @@
water/line-clip: false;
}

[waterway = 'stream'][zoom >= 15] {
[waterway = 'stream'][zoom >= 15],
[waterway = 'fish_pass'][zoom >= 15] {
water/line-width: 3;

[int_tunnel = 'yes'] {
background/line-width: 3;
}
}

[int_tunnel = 'yes'][zoom >= 15] {
background/line-width: 3.5;
water/line-width: 3.5;
[waterway = 'stream'] {
[waterway = 'stream'],
[waterway = 'fish_pass'] {
background/line-width: 4.5;
water/line-width: 4.5;
}
water/line-dasharray: 4,2;
tunnelfill/line-width: 1;
[waterway = 'stream'] { tunnelfill/line-width: 2; }
[waterway = 'fish_pass'] { tunnelfill/line-width: 2; }
tunnelfill/line-color: #f3f7f7;
}
}
Expand Down Expand Up @@ -235,22 +241,10 @@
text-repeat-distance: @waterway-text-repeat-distance;
}

[waterway = 'stream'][zoom >= 15] {
text-name: "[name]";
text-size: 10;
text-face-name: @oblique-fonts;
text-fill: @water-text;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-spacing: 600;
text-placement: line;
text-vertical-alignment: middle;
text-dy: 8;
text-repeat-distance: @waterway-text-repeat-distance;
}

[waterway = 'drain'],
[waterway = 'ditch'] {
[waterway = 'ditch'],
[waterway = 'stream'],
[waterway = 'fish_pass'] {
[zoom >= 15] {
text-name: "[name]";
text-size: 10;
Expand Down

0 comments on commit 5189857

Please sign in to comment.