mirror of
https://github.com/cfpwastaken/planetiler-openmaptiles.git
synced 2026-02-04 12:31:10 +00:00
Update to OMT 3.14 (#50)
* initial update step: 3.13.1 bumped to 3.14
* automated update steps: regenerate-openmaptiles.sh v3.14 + mvn spotless:apply
* riverbank was removed from waterway -> replaced with dock un the unit test
* riverbank was removed from waterway -> testRiverbank() changed into testDock()
* riverbank was removed in OpenMapTiles v3.14
* parcel_locker (with brand, operator and/or ref) was added in OpenMapTiles v3.14
* bus_guideway was added in OpenMapTiles v3.14
* support for county seats (capital=6) was added in OpenMapTiles v3.14
* spotless:apply
* gn_ascii replaced with name_en
gn_ascii was removed from NE5 - see commit b14da2ea in OMT for more
details
* merging of buildings at Z13 replicated also for landuse from Z9 (or for some from Z6) to Z13 to match updates in OpenMapTiles v3.14
* landuse_merge_z9_to_z13 argument removed since it has negligible perf. overhead hence no need to have it
* cover a corner case for parcel_locker: no brand, no operator, just ref
* corrected landuse polygon merging to better match OpenMapTiles 3.14 (1)
* corrected landuse polygon merging to better match OpenMapTiles 3.14 (1): merge only landuse=residential
* clean-up: since evaluation in Landuse is simpler than in Landcover, streaming and Collectors.partitioningBy() used
* clean-up of naming: splitList -> splitLists
* land-use merging unit test adjusted and extended to match recent changes
* other unit tests adjusted to match recent changes
* spotless:apply
* clean-up: added comment, to match Landover
* 3.13.1 bumped to 3.14 (follow-up/fix for e26e13a6f)
* adjusted WOOD_OR_FOREST handling for Z8 to match change in OMT (osm_landcover_gen_z8)
* updated unit test to match adjusted WOOD_OR_FOREST handling for Z8
* clean-up: if-else replaced with switch
* clean-up: conditional grouped to make it more readable
This commit is contained in:
@@ -50,7 +50,7 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* OSM element parsers generated from the <a href="https://github.com/omniscale/imposm3">imposm3</a> table definitions
|
||||
* in the <a href="https://github.com/openmaptiles/openmaptiles/blob/v3.13.1/openmaptiles.yaml">OpenMapTiles vector tile
|
||||
* in the <a href="https://github.com/openmaptiles/openmaptiles/blob/v3.14/openmaptiles.yaml">OpenMapTiles vector tile
|
||||
* schema</a>.
|
||||
*
|
||||
* These filter and parse the raw OSM key/value attribute pairs on tags into records with fields that match the columns
|
||||
@@ -106,10 +106,10 @@ public class Tables {
|
||||
}
|
||||
|
||||
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
|
||||
public static final Expression MAPPING =
|
||||
and(or(matchAny("landuse", "reservoir", "basin", "salt_pond"), matchAny("leisure", "swimming_pool"),
|
||||
matchAny("natural", "water", "bay", "spring"), matchAny("waterway", "riverbank", "dock"),
|
||||
matchAny("water", "river")), not(matchAny("covered", "yes")), matchType("polygon"));
|
||||
public static final Expression MAPPING = and(
|
||||
or(matchAny("landuse", "reservoir", "basin", "salt_pond"), matchAny("leisure", "swimming_pool"),
|
||||
matchAny("natural", "water", "bay", "spring"), matchAny("waterway", "dock"), matchAny("water", "river")),
|
||||
not(matchAny("covered", "yes")), matchType("polygon"));
|
||||
|
||||
/**
|
||||
* Interface for layer implementations to extend to subscribe to OSM elements filtered and parsed as
|
||||
@@ -153,8 +153,8 @@ public class Tables {
|
||||
public static final Expression MAPPING = and(or(
|
||||
matchAny("landuse", "allotments", "farm", "farmland", "orchard", "plant_nursery", "vineyard", "grass",
|
||||
"grassland", "meadow", "forest", "village_green", "recreation_ground"),
|
||||
matchAny("natural", "wood", "wetland", "fell", "grassland", "heath", "scrub", "tundra", "glacier", "bare_rock",
|
||||
"scree", "beach", "sand", "dune"),
|
||||
matchAny("natural", "wood", "wetland", "fell", "grassland", "heath", "scrub", "shrubbery", "tundra", "glacier",
|
||||
"bare_rock", "scree", "beach", "sand", "dune"),
|
||||
matchAny("leisure", "park", "garden", "golf_course"), matchAny("wetland", "bog", "swamp", "wet_meadow", "marsh",
|
||||
"reedbed", "saltern", "tidalflat", "saltmarsh", "mangrove")),
|
||||
matchType("polygon"));
|
||||
@@ -178,8 +178,8 @@ public class Tables {
|
||||
|
||||
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
|
||||
public static final Expression MAPPING = and(or(
|
||||
matchAny("landuse", "railway", "cemetery", "military", "residential", "commercial", "industrial", "garages",
|
||||
"retail"),
|
||||
matchAny("landuse", "railway", "cemetery", "military", "quarry", "residential", "commercial", "industrial",
|
||||
"garages", "retail"),
|
||||
matchAny("amenity", "bus_station", "school", "university", "kindergarten", "college", "library", "hospital",
|
||||
"grave_yard"),
|
||||
matchAny("leisure", "stadium", "pitch", "playground", "track"), matchAny("tourism", "theme_park", "zoo"),
|
||||
@@ -345,7 +345,7 @@ public class Tables {
|
||||
matchAny("highway", "motorway", "motorway_link", "trunk", "trunk_link", "primary", "primary_link", "secondary",
|
||||
"secondary_link", "tertiary", "tertiary_link", "unclassified", "residential", "living_street", "road",
|
||||
"pedestrian", "path", "footway", "cycleway", "steps", "bridleway", "corridor", "service", "track", "raceway",
|
||||
"busway", "construction"),
|
||||
"busway", "bus_guideway", "construction"),
|
||||
matchAny("public_transport", "platform"), matchAny("man_made", "pier"),
|
||||
matchAny("service", "driveway", "parking_aisle")), matchType("linestring"));
|
||||
|
||||
@@ -690,17 +690,19 @@ public class Tables {
|
||||
/** An OSM element that would appear in the {@code osm_poi_point} table generated by imposm3. */
|
||||
public record OsmPoiPoint(@Override String name, @Override String nameEn, @Override String nameDe,
|
||||
@Override String subclass, @Override String mappingKey, @Override String station, @Override String funicular,
|
||||
@Override String information, @Override String uicRef, @Override String religion, @Override long level,
|
||||
@Override boolean indoor, @Override long layer, @Override String sport, @Override String operator,
|
||||
@Override String network, @Override SourceFeature source) implements Row, WithName, WithNameEn, WithNameDe,
|
||||
WithSubclass, WithMappingKey, WithStation, WithFunicular, WithInformation, WithUicRef, WithReligion, WithLevel,
|
||||
WithIndoor, WithLayer, WithSport, WithOperator, WithNetwork, WithSource {
|
||||
@Override String information, @Override String uicRef, @Override String ref, @Override String religion,
|
||||
@Override long level, @Override boolean indoor, @Override long layer, @Override String sport,
|
||||
@Override String operator, @Override String network, @Override String brand, @Override SourceFeature source)
|
||||
implements Row, WithName, WithNameEn, WithNameDe, WithSubclass, WithMappingKey, WithStation, WithFunicular,
|
||||
WithInformation, WithUicRef, WithRef, WithReligion, WithLevel, WithIndoor, WithLayer, WithSport, WithOperator,
|
||||
WithNetwork, WithBrand, WithSource {
|
||||
public OsmPoiPoint(SourceFeature source, String mappingKey) {
|
||||
this(source.getString("name"), source.getString("name:en"), source.getString("name:de"),
|
||||
source.getString(mappingKey), mappingKey, source.getString("station"), source.getString("funicular"),
|
||||
source.getString("information"), source.getString("uic_ref"), source.getString("religion"),
|
||||
source.getLong("level"), source.getBoolean("indoor"), source.getLong("layer"), source.getString("sport"),
|
||||
source.getString("operator"), source.getString("network"), source);
|
||||
source.getString("information"), source.getString("uic_ref"), source.getString("ref"),
|
||||
source.getString("religion"), source.getLong("level"), source.getBoolean("indoor"), source.getLong("layer"),
|
||||
source.getString("sport"), source.getString("operator"), source.getString("network"), source.getString("brand"),
|
||||
source);
|
||||
}
|
||||
|
||||
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
|
||||
@@ -709,8 +711,8 @@ public class Tables {
|
||||
"bus_station", "cafe", "cinema", "clinic", "college", "community_centre", "courthouse", "dentist", "doctors",
|
||||
"drinking_water", "fast_food", "ferry_terminal", "fire_station", "food_court", "fuel", "grave_yard", "hospital",
|
||||
"ice_cream", "kindergarten", "library", "marketplace", "motorcycle_parking", "nightclub", "nursing_home",
|
||||
"parking", "pharmacy", "place_of_worship", "police", "post_box", "post_office", "prison", "pub",
|
||||
"public_building", "recycling", "restaurant", "school", "shelter", "swimming_pool", "taxi", "telephone",
|
||||
"parking", "pharmacy", "place_of_worship", "police", "parcel_locker", "post_box", "post_office", "prison",
|
||||
"pub", "public_building", "recycling", "restaurant", "school", "shelter", "swimming_pool", "taxi", "telephone",
|
||||
"theatre", "toilets", "townhall", "university", "veterinary", "waste_basket"),
|
||||
matchAny("barrier", "bollard", "border_control", "cycle_barrier", "gate", "lift_gate", "sally_port", "stile",
|
||||
"toll_booth"),
|
||||
@@ -758,17 +760,19 @@ public class Tables {
|
||||
/** An OSM element that would appear in the {@code osm_poi_polygon} table generated by imposm3. */
|
||||
public record OsmPoiPolygon(@Override String name, @Override String nameEn, @Override String nameDe,
|
||||
@Override String subclass, @Override String mappingKey, @Override String station, @Override String funicular,
|
||||
@Override String information, @Override String uicRef, @Override String religion, @Override long level,
|
||||
@Override boolean indoor, @Override long layer, @Override String sport, @Override String operator,
|
||||
@Override String network, @Override SourceFeature source) implements Row, WithName, WithNameEn, WithNameDe,
|
||||
WithSubclass, WithMappingKey, WithStation, WithFunicular, WithInformation, WithUicRef, WithReligion, WithLevel,
|
||||
WithIndoor, WithLayer, WithSport, WithOperator, WithNetwork, WithSource {
|
||||
@Override String information, @Override String uicRef, @Override String ref, @Override String religion,
|
||||
@Override long level, @Override boolean indoor, @Override long layer, @Override String sport,
|
||||
@Override String operator, @Override String network, @Override String brand, @Override SourceFeature source)
|
||||
implements Row, WithName, WithNameEn, WithNameDe, WithSubclass, WithMappingKey, WithStation, WithFunicular,
|
||||
WithInformation, WithUicRef, WithRef, WithReligion, WithLevel, WithIndoor, WithLayer, WithSport, WithOperator,
|
||||
WithNetwork, WithBrand, WithSource {
|
||||
public OsmPoiPolygon(SourceFeature source, String mappingKey) {
|
||||
this(source.getString("name"), source.getString("name:en"), source.getString("name:de"),
|
||||
source.getString(mappingKey), mappingKey, source.getString("station"), source.getString("funicular"),
|
||||
source.getString("information"), source.getString("uic_ref"), source.getString("religion"),
|
||||
source.getLong("level"), source.getBoolean("indoor"), source.getLong("layer"), source.getString("sport"),
|
||||
source.getString("operator"), source.getString("network"), source);
|
||||
source.getString("information"), source.getString("uic_ref"), source.getString("ref"),
|
||||
source.getString("religion"), source.getLong("level"), source.getBoolean("indoor"), source.getLong("layer"),
|
||||
source.getString("sport"), source.getString("operator"), source.getString("network"), source.getString("brand"),
|
||||
source);
|
||||
}
|
||||
|
||||
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
|
||||
@@ -777,8 +781,8 @@ public class Tables {
|
||||
"bus_station", "cafe", "cinema", "clinic", "college", "community_centre", "courthouse", "dentist", "doctors",
|
||||
"drinking_water", "fast_food", "ferry_terminal", "fire_station", "food_court", "fuel", "grave_yard", "hospital",
|
||||
"ice_cream", "kindergarten", "library", "marketplace", "motorcycle_parking", "nightclub", "nursing_home",
|
||||
"parking", "pharmacy", "place_of_worship", "police", "post_box", "post_office", "prison", "pub",
|
||||
"public_building", "recycling", "restaurant", "school", "shelter", "swimming_pool", "taxi", "telephone",
|
||||
"parking", "pharmacy", "place_of_worship", "police", "parcel_locker", "post_box", "post_office", "prison",
|
||||
"pub", "public_building", "recycling", "restaurant", "school", "shelter", "swimming_pool", "taxi", "telephone",
|
||||
"theatre", "toilets", "townhall", "university", "veterinary", "waste_basket"),
|
||||
matchAny("barrier", "bollard", "border_control", "cycle_barrier", "gate", "lift_gate", "sally_port", "stile",
|
||||
"toll_booth"),
|
||||
@@ -886,6 +890,11 @@ public class Tables {
|
||||
String boundary();
|
||||
}
|
||||
|
||||
/** Rows with a String brand attribute. */
|
||||
public interface WithBrand {
|
||||
String brand();
|
||||
}
|
||||
|
||||
/** Rows with a String building attribute. */
|
||||
public interface WithBuilding {
|
||||
String building();
|
||||
|
||||
Reference in New Issue
Block a user