From ed79f7c4867e0e669b0d754d7d2b3014e5c0121e Mon Sep 17 00:00:00 2001 From: scarapella Date: Mon, 13 Oct 2025 19:17:08 -0400 Subject: [PATCH 1/2] In my experience, rapids usually occur on waterways that run downhill and/or have tidal effects. --- js/styleGenerator.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/js/styleGenerator.js b/js/styleGenerator.js index d440ea1..45a6a9c 100644 --- a/js/styleGenerator.js +++ b/js/styleGenerator.js @@ -1089,6 +1089,21 @@ export function generateStyle(baseStyleJsonString, travelMode, lens) { case 'open_water': // only expect open_water tag on certain features return ["!", ["in", ["get", "waterway"], ["literal", ["fairway", "flowline"]]]]; + case "rapids" : + // only expect rapids tag on + return ["all", + // features that could have current + ["!",["in", ["get", "waterway"], ["literal", [ + "river", + "stream", + "canal", + "drain", + "ditch", + "canoe_pass" + ]]]], + // or tidal features + ["!=", ["get", "tidal"], "yes"] + ]; case 'width': // don't expect width tag on links return ["==", ["get", "waterway"], "link"]; From f0d658442186f00f2989a5e3e1ec43633061275b Mon Sep 17 00:00:00 2001 From: scarapella Date: Sun, 19 Oct 2025 18:15:51 -0400 Subject: [PATCH 2/2] narrowing the assumed rapids=no to only non-tidal flowlines --- js/styleGenerator.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/js/styleGenerator.js b/js/styleGenerator.js index 45a6a9c..9616bed 100644 --- a/js/styleGenerator.js +++ b/js/styleGenerator.js @@ -1090,19 +1090,10 @@ export function generateStyle(baseStyleJsonString, travelMode, lens) { // only expect open_water tag on certain features return ["!", ["in", ["get", "waterway"], ["literal", ["fairway", "flowline"]]]]; case "rapids" : - // only expect rapids tag on + // we assume non-tidal flowlines do not have rapids return ["all", - // features that could have current - ["!",["in", ["get", "waterway"], ["literal", [ - "river", - "stream", - "canal", - "drain", - "ditch", - "canoe_pass" - ]]]], - // or tidal features - ["!=", ["get", "tidal"], "yes"] + ["==", ["get", "waterway"], "flowline"], + ["==", ["get", "tidal"], "no"] ]; case 'width': // don't expect width tag on links