Skip to content

Commit 2f8b7d5

Browse files
committed
* Add kind=dam to landuse, remove from water [#404]
* fix natural=grassland in landuse [#405]
1 parent e738c6f commit 2f8b7d5

File tree

5 files changed

+30
-6
lines changed

5 files changed

+30
-6
lines changed

styles/src/base_layers.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ export function nolabels_layers(
299299
type: "fill",
300300
source: source,
301301
"source-layer": "landuse",
302-
filter: ["==", "kind", "pedestrian"],
302+
filter: ["in", "kind", "pedestrian", "dam"],
303303
paint: {
304304
"fill-color": t.pedestrian,
305305
},

tiles/src/main/java/com/protomaps/basemap/layers/Landuse.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public class Landuse implements ForwardingProfile.LayerPostProcessor {
128128
beach
129129
wood
130130
glacier
131-
grass
131+
grassland
132132
scrub
133133
sand
134134
wetland
@@ -145,6 +145,10 @@ public class Landuse implements ForwardingProfile.LayerPostProcessor {
145145
with("area", "yes"),
146146
use("kind", "pedestrian")
147147
),
148+
rule(
149+
with("waterway", "dam"),
150+
use("kind", "dam")
151+
),
148152
rule(
149153
with("railway", "platform"),
150154
use("kind", "platform")

tiles/src/main/java/com/protomaps/basemap/layers/Water.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public void processNe(SourceFeature sf, FeatureCollector features) {
109109
public void processOsm(SourceFeature sf, FeatureCollector features) {
110110
// polygons
111111
if (sf.canBePolygon() && (sf.hasTag("water") ||
112-
sf.hasTag("waterway") ||
112+
(sf.hasTag("waterway") && !sf.hasTag("waterway", "dam")) ||
113113
sf.hasTag("natural", "water") ||
114114
sf.hasTag("landuse", "reservoir") ||
115115
sf.hasTag("leisure", "swimming_pool"))) {
@@ -191,7 +191,7 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
191191

192192
// lines
193193
if (sf.canBeLine() && !sf.canBePolygon() && sf.hasTag("waterway") &&
194-
(!sf.hasTag("waterway", "riverbank", "reservoir"))) {
194+
(!sf.hasTag("waterway", "riverbank", "reservoir", "dam"))) {
195195
int minZoom = 12;
196196
String kind = "other";
197197
if (sf.hasTag("waterway")) {

tiles/src/test/java/com/protomaps/basemap/layers/LanduseTest.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,13 @@ void testFromTagNatural() {
214214
);
215215

216216
assertFeatures(15,
217-
List.of(Map.of("kind", "grass")),
218-
processWith("natural", "grass")
217+
List.of(Map.of("kind", "grassland")),
218+
processWith("natural", "grassland")
219+
);
220+
221+
assertFeatures(15,
222+
List.of(Map.of("kind", "dam")),
223+
processWith("waterway", "dam")
219224
);
220225

221226
assertFeatures(15,

tiles/src/test/java/com/protomaps/basemap/layers/WaterTest.java

+15
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,21 @@ void kindRiver() {
6363
)));
6464
}
6565

66+
@Test
67+
void kindDam() {
68+
assertFeatures(15,
69+
List.of(),
70+
process(SimpleFeature.create(
71+
newLineString(0, 0, 1, 1),
72+
new HashMap<>(Map.of(
73+
"waterway", "dam"
74+
)),
75+
"osm",
76+
null,
77+
0
78+
)));
79+
}
80+
6681
@Test
6782
void oceanLabel() {
6883
assertFeatures(12,

0 commit comments

Comments
 (0)