mirror of
https://github.com/cfpwastaken/planetiler-openmaptiles.git
synced 2026-02-04 20:41:09 +00:00
Upgrade planetiler-basemap to be compatible with OpenMapTiles 3.13 (#49)
Applying changes to layers from [OpenMapTiles 3.13 release](https://github.com/openmaptiles/openmaptiles/releases/tag/v3.13) (https://github.com/openmaptiles/openmaptiles/compare/v3.12.2...v3.13), minus transportation network connectivity improvements - those will be a separate change.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (c) 2016, KlokanTech.com & OpenMapTiles contributors.
|
||||
Copyright (c) 2021, MapTiler.com & OpenMapTiles contributors.
|
||||
All rights reserved.
|
||||
|
||||
Code license: BSD 3-Clause License
|
||||
@@ -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.12.2/openmaptiles.yaml">OpenMapTiles vector tile
|
||||
* in the <a href="https://github.com/openmaptiles/openmaptiles/blob/v3.13/openmaptiles.yaml">OpenMapTiles vector tile
|
||||
* schema</a>.
|
||||
* <p>
|
||||
* These filter and parse the raw OSM key/value attribute pairs on tags into records with fields that match the columns
|
||||
@@ -75,7 +75,7 @@ public class Tables {
|
||||
}
|
||||
|
||||
/** The {@code rowClass} of an imposm3 table row and its constructor coerced to a {@link Constructor}. */
|
||||
public static record RowClassAndConstructor(
|
||||
public record RowClassAndConstructor(
|
||||
Class<? extends Row> rowClass,
|
||||
Constructor create
|
||||
) {}
|
||||
@@ -89,31 +89,31 @@ public class Tables {
|
||||
}
|
||||
|
||||
/** The {@code handlerClass} of a layer handler and it's {@code process} method coerced to a {@link RowHandler}. */
|
||||
public static record RowHandlerAndClass<T extends Row>(
|
||||
public record RowHandlerAndClass<T extends Row>(
|
||||
Class<?> handlerClass,
|
||||
RowHandler<T> handler
|
||||
) {}
|
||||
|
||||
/** An OSM element that would appear in the {@code osm_water_polygon} table generated by imposm3. */
|
||||
public static record OsmWaterPolygon(
|
||||
public record OsmWaterPolygon(
|
||||
@Override String name, @Override String nameEn, @Override String nameDe, @Override String natural,
|
||||
@Override String landuse, @Override String waterway, @Override boolean isIntermittent, @Override boolean isTunnel,
|
||||
@Override boolean isBridge, @Override SourceFeature source
|
||||
) implements Row, WithName, WithNameEn, WithNameDe, WithNatural, WithLanduse, WithWaterway, WithIsIntermittent,
|
||||
WithIsTunnel, WithIsBridge, WithSource {
|
||||
@Override String landuse, @Override String waterway, @Override String water, @Override boolean isIntermittent,
|
||||
@Override boolean isTunnel, @Override boolean isBridge, @Override SourceFeature source
|
||||
) implements Row, WithName, WithNameEn, WithNameDe, WithNatural, WithLanduse, WithWaterway, WithWater,
|
||||
WithIsIntermittent, WithIsTunnel, WithIsBridge, WithSource {
|
||||
|
||||
public OsmWaterPolygon(SourceFeature source, String mappingKey) {
|
||||
this(source.getString("name"), source.getString("name:en"), source.getString("name:de"),
|
||||
source.getString("natural"), source.getString("landuse"), source.getString("waterway"),
|
||||
source.getBoolean("intermittent"), source.getBoolean("tunnel"), source.getBoolean("bridge"), source);
|
||||
source.getString("water"), source.getBoolean("intermittent"), source.getBoolean("tunnel"),
|
||||
source.getBoolean("bridge"), source);
|
||||
}
|
||||
|
||||
/** 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"),
|
||||
matchAny("waterway", "river", "riverbank", "stream", "canal", "drain", "ditch", "dock")),
|
||||
not(matchAny("covered", "yes")), matchType("polygon"));
|
||||
matchAny("natural", "water", "bay", "spring"), matchAny("waterway", "riverbank", "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 {@link
|
||||
@@ -126,7 +126,7 @@ public class Tables {
|
||||
}
|
||||
|
||||
/** An OSM element that would appear in the {@code osm_waterway_linestring} table generated by imposm3. */
|
||||
public static record OsmWaterwayLinestring(
|
||||
public record OsmWaterwayLinestring(
|
||||
@Override String waterway, @Override String name, @Override String nameEn, @Override String nameDe,
|
||||
@Override boolean isTunnel, @Override boolean isBridge, @Override boolean isIntermittent,
|
||||
@Override SourceFeature source
|
||||
@@ -154,7 +154,7 @@ public class Tables {
|
||||
}
|
||||
|
||||
/** An OSM element that would appear in the {@code osm_landcover_polygon} table generated by imposm3. */
|
||||
public static record OsmLandcoverPolygon(
|
||||
public record OsmLandcoverPolygon(
|
||||
@Override String subclass, @Override String mappingKey, @Override SourceFeature source
|
||||
) implements Row, WithSubclass, WithMappingKey, WithSource {
|
||||
|
||||
@@ -165,7 +165,7 @@ public class Tables {
|
||||
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
|
||||
public static final Expression MAPPING = and(or(
|
||||
matchAny("landuse", "allotments", "farm", "farmland", "orchard", "plant_nursery", "vineyard", "grass",
|
||||
"grassland", "meadow", "forest", "village_green", "recreation_ground", "park"),
|
||||
"grassland", "meadow", "forest", "village_green", "recreation_ground"),
|
||||
matchAny("natural", "wood", "wetland", "fell", "grassland", "heath", "scrub", "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",
|
||||
@@ -182,7 +182,7 @@ public class Tables {
|
||||
}
|
||||
|
||||
/** An OSM element that would appear in the {@code osm_landuse_polygon} table generated by imposm3. */
|
||||
public static record OsmLandusePolygon(
|
||||
public record OsmLandusePolygon(
|
||||
@Override String landuse, @Override String amenity, @Override String leisure, @Override String tourism,
|
||||
@Override String place, @Override String waterway, @Override SourceFeature source
|
||||
) implements Row, WithLanduse, WithAmenity, WithLeisure, WithTourism, WithPlace, WithWaterway, WithSource {
|
||||
@@ -196,9 +196,10 @@ public class Tables {
|
||||
public static final Expression MAPPING = and(or(
|
||||
matchAny("landuse", "railway", "cemetery", "military", "residential", "commercial", "industrial", "garages",
|
||||
"retail"),
|
||||
matchAny("amenity", "bus_station", "school", "university", "kindergarten", "college", "library", "hospital"),
|
||||
matchAny("leisure", "stadium", "pitch", "playground", "track"), matchAny("tourism", "theme_park", "zoo"),
|
||||
matchAny("place", "suburb", "quarter", "neighbourhood"), matchAny("waterway", "dam")), matchType("polygon"));
|
||||
matchAny("amenity", "bus_station", "school", "university", "kindergarten", "college", "library", "hospital",
|
||||
"grave_yard"), matchAny("leisure", "stadium", "pitch", "playground", "track"),
|
||||
matchAny("tourism", "theme_park", "zoo"), matchAny("place", "suburb", "quarter", "neighbourhood"),
|
||||
matchAny("waterway", "dam")), matchType("polygon"));
|
||||
|
||||
/**
|
||||
* Interface for layer implementations to extend to subscribe to OSM elements filtered and parsed as {@link
|
||||
@@ -211,7 +212,7 @@ public class Tables {
|
||||
}
|
||||
|
||||
/** An OSM element that would appear in the {@code osm_peak_point} table generated by imposm3. */
|
||||
public static record OsmPeakPoint(
|
||||
public record OsmPeakPoint(
|
||||
@Override String name, @Override String nameEn, @Override String nameDe, @Override String ele,
|
||||
@Override String wikipedia, @Override SourceFeature source
|
||||
) implements Row, WithName, WithNameEn, WithNameDe, WithEle, WithWikipedia, WithSource {
|
||||
@@ -222,7 +223,7 @@ public class Tables {
|
||||
}
|
||||
|
||||
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
|
||||
public static final Expression MAPPING = and(matchAny("natural", "peak", "volcano"), matchType("point"));
|
||||
public static final Expression MAPPING = and(matchAny("natural", "peak", "volcano", "saddle"), matchType("point"));
|
||||
|
||||
/**
|
||||
* Interface for layer implementations to extend to subscribe to OSM elements filtered and parsed as {@link
|
||||
@@ -234,8 +235,33 @@ public class Tables {
|
||||
}
|
||||
}
|
||||
|
||||
/** An OSM element that would appear in the {@code osm_mountain_linestring} table generated by imposm3. */
|
||||
public record OsmMountainLinestring(
|
||||
@Override String name, @Override String nameEn, @Override String nameDe, @Override String wikipedia,
|
||||
@Override SourceFeature source
|
||||
) implements Row, WithName, WithNameEn, WithNameDe, WithWikipedia, WithSource {
|
||||
|
||||
public OsmMountainLinestring(SourceFeature source, String mappingKey) {
|
||||
this(source.getString("name"), source.getString("name:en"), source.getString("name:de"),
|
||||
source.getString("wikipedia"), source);
|
||||
}
|
||||
|
||||
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
|
||||
public static final Expression MAPPING = and(matchAny("natural", "ridge", "cliff", "arete"),
|
||||
matchType("linestring"));
|
||||
|
||||
/**
|
||||
* Interface for layer implementations to extend to subscribe to OSM elements filtered and parsed as {@link
|
||||
* OsmMountainLinestring}.
|
||||
*/
|
||||
public interface Handler {
|
||||
|
||||
void process(OsmMountainLinestring element, FeatureCollector features);
|
||||
}
|
||||
}
|
||||
|
||||
/** An OSM element that would appear in the {@code osm_park_polygon} table generated by imposm3. */
|
||||
public static record OsmParkPolygon(
|
||||
public record OsmParkPolygon(
|
||||
@Override String name, @Override String nameEn, @Override String nameDe, @Override String landuse,
|
||||
@Override String leisure, @Override String boundary, @Override String protectionTitle,
|
||||
@Override SourceFeature source
|
||||
@@ -264,7 +290,7 @@ public class Tables {
|
||||
}
|
||||
|
||||
/** An OSM element that would appear in the {@code osm_aeroway_polygon} table generated by imposm3. */
|
||||
public static record OsmAerowayPolygon(
|
||||
public record OsmAerowayPolygon(
|
||||
@Override String ref, @Override String aeroway, @Override SourceFeature source
|
||||
) implements Row, WithRef, WithAeroway, WithSource {
|
||||
|
||||
@@ -289,7 +315,7 @@ public class Tables {
|
||||
}
|
||||
|
||||
/** An OSM element that would appear in the {@code osm_aeroway_linestring} table generated by imposm3. */
|
||||
public static record OsmAerowayLinestring(
|
||||
public record OsmAerowayLinestring(
|
||||
@Override String ref, @Override String aeroway, @Override SourceFeature source
|
||||
) implements Row, WithRef, WithAeroway, WithSource {
|
||||
|
||||
@@ -311,7 +337,7 @@ public class Tables {
|
||||
}
|
||||
|
||||
/** An OSM element that would appear in the {@code osm_aeroway_point} table generated by imposm3. */
|
||||
public static record OsmAerowayPoint(
|
||||
public record OsmAerowayPoint(
|
||||
@Override String ref, @Override String aeroway, @Override SourceFeature source
|
||||
) implements Row, WithRef, WithAeroway, WithSource {
|
||||
|
||||
@@ -333,18 +359,19 @@ public class Tables {
|
||||
}
|
||||
|
||||
/** An OSM element that would appear in the {@code osm_highway_linestring} table generated by imposm3. */
|
||||
public static record OsmHighwayLinestring(
|
||||
public record OsmHighwayLinestring(
|
||||
@Override String highway, @Override String construction, @Override String ref, @Override String network,
|
||||
@Override int zOrder, @Override long layer, @Override long level, @Override boolean indoor, @Override String name,
|
||||
@Override String nameEn, @Override String nameDe, @Override String shortName, @Override boolean isTunnel,
|
||||
@Override boolean isBridge, @Override boolean isRamp, @Override boolean isFord, @Override int isOneway,
|
||||
@Override boolean isArea, @Override String service, @Override String usage, @Override String publicTransport,
|
||||
@Override String manMade, @Override String bicycle, @Override String foot, @Override String horse,
|
||||
@Override String mtbScale, @Override String surface, @Override SourceFeature source
|
||||
@Override boolean isArea, @Override String service, @Override String access, @Override boolean toll,
|
||||
@Override String usage, @Override String publicTransport, @Override String manMade, @Override String bicycle,
|
||||
@Override String foot, @Override String horse, @Override String mtbScale, @Override String sacScale,
|
||||
@Override String surface, @Override boolean expressway, @Override SourceFeature source
|
||||
) implements Row, WithHighway, WithConstruction, WithRef, WithNetwork, WithZOrder, WithLayer, WithLevel, WithIndoor,
|
||||
WithName, WithNameEn, WithNameDe, WithShortName, WithIsTunnel, WithIsBridge, WithIsRamp, WithIsFord, WithIsOneway,
|
||||
WithIsArea, WithService, WithUsage, WithPublicTransport, WithManMade, WithBicycle, WithFoot, WithHorse,
|
||||
WithMtbScale, WithSurface, WithSource {
|
||||
WithIsArea, WithService, WithAccess, WithToll, WithUsage, WithPublicTransport, WithManMade, WithBicycle, WithFoot,
|
||||
WithHorse, WithMtbScale, WithSacScale, WithSurface, WithExpressway, WithSource {
|
||||
|
||||
public OsmHighwayLinestring(SourceFeature source, String mappingKey) {
|
||||
this(source.getString("highway"), source.getString("construction"), source.getString("ref"),
|
||||
@@ -352,18 +379,19 @@ public class Tables {
|
||||
source.getBoolean("indoor"), source.getString("name"), source.getString("name:en"), source.getString("name:de"),
|
||||
source.getString("short_name"), source.getBoolean("tunnel"), source.getBoolean("bridge"),
|
||||
source.getBoolean("ramp"), source.getBoolean("ford"), source.getDirection("oneway"), source.getBoolean("area"),
|
||||
source.getString("service"), source.getString("usage"), source.getString("public_transport"),
|
||||
source.getString("man_made"), source.getString("bicycle"), source.getString("foot"), source.getString("horse"),
|
||||
source.getString("mtb:scale"), source.getString("surface"), source);
|
||||
source.getString("service"), source.getString("access"), source.getBoolean("toll"), source.getString("usage"),
|
||||
source.getString("public_transport"), source.getString("man_made"), source.getString("bicycle"),
|
||||
source.getString("foot"), source.getString("horse"), source.getString("mtb:scale"),
|
||||
source.getString("sac_scale"), source.getString("surface"), source.getBoolean("expressway"), source);
|
||||
}
|
||||
|
||||
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
|
||||
public static final Expression MAPPING = and(or(
|
||||
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",
|
||||
"construction"), matchAny("public_transport", "platform"), matchAny("man_made", "pier")),
|
||||
matchType("linestring"));
|
||||
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"), matchAny("public_transport", "platform"), matchAny("man_made", "pier"),
|
||||
matchAny("service", "driveway", "parking_aisle")), matchType("linestring"));
|
||||
|
||||
/**
|
||||
* Interface for layer implementations to extend to subscribe to OSM elements filtered and parsed as {@link
|
||||
@@ -376,7 +404,7 @@ public class Tables {
|
||||
}
|
||||
|
||||
/** An OSM element that would appear in the {@code osm_railway_linestring} table generated by imposm3. */
|
||||
public static record OsmRailwayLinestring(
|
||||
public record OsmRailwayLinestring(
|
||||
@Override String railway, @Override String ref, @Override String network, @Override int zOrder,
|
||||
@Override long layer, @Override long level, @Override boolean indoor, @Override String name,
|
||||
@Override String nameEn, @Override String nameDe, @Override String shortName, @Override boolean isTunnel,
|
||||
@@ -411,7 +439,7 @@ public class Tables {
|
||||
}
|
||||
|
||||
/** An OSM element that would appear in the {@code osm_aerialway_linestring} table generated by imposm3. */
|
||||
public static record OsmAerialwayLinestring(
|
||||
public record OsmAerialwayLinestring(
|
||||
@Override String aerialway, @Override int zOrder, @Override long layer, @Override String name,
|
||||
@Override String nameEn, @Override String nameDe, @Override String shortName, @Override boolean isTunnel,
|
||||
@Override boolean isBridge, @Override boolean isRamp, @Override boolean isFord, @Override int isOneway,
|
||||
@@ -442,7 +470,7 @@ public class Tables {
|
||||
}
|
||||
|
||||
/** An OSM element that would appear in the {@code osm_shipway_linestring} table generated by imposm3. */
|
||||
public static record OsmShipwayLinestring(
|
||||
public record OsmShipwayLinestring(
|
||||
@Override String shipway, @Override int zOrder, @Override long layer, @Override String name,
|
||||
@Override String nameEn, @Override String nameDe, @Override String shortName, @Override boolean isTunnel,
|
||||
@Override boolean isBridge, @Override boolean isRamp, @Override boolean isFord, @Override int isOneway,
|
||||
@@ -472,17 +500,17 @@ public class Tables {
|
||||
}
|
||||
|
||||
/** An OSM element that would appear in the {@code osm_highway_polygon} table generated by imposm3. */
|
||||
public static record OsmHighwayPolygon(
|
||||
public record OsmHighwayPolygon(
|
||||
@Override String highway, @Override int zOrder, @Override long layer, @Override long level,
|
||||
@Override boolean indoor, @Override boolean isArea, @Override String publicTransport, @Override String manMade,
|
||||
@Override SourceFeature source
|
||||
@Override String service, @Override SourceFeature source
|
||||
) implements Row, WithHighway, WithZOrder, WithLayer, WithLevel, WithIndoor, WithIsArea, WithPublicTransport,
|
||||
WithManMade, WithSource {
|
||||
WithManMade, WithService, WithSource {
|
||||
|
||||
public OsmHighwayPolygon(SourceFeature source, String mappingKey) {
|
||||
this(source.getString("highway"), source.getWayZorder(), source.getLong("layer"), source.getLong("level"),
|
||||
source.getBoolean("indoor"), source.getBoolean("area"), source.getString("public_transport"),
|
||||
source.getString("man_made"), source);
|
||||
source.getString("man_made"), source.getString("service"), source);
|
||||
}
|
||||
|
||||
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
|
||||
@@ -500,8 +528,34 @@ public class Tables {
|
||||
}
|
||||
}
|
||||
|
||||
/** An OSM element that would appear in the {@code osm_highway_point} table generated by imposm3. */
|
||||
public record OsmHighwayPoint(
|
||||
@Override String highway, @Override int zOrder, @Override long layer, @Override long level, @Override String name,
|
||||
@Override String nameEn, @Override String nameDe, @Override String ref, @Override SourceFeature source
|
||||
) implements Row, WithHighway, WithZOrder, WithLayer, WithLevel, WithName, WithNameEn, WithNameDe, WithRef,
|
||||
WithSource {
|
||||
|
||||
public OsmHighwayPoint(SourceFeature source, String mappingKey) {
|
||||
this(source.getString("highway"), source.getWayZorder(), source.getLong("layer"), source.getLong("level"),
|
||||
source.getString("name"), source.getString("name:en"), source.getString("name:de"), source.getString("ref"),
|
||||
source);
|
||||
}
|
||||
|
||||
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
|
||||
public static final Expression MAPPING = and(matchAny("highway", "motorway_junction"), matchType("point"));
|
||||
|
||||
/**
|
||||
* Interface for layer implementations to extend to subscribe to OSM elements filtered and parsed as {@link
|
||||
* OsmHighwayPoint}.
|
||||
*/
|
||||
public interface Handler {
|
||||
|
||||
void process(OsmHighwayPoint element, FeatureCollector features);
|
||||
}
|
||||
}
|
||||
|
||||
/** An OSM element that would appear in the {@code osm_building_polygon} table generated by imposm3. */
|
||||
public static record OsmBuildingPolygon(
|
||||
public record OsmBuildingPolygon(
|
||||
@Override String material, @Override String colour, @Override String building, @Override String buildingpart,
|
||||
@Override String buildingheight, @Override String buildingminHeight, @Override String buildinglevels,
|
||||
@Override String buildingminLevel, @Override String height, @Override String minHeight, @Override String levels,
|
||||
@@ -518,9 +572,10 @@ public class Tables {
|
||||
|
||||
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
|
||||
public static final Expression MAPPING = and(
|
||||
or(matchField("building:part"), matchField("building"), matchAny("aeroway", "terminal", "hangar")),
|
||||
not(matchAny("building", "no", "none", "No")), not(matchAny("building:part", "no", "none", "No")),
|
||||
not(matchAny("man_made", "bridge")), matchType("polygon"));
|
||||
or(matchField("building:part"), matchField("building"), matchAny("aeroway", "terminal", "hangar"),
|
||||
matchAny("location", "underground")), not(matchAny("building", "no", "none", "No")),
|
||||
not(matchAny("building:part", "no", "none", "No")), not(matchAny("man_made", "bridge")),
|
||||
not(matchAny("location", "underground")), matchType("polygon"));
|
||||
|
||||
/**
|
||||
* Interface for layer implementations to extend to subscribe to OSM elements filtered and parsed as {@link
|
||||
@@ -533,7 +588,7 @@ public class Tables {
|
||||
}
|
||||
|
||||
/** An OSM element that would appear in the {@code osm_marine_point} table generated by imposm3. */
|
||||
public static record OsmMarinePoint(
|
||||
public record OsmMarinePoint(
|
||||
@Override String name, @Override String nameEn, @Override String nameDe, @Override String place,
|
||||
@Override long rank, @Override boolean isIntermittent, @Override SourceFeature source
|
||||
) implements Row, WithName, WithNameEn, WithNameDe, WithPlace, WithRank, WithIsIntermittent, WithSource {
|
||||
@@ -558,7 +613,7 @@ public class Tables {
|
||||
}
|
||||
|
||||
/** An OSM element that would appear in the {@code osm_continent_point} table generated by imposm3. */
|
||||
public static record OsmContinentPoint(
|
||||
public record OsmContinentPoint(
|
||||
@Override String name, @Override String nameEn, @Override String nameDe, @Override SourceFeature source
|
||||
) implements Row, WithName, WithNameEn, WithNameDe, WithSource {
|
||||
|
||||
@@ -581,7 +636,7 @@ public class Tables {
|
||||
}
|
||||
|
||||
/** An OSM element that would appear in the {@code osm_country_point} table generated by imposm3. */
|
||||
public static record OsmCountryPoint(
|
||||
public record OsmCountryPoint(
|
||||
@Override String name, @Override String nameEn, @Override String nameDe, @Override long rank,
|
||||
@Override String countryCodeIso31661Alpha2, @Override String iso31661Alpha2, @Override String iso31661,
|
||||
@Override SourceFeature source
|
||||
@@ -608,7 +663,7 @@ public class Tables {
|
||||
}
|
||||
|
||||
/** An OSM element that would appear in the {@code osm_island_polygon} table generated by imposm3. */
|
||||
public static record OsmIslandPolygon(
|
||||
public record OsmIslandPolygon(
|
||||
@Override String name, @Override String nameEn, @Override String nameDe, @Override long rank,
|
||||
@Override SourceFeature source
|
||||
) implements Row, WithName, WithNameEn, WithNameDe, WithRank, WithSource {
|
||||
@@ -632,7 +687,7 @@ public class Tables {
|
||||
}
|
||||
|
||||
/** An OSM element that would appear in the {@code osm_island_point} table generated by imposm3. */
|
||||
public static record OsmIslandPoint(
|
||||
public record OsmIslandPoint(
|
||||
@Override String name, @Override String nameEn, @Override String nameDe, @Override long rank,
|
||||
@Override SourceFeature source
|
||||
) implements Row, WithName, WithNameEn, WithNameDe, WithRank, WithSource {
|
||||
@@ -656,20 +711,22 @@ public class Tables {
|
||||
}
|
||||
|
||||
/** An OSM element that would appear in the {@code osm_state_point} table generated by imposm3. */
|
||||
public static record OsmStatePoint(
|
||||
@Override String name, @Override String nameEn, @Override String nameDe, @Override String isInCountry,
|
||||
@Override String isInCountryCode, @Override String ref, @Override long rank, @Override SourceFeature source
|
||||
) implements Row, WithName, WithNameEn, WithNameDe, WithIsInCountry, WithIsInCountryCode, WithRef, WithRank,
|
||||
WithSource {
|
||||
public record OsmStatePoint(
|
||||
@Override String name, @Override String nameEn, @Override String nameDe, @Override String place,
|
||||
@Override String isInCountry, @Override String isInCountryCode, @Override String ref, @Override long rank,
|
||||
@Override SourceFeature source
|
||||
) implements Row, WithName, WithNameEn, WithNameDe, WithPlace, WithIsInCountry, WithIsInCountryCode, WithRef,
|
||||
WithRank, WithSource {
|
||||
|
||||
public OsmStatePoint(SourceFeature source, String mappingKey) {
|
||||
this(source.getString("name"), source.getString("name:en"), source.getString("name:de"),
|
||||
source.getString("is_in:country"), source.getString("is_in:country_code"), source.getString("ref"),
|
||||
source.getLong("rank"), source);
|
||||
source.getString("place"), source.getString("is_in:country"), source.getString("is_in:country_code"),
|
||||
source.getString("ref"), source.getLong("rank"), source);
|
||||
}
|
||||
|
||||
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
|
||||
public static final Expression MAPPING = and(matchAny("place", "state"), matchField("name"), matchType("point"));
|
||||
public static final Expression MAPPING = and(matchAny("place", "state", "province"), matchField("name"),
|
||||
matchType("point"));
|
||||
|
||||
/**
|
||||
* Interface for layer implementations to extend to subscribe to OSM elements filtered and parsed as {@link
|
||||
@@ -682,7 +739,7 @@ public class Tables {
|
||||
}
|
||||
|
||||
/** An OSM element that would appear in the {@code osm_city_point} table generated by imposm3. */
|
||||
public static record OsmCityPoint(
|
||||
public record OsmCityPoint(
|
||||
@Override String name, @Override String nameEn, @Override String nameDe, @Override String place,
|
||||
@Override long population, @Override String capital, @Override long rank, @Override SourceFeature source
|
||||
) implements Row, WithName, WithNameEn, WithNameDe, WithPlace, WithPopulation, WithCapital, WithRank, WithSource {
|
||||
@@ -709,7 +766,7 @@ public class Tables {
|
||||
}
|
||||
|
||||
/** An OSM element that would appear in the {@code osm_housenumber_point} table generated by imposm3. */
|
||||
public static record OsmHousenumberPoint(@Override String housenumber, @Override SourceFeature source) implements Row,
|
||||
public record OsmHousenumberPoint(@Override String housenumber, @Override SourceFeature source) implements Row,
|
||||
WithHousenumber, WithSource {
|
||||
|
||||
public OsmHousenumberPoint(SourceFeature source, String mappingKey) {
|
||||
@@ -731,7 +788,7 @@ public class Tables {
|
||||
}
|
||||
|
||||
/** An OSM element that would appear in the {@code osm_poi_point} table generated by imposm3. */
|
||||
public static record OsmPoiPoint(
|
||||
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,
|
||||
@@ -751,9 +808,9 @@ public class Tables {
|
||||
public static final Expression MAPPING = and(or(matchAny("aerialway", "station"),
|
||||
matchAny("amenity", "arts_centre", "bank", "bar", "bbq", "bicycle_parking", "bicycle_rental", "biergarten",
|
||||
"bus_station", "cafe", "cinema", "clinic", "college", "community_centre", "courthouse", "dentist", "doctors",
|
||||
"drinking_water", "embassy", "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",
|
||||
"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",
|
||||
"theatre", "toilets", "townhall", "university", "veterinary", "waste_basket"),
|
||||
matchAny("barrier", "bollard", "border_control", "cycle_barrier", "gate", "lift_gate", "sally_port", "stile",
|
||||
@@ -762,17 +819,18 @@ public class Tables {
|
||||
matchAny("landuse", "basin", "brownfield", "cemetery", "reservoir", "winter_sports"),
|
||||
matchAny("leisure", "dog_park", "escape_game", "garden", "golf_course", "ice_rink", "hackerspace", "marina",
|
||||
"miniature_golf", "park", "pitch", "playground", "sports_centre", "stadium", "swimming_area", "swimming_pool",
|
||||
"water_park"), matchAny("railway", "halt", "station", "subway_entrance", "train_station_entrance", "tram_stop"),
|
||||
"water_park"), matchAny("office", "diplomatic"),
|
||||
matchAny("railway", "halt", "station", "subway_entrance", "train_station_entrance", "tram_stop"),
|
||||
matchAny("shop", "accessories", "alcohol", "antiques", "art", "bag", "bakery", "beauty", "bed", "beverages",
|
||||
"bicycle", "books", "boutique", "butcher", "camera", "car", "car_repair", "car_parts", "carpet", "charity",
|
||||
"chemist", "chocolate", "clothes", "coffee", "computer", "confectionery", "convenience", "copyshop",
|
||||
"cosmetics", "deli", "delicatessen", "department_store", "doityourself", "dry_cleaning", "electronics",
|
||||
"erotic", "fabric", "florist", "frozen_food", "furniture", "garden_centre", "general", "gift", "greengrocer",
|
||||
"hairdresser", "hardware", "hearing_aids", "hifi", "ice_cream", "interior_decoration", "jewelry", "kiosk",
|
||||
"lamps", "laundry", "mall", "massage", "mobile_phone", "motorcycle", "music", "musical_instrument", "newsagent",
|
||||
"optician", "outdoor", "perfume", "perfumery", "pet", "photo", "second_hand", "shoes", "sports", "stationery",
|
||||
"supermarket", "tailor", "tattoo", "ticket", "tobacco", "toys", "travel_agency", "video", "video_games",
|
||||
"watches", "weapons", "wholesale", "wine"),
|
||||
"lamps", "laundry", "locksmith", "mall", "massage", "mobile_phone", "motorcycle", "music", "musical_instrument",
|
||||
"newsagent", "optician", "outdoor", "perfume", "perfumery", "pet", "photo", "second_hand", "shoes", "sports",
|
||||
"stationery", "supermarket", "tailor", "tattoo", "ticket", "tobacco", "toys", "travel_agency", "video",
|
||||
"video_games", "watches", "weapons", "wholesale", "wine"),
|
||||
matchAny("sport", "american_football", "archery", "athletics", "australian_football", "badminton", "baseball",
|
||||
"basketball", "beachvolleyball", "billiards", "bmx", "boules", "bowls", "boxing", "canadian_football", "canoe",
|
||||
"chess", "climbing", "climbing_adventure", "cricket", "cricket_nets", "croquet", "curling", "cycling",
|
||||
@@ -798,7 +856,7 @@ public class Tables {
|
||||
}
|
||||
|
||||
/** An OSM element that would appear in the {@code osm_poi_polygon} table generated by imposm3. */
|
||||
public static record OsmPoiPolygon(
|
||||
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,
|
||||
@@ -818,9 +876,9 @@ public class Tables {
|
||||
public static final Expression MAPPING = and(or(matchAny("aerialway", "station"),
|
||||
matchAny("amenity", "arts_centre", "bank", "bar", "bbq", "bicycle_parking", "bicycle_rental", "biergarten",
|
||||
"bus_station", "cafe", "cinema", "clinic", "college", "community_centre", "courthouse", "dentist", "doctors",
|
||||
"drinking_water", "embassy", "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",
|
||||
"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",
|
||||
"theatre", "toilets", "townhall", "university", "veterinary", "waste_basket"),
|
||||
matchAny("barrier", "bollard", "border_control", "cycle_barrier", "gate", "lift_gate", "sally_port", "stile",
|
||||
@@ -829,17 +887,18 @@ public class Tables {
|
||||
matchAny("landuse", "basin", "brownfield", "cemetery", "reservoir", "winter_sports"),
|
||||
matchAny("leisure", "dog_park", "escape_game", "garden", "golf_course", "ice_rink", "hackerspace", "marina",
|
||||
"miniature_golf", "park", "pitch", "playground", "sports_centre", "stadium", "swimming_area", "swimming_pool",
|
||||
"water_park"), matchAny("railway", "halt", "station", "subway_entrance", "train_station_entrance", "tram_stop"),
|
||||
"water_park"), matchAny("office", "diplomatic"),
|
||||
matchAny("railway", "halt", "station", "subway_entrance", "train_station_entrance", "tram_stop"),
|
||||
matchAny("shop", "accessories", "alcohol", "antiques", "art", "bag", "bakery", "beauty", "bed", "beverages",
|
||||
"bicycle", "books", "boutique", "butcher", "camera", "car", "car_repair", "car_parts", "carpet", "charity",
|
||||
"chemist", "chocolate", "clothes", "coffee", "computer", "confectionery", "convenience", "copyshop",
|
||||
"cosmetics", "deli", "delicatessen", "department_store", "doityourself", "dry_cleaning", "electronics",
|
||||
"erotic", "fabric", "florist", "frozen_food", "furniture", "garden_centre", "general", "gift", "greengrocer",
|
||||
"hairdresser", "hardware", "hearing_aids", "hifi", "ice_cream", "interior_decoration", "jewelry", "kiosk",
|
||||
"lamps", "laundry", "mall", "massage", "mobile_phone", "motorcycle", "music", "musical_instrument", "newsagent",
|
||||
"optician", "outdoor", "perfume", "perfumery", "pet", "photo", "second_hand", "shoes", "sports", "stationery",
|
||||
"supermarket", "tailor", "tattoo", "ticket", "tobacco", "toys", "travel_agency", "video", "video_games",
|
||||
"watches", "weapons", "wholesale", "wine"),
|
||||
"lamps", "laundry", "locksmith", "mall", "massage", "mobile_phone", "motorcycle", "music", "musical_instrument",
|
||||
"newsagent", "optician", "outdoor", "perfume", "perfumery", "pet", "photo", "second_hand", "shoes", "sports",
|
||||
"stationery", "supermarket", "tailor", "tattoo", "ticket", "tobacco", "toys", "travel_agency", "video",
|
||||
"video_games", "watches", "weapons", "wholesale", "wine"),
|
||||
matchAny("sport", "american_football", "archery", "athletics", "australian_football", "badminton", "baseball",
|
||||
"basketball", "beachvolleyball", "billiards", "bmx", "boules", "bowls", "boxing", "canadian_football", "canoe",
|
||||
"chess", "climbing", "climbing_adventure", "cricket", "cricket_nets", "croquet", "curling", "cycling",
|
||||
@@ -865,7 +924,7 @@ public class Tables {
|
||||
}
|
||||
|
||||
/** An OSM element that would appear in the {@code osm_aerodrome_label_point} table generated by imposm3. */
|
||||
public static record OsmAerodromeLabelPoint(
|
||||
public record OsmAerodromeLabelPoint(
|
||||
@Override String name, @Override String nameEn, @Override String nameDe, @Override String aerodromeType,
|
||||
@Override String aerodrome, @Override String military, @Override String iata, @Override String icao,
|
||||
@Override String ele, @Override SourceFeature source
|
||||
@@ -892,6 +951,12 @@ public class Tables {
|
||||
}
|
||||
}
|
||||
|
||||
/** Rows with a String access attribute. */
|
||||
public interface WithAccess {
|
||||
|
||||
String access();
|
||||
}
|
||||
|
||||
/** Rows with a long adminLevel attribute. */
|
||||
public interface WithAdminLevel {
|
||||
|
||||
@@ -1006,18 +1071,18 @@ public class Tables {
|
||||
String countryCodeIso31661Alpha2();
|
||||
}
|
||||
|
||||
/** Rows with a String disputedBy attribute. */
|
||||
public interface WithDisputedBy {
|
||||
|
||||
String disputedBy();
|
||||
}
|
||||
|
||||
/** Rows with a String ele attribute. */
|
||||
public interface WithEle {
|
||||
|
||||
String ele();
|
||||
}
|
||||
|
||||
/** Rows with a boolean expressway attribute. */
|
||||
public interface WithExpressway {
|
||||
|
||||
boolean expressway();
|
||||
}
|
||||
|
||||
/** Rows with a String foot attribute. */
|
||||
public interface WithFoot {
|
||||
|
||||
@@ -1246,6 +1311,12 @@ public class Tables {
|
||||
String network();
|
||||
}
|
||||
|
||||
/** Rows with a String osmcSymbol attribute. */
|
||||
public interface WithOsmcSymbol {
|
||||
|
||||
String osmcSymbol();
|
||||
}
|
||||
|
||||
/** Rows with a String place attribute. */
|
||||
public interface WithPlace {
|
||||
|
||||
@@ -1342,6 +1413,12 @@ public class Tables {
|
||||
String relminLevel();
|
||||
}
|
||||
|
||||
/** Rows with a String sacScale attribute. */
|
||||
public interface WithSacScale {
|
||||
|
||||
String sacScale();
|
||||
}
|
||||
|
||||
/** Rows with a String service attribute. */
|
||||
public interface WithService {
|
||||
|
||||
@@ -1390,6 +1467,12 @@ public class Tables {
|
||||
String surface();
|
||||
}
|
||||
|
||||
/** Rows with a boolean toll attribute. */
|
||||
public interface WithToll {
|
||||
|
||||
boolean toll();
|
||||
}
|
||||
|
||||
/** Rows with a String tourism attribute. */
|
||||
public interface WithTourism {
|
||||
|
||||
@@ -1408,6 +1491,12 @@ public class Tables {
|
||||
String usage();
|
||||
}
|
||||
|
||||
/** Rows with a String water attribute. */
|
||||
public interface WithWater {
|
||||
|
||||
String water();
|
||||
}
|
||||
|
||||
/** Rows with a String waterway attribute. */
|
||||
public interface WithWaterway {
|
||||
|
||||
@@ -1437,6 +1526,8 @@ public class Tables {
|
||||
MultiExpression.entry(new RowClassAndConstructor(OsmLandusePolygon.class, OsmLandusePolygon::new),
|
||||
OsmLandusePolygon.MAPPING),
|
||||
MultiExpression.entry(new RowClassAndConstructor(OsmPeakPoint.class, OsmPeakPoint::new), OsmPeakPoint.MAPPING),
|
||||
MultiExpression.entry(new RowClassAndConstructor(OsmMountainLinestring.class, OsmMountainLinestring::new),
|
||||
OsmMountainLinestring.MAPPING),
|
||||
MultiExpression.entry(new RowClassAndConstructor(OsmParkPolygon.class, OsmParkPolygon::new),
|
||||
OsmParkPolygon.MAPPING),
|
||||
MultiExpression.entry(new RowClassAndConstructor(OsmAerowayPolygon.class, OsmAerowayPolygon::new),
|
||||
@@ -1455,6 +1546,8 @@ public class Tables {
|
||||
OsmShipwayLinestring.MAPPING),
|
||||
MultiExpression.entry(new RowClassAndConstructor(OsmHighwayPolygon.class, OsmHighwayPolygon::new),
|
||||
OsmHighwayPolygon.MAPPING),
|
||||
MultiExpression.entry(new RowClassAndConstructor(OsmHighwayPoint.class, OsmHighwayPoint::new),
|
||||
OsmHighwayPoint.MAPPING),
|
||||
MultiExpression.entry(new RowClassAndConstructor(OsmBuildingPolygon.class, OsmBuildingPolygon::new),
|
||||
OsmBuildingPolygon.MAPPING),
|
||||
MultiExpression.entry(new RowClassAndConstructor(OsmMarinePoint.class, OsmMarinePoint::new),
|
||||
@@ -1504,6 +1597,10 @@ public class Tables {
|
||||
result.computeIfAbsent(OsmPeakPoint.class, cls -> new ArrayList<>())
|
||||
.add(new RowHandlerAndClass<>(typedHandler.getClass(), typedHandler::process));
|
||||
}
|
||||
if (handler instanceof OsmMountainLinestring.Handler typedHandler) {
|
||||
result.computeIfAbsent(OsmMountainLinestring.class, cls -> new ArrayList<>())
|
||||
.add(new RowHandlerAndClass<>(typedHandler.getClass(), typedHandler::process));
|
||||
}
|
||||
if (handler instanceof OsmParkPolygon.Handler typedHandler) {
|
||||
result.computeIfAbsent(OsmParkPolygon.class, cls -> new ArrayList<>())
|
||||
.add(new RowHandlerAndClass<>(typedHandler.getClass(), typedHandler::process));
|
||||
@@ -1540,6 +1637,10 @@ public class Tables {
|
||||
result.computeIfAbsent(OsmHighwayPolygon.class, cls -> new ArrayList<>())
|
||||
.add(new RowHandlerAndClass<>(typedHandler.getClass(), typedHandler::process));
|
||||
}
|
||||
if (handler instanceof OsmHighwayPoint.Handler typedHandler) {
|
||||
result.computeIfAbsent(OsmHighwayPoint.class, cls -> new ArrayList<>())
|
||||
.add(new RowHandlerAndClass<>(typedHandler.getClass(), typedHandler::process));
|
||||
}
|
||||
if (handler instanceof OsmBuildingPolygon.Handler typedHandler) {
|
||||
result.computeIfAbsent(OsmBuildingPolygon.class, cls -> new ArrayList<>())
|
||||
.add(new RowHandlerAndClass<>(typedHandler.getClass(), typedHandler::process));
|
||||
|
||||
Reference in New Issue
Block a user