Skip to content

Commit 21f3edf

Browse files
committed
Merge main
2 parents defadd6 + 2eb7c51 commit 21f3edf

File tree

8 files changed

+38
-8
lines changed

8 files changed

+38
-8
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Tiles 4.6.0
2+
------
3+
- Symbolize kind=dam in landuse layer instead of waterway layer [#404]
4+
- Fix kind=grassland [#405]
5+
16
Tiles 4.5.0
27
------
38
- Refactor of landuse to use Matchers [#399]

styles/src/base_layers.ts

Lines changed: 1 addition & 1 deletion
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/Basemap.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public String description() {
115115

116116
@Override
117117
public String version() {
118-
return "4.5.0";
118+
return "4.6.0";
119119
}
120120

121121
@Override

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

Lines changed: 5 additions & 1 deletion
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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import com.protomaps.basemap.names.OsmNames;
1414
import java.util.List;
1515

16+
@SuppressWarnings("java:S1192") // Duplicated string literals
1617
public class Water implements ForwardingProfile.LayerPostProcessor {
1718

1819
private static final double WORLD_AREA_FOR_70K_SQUARE_METERS =
@@ -109,7 +110,7 @@ public void processNe(SourceFeature sf, FeatureCollector features) {
109110
public void processOsm(SourceFeature sf, FeatureCollector features) {
110111
// polygons
111112
if (sf.canBePolygon() && (sf.hasTag("water") ||
112-
sf.hasTag("waterway") ||
113+
(sf.hasTag("waterway") && !sf.hasTag("waterway", "dam")) ||
113114
sf.hasTag("natural", "water") ||
114115
sf.hasTag("landuse", "reservoir") ||
115116
sf.hasTag("leisure", "swimming_pool"))) {
@@ -191,7 +192,7 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
191192

192193
// lines
193194
if (sf.canBeLine() && !sf.canBePolygon() && sf.hasTag("waterway") &&
194-
(!sf.hasTag("waterway", "riverbank", "reservoir"))) {
195+
(!sf.hasTag("waterway", "riverbank", "reservoir", "dam"))) {
195196
int minZoom = 12;
196197
String kind = "other";
197198
if (sf.hasTag("waterway")) {

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

Lines changed: 7 additions & 2 deletions
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/RoadsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ void testHighwayOther() {
166166
"motorway, highway, motorway, 3, 7",
167167
"motorway_link, highway, motorway_link, 3, 7",
168168
"trunk, major_road, trunk, 6, 7",
169-
"trunk_link, major_road, trunk_link, 7, 7",
169+
"trunk_link, major_road, trunk_link, 6, 7",
170170
"primary, major_road, primary, 7, 7",
171171
"primary_link, major_road, primary_link, 7, 7",
172172
"secondary, major_road, secondary, 9, 9",

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

Lines changed: 15 additions & 0 deletions
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)