Skip to content

Commit

Permalink
adds landuse=village_green and landuse=allotments (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
lenalebt authored Jan 14, 2024
1 parent 3a1697d commit f992584
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public void processFeature(SourceFeature sf, FeatureCollector features) {
sf.hasTag("amenity", "hospital", "school", "kindergarten", "university", "college") ||
sf.hasTag("boundary", "national_park", "protected_area") ||
sf.hasTag("landuse", "recreation_ground", "industrial", "brownfield", "railway", "cemetery", "commercial",
"grass", "orchard", "farmland", "farmyard", "residential", "military") ||
"grass", "orchard", "farmland", "farmyard", "residential", "military", "village_green", "allotments") ||
sf.hasTag("leisure", "park", "garden", "golf_course", "dog_park", "playground", "pitch", "nature_reserve") ||
sf.hasTag("man_made", "pier", "bridge") ||
sf.hasTag("natural", "beach") ||
Expand All @@ -45,6 +45,10 @@ public void processFeature(SourceFeature sf, FeatureCollector features) {
kind = "farmland";
} else if (sf.hasTag("landuse", "residential")) {
kind = "residential";
} else if (sf.hasTag("landuse", "village_green")) {
kind = "village_green";
} else if (sf.hasTag("landuse", "allotments")) {
kind = "allotments";
} else if (sf.hasTag("landuse", "industrial", "brownfield")) {
kind = "industrial";
} else if (sf.hasTag("landuse", "military")) {
Expand Down
26 changes: 26 additions & 0 deletions tiles/src/test/java/com/protomaps/basemap/layers/LanduseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,30 @@ void simple() {
0
)));
}

@Test
void landuseVillageGreen() {
assertFeatures(15,
List.of(Map.of("pmap:kind", "village_green")),
process(SimpleFeature.create(
newPolygon(0, 0, 0, 1, 1, 1, 0, 0),
new HashMap<>(Map.of("landuse", "village_green")),
"osm",
null,
0
)));
}

@Test
void landuseAllotments() {
assertFeatures(15,
List.of(Map.of("pmap:kind", "allotments")),
process(SimpleFeature.create(
newPolygon(0, 0, 0, 1, 1, 1, 0, 0),
new HashMap<>(Map.of("landuse", "allotments")),
"osm",
null,
0
)));
}
}

0 comments on commit f992584

Please sign in to comment.