Skip to content

Commit

Permalink
Merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
wipfli committed Mar 5, 2025
2 parents defadd6 + 2eb7c51 commit 21f3edf
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Tiles 4.6.0
------
- Symbolize kind=dam in landuse layer instead of waterway layer [#404]
- Fix kind=grassland [#405]

Tiles 4.5.0
------
- Refactor of landuse to use Matchers [#399]
Expand Down
2 changes: 1 addition & 1 deletion styles/src/base_layers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ export function nolabels_layers(
type: "fill",
source: source,
"source-layer": "landuse",
filter: ["==", "kind", "pedestrian"],
filter: ["in", "kind", "pedestrian", "dam"],
paint: {
"fill-color": t.pedestrian,
},
Expand Down
2 changes: 1 addition & 1 deletion tiles/src/main/java/com/protomaps/basemap/Basemap.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public String description() {

@Override
public String version() {
return "4.5.0";
return "4.6.0";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public class Landuse implements ForwardingProfile.LayerPostProcessor {
beach
wood
glacier
grass
grassland
scrub
sand
wetland
Expand All @@ -145,6 +145,10 @@ public class Landuse implements ForwardingProfile.LayerPostProcessor {
with("area", "yes"),
use("kind", "pedestrian")
),
rule(
with("waterway", "dam"),
use("kind", "dam")
),
rule(
with("railway", "platform"),
use("kind", "platform")
Expand Down
5 changes: 3 additions & 2 deletions tiles/src/main/java/com/protomaps/basemap/layers/Water.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.protomaps.basemap.names.OsmNames;
import java.util.List;

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

private static final double WORLD_AREA_FOR_70K_SQUARE_METERS =
Expand Down Expand Up @@ -109,7 +110,7 @@ public void processNe(SourceFeature sf, FeatureCollector features) {
public void processOsm(SourceFeature sf, FeatureCollector features) {
// polygons
if (sf.canBePolygon() && (sf.hasTag("water") ||
sf.hasTag("waterway") ||
(sf.hasTag("waterway") && !sf.hasTag("waterway", "dam")) ||
sf.hasTag("natural", "water") ||
sf.hasTag("landuse", "reservoir") ||
sf.hasTag("leisure", "swimming_pool"))) {
Expand Down Expand Up @@ -191,7 +192,7 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {

// lines
if (sf.canBeLine() && !sf.canBePolygon() && sf.hasTag("waterway") &&
(!sf.hasTag("waterway", "riverbank", "reservoir"))) {
(!sf.hasTag("waterway", "riverbank", "reservoir", "dam"))) {
int minZoom = 12;
String kind = "other";
if (sf.hasTag("waterway")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,13 @@ void testFromTagNatural() {
);

assertFeatures(15,
List.of(Map.of("kind", "grass")),
processWith("natural", "grass")
List.of(Map.of("kind", "grassland")),
processWith("natural", "grassland")
);

assertFeatures(15,
List.of(Map.of("kind", "dam")),
processWith("waterway", "dam")
);

assertFeatures(15,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ void testHighwayOther() {
"motorway, highway, motorway, 3, 7",
"motorway_link, highway, motorway_link, 3, 7",
"trunk, major_road, trunk, 6, 7",
"trunk_link, major_road, trunk_link, 7, 7",
"trunk_link, major_road, trunk_link, 6, 7",
"primary, major_road, primary, 7, 7",
"primary_link, major_road, primary_link, 7, 7",
"secondary, major_road, secondary, 9, 9",
Expand Down
15 changes: 15 additions & 0 deletions tiles/src/test/java/com/protomaps/basemap/layers/WaterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,21 @@ void kindRiver() {
)));
}

@Test
void kindDam() {
assertFeatures(15,
List.of(),
process(SimpleFeature.create(
newLineString(0, 0, 1, 1),
new HashMap<>(Map.of(
"waterway", "dam"
)),
"osm",
null,
0
)));
}

@Test
void oceanLabel() {
assertFeatures(12,
Expand Down

0 comments on commit 21f3edf

Please sign in to comment.