Files
planetiler-openmaptiles/src/main/java/org/openmaptiles/generated/Tables.java
Peter Hanecak f17cffe57e OpenMapTiles 3.15.0 SNAPSHOT (3) (#160)
* clean-up: mvn spotless:apply

* Long ferries (as per OMT PR 1486)

* regenerate-openmaptiles.sh b3d67ed5b327c9059aeea0b3304772c6b4c8c7e9  (to match content of OMT PR 1489)

* Add aboriginal lands (as per OMT PR 1489)

* handle duplicate route relations (to match OMT PR 1501)

* regenerate-openmaptiles.sh master, to match several OMT PRs which adjusted only YML

* URLs in comments adjusted to match OMT PR 1560

* Convert separated addresses to dashed addresses

* add brunnel (and layer) attributes only for certain zoomlevels, depending on feature size (matching OMT PR 1579)

* unit test testInterstateMotorway(): brunnel tag for test line no longer available at Z8

* unit test testInterstateMotorway() clean-up: Z13 was tested twice

* minor clean-up: fixed unit test naming

* partial fix for differences in transportation_name layer

The difference is between OpenMapTiles/master (OMT) and
planetiler-openmaptiles/omt_3_15_0 (PT-OMT) (e.g. development versions).

The point is, that while PT-OMT was using limit of "8km" for Z9-Z11, OMT
is using limit "ST_Length(geometry) > 8000 / POWER(2, zoom_level - 9)
AND zoom_level BETWEEN 9 AND 11".

Some further differences still visible, hence further commits expected.

* further adjustments to better match what is done with ferries in OMT

... (as per OMT PR 1486)

But FERRY_MIN_PIXEL_SIZE is "too much" in the contexct of Planetiler,
since it is applied within tiles, hence causes gaps in lines if a line
"strikes a little" certain tile. Hence we will need to divert a little.

* ferry minLength tweak + clean-up

* mvn spotless:apply

* fixed minor typo

* minor reformatting

* ferry line length filter replaced with min. zoom calculation

hence the results are much closer to what OMT is doing for Z4-Z9

* testFerry() adjusted to match previous commit

ferry test polygon with area 1 now qualifies for min. zoom 5

* clea-up of unused stuff + mvn spotless:apply

* mvn spotless:apply

* added TODO node for follow-up pull-request/simplification

* clean-up: common getMinZoom() code moved to Utils

* minzoom clipping for brunnel was adjusted do Z9-Z12 -> test adjusted too

* clean-up

* use same tolerance for all transportation items, like OSM does

* clean-up, since ferry and non-ferry procesing is now same

* we need regenerate to work with master branch for now

* first sub-class search for agg_stop simplified a little

* contains() used instead of indexOf() for better readability

* numbers as list, not array, so that getFirst() and getLast() can be used

* better trimming and filtring of housenumbers

* adjusted handling of large house numbers

* several unit tests collapsed to one with @ParameterizedTest + @CsvSource

* AGG_STOP_SUBCLASS_ORDER simplified from Map to List

* fixed major omission from previous commit

* clamp() used to replace min()&max() combo

* agg_stop now implemented

* fixed typo in the error message

* prepare IE and GB boundary geometry outside of synchronized{}

* fixed typo in the error message

* mvn spotless:apply

* switch statements for IE and GB route networks simplified

* avoid RouteNetwork->String mapping, not needed for anyMatch()

* fix: attr. brunnel optional based on size on Z4-Z11, attr. layer optional between Z9-Z11

* tolerance change in transportation reverted, added note to README as per why

* fix: monzoom for sea&co. is Z0-Z14 based on area, for the rest it is Z3-Z14 again based on area

* clean-up: avoid doing area->side->area, do just area

* regenerate-openmaptiles.sh 6c31841f4674f15e15afde346a060cf7c22e6cdd (to match content of OMT PR 1591)

* relevant process() functions adjusted to match changes in transportation/mapping.yaml

* regenerate-openmaptiles.sh master, instead of 6c31841f4674f15e15afde346a060cf7c22e6cdd (to match content of OMT PR 1591, in a cleaner way)

* introduce duplicate housenumber filtering (matching OMT PR 1391)

* (less related) clean-up: use isEmpty() instead if size check

* testContainsHousenumber UT adjusted, since duplicate housenumber filtering is reducing amount of house numbers

* use combination of uic_ref, name, network and operator as key for agg_stop sets

If we rely on only on `uic_ref` we group together also stations which are
too far apart (even different cities). With this combo results seem OK,
e.g. all grouped stations are within around 950m (1000 pixels at Z14) of
each other (1000 being used in `PARTITION BY LabelGrid(...` in
`layers/poi/poi.sql` in OpenMapTiles).

* agg_stop comparison made more explicit, since we want to match same exact one

* mvn spotless:apply

* name now important for agg_stop processing, hence name:es (ab)used for unit tests

* agg_stop: simplified processing of nearest station

Results still same, only ordering is different:
- previously: agg_stop=1 first
- now: FIFO

* agg_stop: forther code simplification

* fixed major typo introduced in previous merge

* setMinPixelSize() + setMinZoom() used instead of areaToMinZoom()

* clean-up: unused stuff removed

* mvn spotless:apply

* setAttrWithMinSize() used instead of getBrunnelMinzoom()

getFerryMinzoom() kept since we'd like to replicate `sql_filter: ST_Length(...` from OMT

* getMinZoomForLength() no longer used, hence removed

* MIN_LENGTH value halved, to partially counter the effect of Planetiler applying the limit before merging

* clean-up: LOG2 not used, hence removed

* Revert "MIN_LENGTH value halved, to partially counter the effect of Planetiler applying the limit before merging"

This reverts commit 8fb67075289f3028d31761dcc9564fc597adab36.

* use 256px as buffer pixel override instead of MIN_LENGTH

Make sure we have enough room (=whole next tile) when checking MIN_LENGTH,
to avoid pieces of otherwise "long enough" lines to be excluded (thus
creating "holes" or missing ends) in some tiles just because length in that
particular tile is bellow limit. Given that MIN_LENGTH values translated to
pixels are quite big (compared to {@code BUFFER_SIZE}), such missing pieces
would be quite noticeable.

This improves items mainly in Z12-Z13.

* added BY_TEMP_HAS_NAME comparator to avoid its repeated construction during run-time

* duplicate houcenumber processing simplified further

* clean-up: get(0) replaced with getFirst()

* clean-up: CPU-intensive prepare() moved out of synchronized block

* regenerate-openmaptiles.sh 3cf77e2a542d8a369bb08bf2538cdde0b3effb2b (to match content of OMT PR 1423)

* unit test adjusted for POI office class changes

* regenerate-openmaptiles.sh master (to match content of OMT PR 1544)

* added charging_station implementation matching OMT PR 1544

* use setMinPixelSizeBelowZoom() instead of uniAreaToMinZoom()

* use setMinPixelSizeBelowZoom() instead of getFerryMinzoom()

* fixed unit test, to match recent tweaks

* regenerate-openmaptiles.sh master (to match content of OMT PR 1605)

* Fix university office/amenity collision (to match OSM PR 1607)

* Remove expressway from ramps

* OsmMarinePoint+ne_10m_geography_marine_polys join via name limited to 50km distance

* regenerate-openmaptiles.sh master (to match content of OMT PR 1604)

* Revert "Add aboriginal lands (as per OMT PR 1489)"

This reverts commit 899a0c5718734d5a746cdd84df2e1308614954c0.

* added handling of aboriginal_lands/OsmBoundaryPolygon into Boundary and Place layers

* big islands can now get rank lower than 3

* Add e-road and a-road for transportation z4

* testPolishHighwayIssue165() adjusted: e-road now takes precendence

* regenerate-openmaptiles.sh master (to match content of OMT PR 1627)

* regenerate-openmaptiles.sh fff7110aeb61882abfafe22d1618fbe6181d96cb (to match content of OMT PR 1620)

* Expanded road route attributes (to match OMT PR 1620)

* unrelated clean-up: use getFirst()

* adjusted handling or null and empty ref

* regenerate-openmaptiles.sh master (to match content of OMT PR 1620)

* pointOnSurface() used instead of centroid() to make sure the point is within the boundary

* adjusted deduplication of route_<n>_<something> attributes

* clean-up of some previous adjustments of importantMarinePoints

* clean-up: removed unused imports

* mvn spotless:apply

* OsmWaterPolygon minzoom calculation reverted to v3.14 and then adjusted for new 1/4 threshold

* part of process(Tables.OsmWaterPolygon, ...) moved to setupOsmWaterPolygonFeature()

* if feature with centerline has minzoom bellow Z9, use also a label point between minzoom and Z8

* bay point vs. centerline difference mentioned in the README

* testWaterNameBay for small bay adjusted, testWaterNameBay for big bay added

* testWaterNameLakeline and testWaterNameMultipleLakelines tweaked to use smaller test areas

* mvn spotless:apply

* added unit test which checks minzoom for admin_level=2 disputed border (derived from way)

* fixed missing admin_level=2 disputed borders at Z3

* landuse fix for Z5: include all features from ne_50m_urban_areas

* minDist and buffer tweaked for residential areas for Z6-Z8 to better match OpenMapTiles

* landuse fix for Z5: unit test updated

* bumped copyright statements

* added/adjusted acknowledgments

* fixed handling of Baikonur border in Kazachstan

* fixed handling of Baikonur border in Kazachstan (2)

* OSM boundaries only for Z5+, non-disputed for Z4+

* OSM boundaries only for Z5+, non-disputed for Z4+ - unit test adjusted

* OSM Lake IDs at low zooms

* testLakeZoomLevels(): NE lakes removed, checked now in testLakeNaturalEarth*()

* Use ne_10m_admin_0_boundary_lines_land_disputed to fix missing South Sudan boundary

* testNaturalEarthCountryBoundaries() extended to cover adjusted handling of ne_10m_admin_0_boundary_lines_land

* OSM lake area limit increased 2x to match smallest NE lake

* OSM lake area limit increased 2x even further to match smallest observed during Planet processing

* clean-up: SMALLEST_OSM_LAKE_AREA renamed to OSM_ID_MATCH_AREA_LIMIT to better match what it is

* mvn spotless:apply

* properly handle center line vs. point also for lakes

* clean-up: min() dropped since nothing sets minzoomCL to value higher than MINZOOM_BAY

* Revert e-road and a-road.

* Revert e-road and a-road. (follow-up)

* added unit test to cover: More roads for z4.

* improved handling of disputed KE:SS border: will work even if left/right reversed

* new PolygonIndex.getIntersecting() used for OSM lake ID matching + increased unit test coverage

* neLakeIndexes simplified into neLakeIndex

* test several NE lakes also in testLakeNaturalEarthByName()

* clean-up: synchronized NOT needed for PolygonIndex.put()

* neLakeNameMaps will stay as is, otherwise same names from several NE tables will clash

* neAllLakeInfos stays, since neLakeNameMaps contains only some and hard(er) to get all from neLakeIndex

* added test for NE lake ame collision: bigger one gets to be matched

* simplified NE->OSM lake matching: ignore small OSM lakes right away

* minor speed-up: compare intersection area instead of intersction area ratio

* fixed minor typo

* minor clean-up

* minor clean-up after previous changes

* adjusted handling of TopologyException to match previous tweaks

* mvn spotless:apply

* tweaked error message, to better mach cases when TopologyException occurs

* adjusted trunks: Z6+ by default, some from Z5, some even from Z4

* adjusted motorways: only some at Z4

* adjusted transportation: clip also construction links to Z9+

* unit tests adjusted to the recent changes

* use merge() to avoid problems with concurrent updates

* synchronized mergeId() added to avoid problems with concurrent updates

* clean-up after cc797f9a

* mvn spotless:apply

* label point in water_name refactored using setMinPixelSizeBelowZoom()

* clean-up: LOG2 removed since no longer used

* refactored handling of TopologyException for easier troubleshooting of problematic polygons

* fix invalid NE lake geometries + further TopologyException handling tweaks

* TopologyException handling removed, since no longer needed after adding NE geometry fixing

* clean-up after previous changes

* OpenMapTiles 3.15 was released so we can use proper tag now

* regenerate-openmaptiles.sh v3.15 to match official OpenMapTiles release

* Revert "clean-up after previous changes"

This reverts commit ee70382150a18acd738c6495da533240d2b18b3a.

* Revert "TopologyException handling removed, since no longer needed after adding NE geometry fixing"

This reverts commit d4fe59c0e5311e5475a057b9feb7c322bff56027.

* minor clean-up

* handle TopologyException also from intersects()

* further tweaks for TopologyException handling

* warnings demoted to debugs since we're going to re-try

* bumped copyright statements

* bumped copyright statements

* print errors+stack-traces only after retries with fixed polygons

since we are not able to raise issues with JTS if we do stuff with
invalid/unfixed polygons

* message about fixing NE lake geometry demoted: warn -> debug

* omt_water message adjusted to make it more clear what it relates to

* do NOT store fixed geom in separate variable to avoid 2nd fixing in fillOsmIdIntoNeLake()

* one more error message rephrased for clearer context

* Revert "print errors+stack-traces only after retries with fixed polygons"

This reverts commit 7440973169a6bb87f276bdf415edcdb0a3922c3c.

* strip stack-trace from TopologyException debug messages

* fix OSM element geometry if not valid before trying to match NE lake

This is same trick as done for NE lakes before.

Thanks to that we then do not need to handle TopologyExceptions and do
retries.

* clean-up

* clean-up: mvn spotless:apply
2024-05-03 12:10:00 +02:00

1516 lines
76 KiB
Java

/*
Copyright (c) 2024, MapTiler.com & OpenMapTiles contributors.
All rights reserved.
Code license: BSD 3-Clause License
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Design license: CC-BY 4.0
See https://github.com/openmaptiles/openmaptiles/blob/master/LICENSE.md for details on usage
*/
// AUTOGENERATED BY Generate.java -- DO NOT MODIFY
package org.openmaptiles.generated;
import static com.onthegomap.planetiler.expression.Expression.*;
import com.onthegomap.planetiler.FeatureCollector;
import com.onthegomap.planetiler.expression.Expression;
import com.onthegomap.planetiler.expression.MultiExpression;
import com.onthegomap.planetiler.reader.SourceFeature;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
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.15/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
* in the tables that imposm3 would generate. Layer implementations can "subscribe" to elements from each "table" but
* implementing the table's {@code Handler} interface and use the element's typed API to access attributes.
*/
@SuppressWarnings("unused")
public class Tables {
/** A parsed OSM element that would appear in a "row" of the imposm3 table. */
public interface Row {
/** Returns the original OSM element. */
SourceFeature source();
}
/** A functional interface that the constructor of a new table row can be coerced to. */
@FunctionalInterface
public interface Constructor {
Row create(SourceFeature source, String mappingKey);
}
/** The {@code rowClass} of an imposm3 table row and its constructor coerced to a {@link Constructor}. */
public record RowClassAndConstructor(
Class<? extends Row> rowClass,
Constructor create
) {}
/** A functional interface that the typed handler method that a layer implementation can be coerced to. */
@FunctionalInterface
public interface RowHandler<T extends Row> {
/** Process a typed element according to the profile. */
void process(T element, FeatureCollector features);
}
/** The {@code handlerClass} of a layer handler and it's {@code process} method coerced to a {@link RowHandler}. */
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 record OsmWaterPolygon(@Override String name, @Override String nameEn, @Override String nameDe,
@Override String place, @Override String natural, @Override String landuse, @Override String waterway,
@Override String leisure, @Override String water, @Override boolean isIntermittent, @Override boolean isTunnel,
@Override boolean isBridge, @Override SourceFeature source)
implements Row, WithName, WithNameEn, WithNameDe, WithPlace, WithNatural, WithLanduse, WithWaterway, WithLeisure,
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("place"), source.getString("natural"), source.getString("landuse"),
source.getString("waterway"), source.getString("leisure"), 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", "spring"), matchAny("waterway", "dock"),
matchAny("water", "river", "stream", "canal", "ditch", "drain", "pond", "basin", "wastewater")),
not(matchAny("covered", "yes")), matchType("polygon"));
/**
* Interface for layer implementations to extend to subscribe to OSM elements filtered and parsed as
* {@link OsmWaterPolygon}.
*/
public interface Handler {
void process(OsmWaterPolygon element, FeatureCollector features);
}
}
/** An OSM element that would appear in the {@code osm_waterway_linestring} table generated by imposm3. */
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) implements Row, WithWaterway, WithName, WithNameEn, WithNameDe, WithIsTunnel,
WithIsBridge, WithIsIntermittent, WithSource {
public OsmWaterwayLinestring(SourceFeature source, String mappingKey) {
this(source.getString("waterway"), source.getString("name"), source.getString("name:en"),
source.getString("name:de"), source.getBoolean("tunnel"), source.getBoolean("bridge"),
source.getBoolean("intermittent"), source);
}
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
public static final Expression MAPPING =
and(matchAny("waterway", "stream", "river", "canal", "drain", "ditch"), matchType("linestring"));
/**
* Interface for layer implementations to extend to subscribe to OSM elements filtered and parsed as
* {@link OsmWaterwayLinestring}.
*/
public interface Handler {
void process(OsmWaterwayLinestring element, FeatureCollector features);
}
}
/** An OSM element that would appear in the {@code osm_landcover_polygon} table generated by imposm3. */
public record OsmLandcoverPolygon(@Override String subclass, @Override String mappingKey,
@Override SourceFeature source) implements Row, WithSubclass, WithMappingKey, WithSource {
public OsmLandcoverPolygon(SourceFeature source, String mappingKey) {
this(source.getString(mappingKey), mappingKey, source);
}
/** 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"),
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"));
/**
* Interface for layer implementations to extend to subscribe to OSM elements filtered and parsed as
* {@link OsmLandcoverPolygon}.
*/
public interface Handler {
void process(OsmLandcoverPolygon element, FeatureCollector features);
}
}
/** An OSM element that would appear in the {@code osm_landuse_polygon} table generated by imposm3. */
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 {
public OsmLandusePolygon(SourceFeature source, String mappingKey) {
this(source.getString("landuse"), source.getString("amenity"), source.getString("leisure"),
source.getString("tourism"), source.getString("place"), source.getString("waterway"), source);
}
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
public static final Expression MAPPING = and(or(
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"),
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 OsmLandusePolygon}.
*/
public interface Handler {
void process(OsmLandusePolygon element, FeatureCollector features);
}
}
/** An OSM element that would appear in the {@code osm_peak_point} table generated by imposm3. */
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 {
public OsmPeakPoint(SourceFeature source, String mappingKey) {
this(source.getString("name"), source.getString("name:en"), source.getString("name:de"), source.getString("ele"),
source.getString("wikipedia"), source);
}
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
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 OsmPeakPoint}.
*/
public interface Handler {
void process(OsmPeakPoint element, FeatureCollector features);
}
}
/** 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 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) implements Row, WithName, WithNameEn, WithNameDe, WithLanduse, WithLeisure,
WithBoundary, WithProtectionTitle, WithSource {
public OsmParkPolygon(SourceFeature source, String mappingKey) {
this(source.getString("name"), source.getString("name:en"), source.getString("name:de"),
source.getString("landuse"), source.getString("leisure"), source.getString("boundary"),
source.getString("protection_title"), source);
}
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
public static final Expression MAPPING =
and(or(matchAny("leisure", "nature_reserve"), matchAny("boundary", "national_park", "protected_area")),
matchType("polygon"));
/**
* Interface for layer implementations to extend to subscribe to OSM elements filtered and parsed as
* {@link OsmParkPolygon}.
*/
public interface Handler {
void process(OsmParkPolygon element, FeatureCollector features);
}
}
/** An OSM element that would appear in the {@code osm_boundary_polygon} table generated by imposm3. */
public record OsmBoundaryPolygon(@Override String name, @Override String boundary, @Override SourceFeature source)
implements Row, WithName, WithBoundary, WithSource {
public OsmBoundaryPolygon(SourceFeature source, String mappingKey) {
this(source.getString("name"), source.getString("boundary"), source);
}
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
public static final Expression MAPPING =
and(matchAny("boundary", "aboriginal_lands"), matchAny("type", "boundary"), matchType("polygon"));
/**
* Interface for layer implementations to extend to subscribe to OSM elements filtered and parsed as
* {@link OsmBoundaryPolygon}.
*/
public interface Handler {
void process(OsmBoundaryPolygon element, FeatureCollector features);
}
}
/** An OSM element that would appear in the {@code osm_aeroway_polygon} table generated by imposm3. */
public record OsmAerowayPolygon(@Override String ref, @Override String aeroway, @Override SourceFeature source)
implements Row, WithRef, WithAeroway, WithSource {
public OsmAerowayPolygon(SourceFeature source, String mappingKey) {
this(source.getString("ref"), source.getString(mappingKey), source);
}
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
public static final Expression MAPPING = and(
or(matchAny("aeroway", "aerodrome", "heliport", "runway", "helipad", "taxiway", "apron"),
matchAny("area:aeroway", "aerodrome", "heliport", "runway", "helipad", "taxiway", "apron")),
matchType("polygon"));
/**
* Interface for layer implementations to extend to subscribe to OSM elements filtered and parsed as
* {@link OsmAerowayPolygon}.
*/
public interface Handler {
void process(OsmAerowayPolygon element, FeatureCollector features);
}
}
/** An OSM element that would appear in the {@code osm_aeroway_linestring} table generated by imposm3. */
public record OsmAerowayLinestring(@Override String ref, @Override String aeroway, @Override SourceFeature source)
implements Row, WithRef, WithAeroway, WithSource {
public OsmAerowayLinestring(SourceFeature source, String mappingKey) {
this(source.getString("ref"), source.getString("aeroway"), source);
}
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
public static final Expression MAPPING = and(matchAny("aeroway", "runway", "taxiway"), matchType("linestring"));
/**
* Interface for layer implementations to extend to subscribe to OSM elements filtered and parsed as
* {@link OsmAerowayLinestring}.
*/
public interface Handler {
void process(OsmAerowayLinestring element, FeatureCollector features);
}
}
/** An OSM element that would appear in the {@code osm_aeroway_point} table generated by imposm3. */
public record OsmAerowayPoint(@Override String ref, @Override String aeroway, @Override SourceFeature source)
implements Row, WithRef, WithAeroway, WithSource {
public OsmAerowayPoint(SourceFeature source, String mappingKey) {
this(source.getString("ref"), source.getString("aeroway"), source);
}
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
public static final Expression MAPPING = and(matchAny("aeroway", "gate"), matchType("point"));
/**
* Interface for layer implementations to extend to subscribe to OSM elements filtered and parsed as
* {@link OsmAerowayPoint}.
*/
public interface Handler {
void process(OsmAerowayPoint element, FeatureCollector features);
}
}
/** An OSM element that would appear in the {@code osm_highway_linestring} table generated by imposm3. */
public record OsmHighwayLinestring(@Override String highway, @Override String construction,
@Override String tracktype, @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 boolean isTunnel, @Override boolean isBridge,
@Override boolean isRamp, @Override boolean isFord, @Override int isOneway, @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, WithTracktype, WithRef, WithNetwork, WithZOrder, WithLayer,
WithLevel, WithIndoor, WithName, WithNameEn, WithNameDe, WithIsTunnel, WithIsBridge, WithIsRamp, WithIsFord,
WithIsOneway, 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("tracktype"),
source.getString("ref"), source.getString("network"), source.getWayZorder(), source.getLong("layer"),
source.getLong("level"), source.getBoolean("indoor"), source.getString("name"), source.getString("name:en"),
source.getString("name:de"), source.getBoolean("tunnel"), source.getBoolean("bridge"),
source.getBoolean("ramp"), source.getBoolean("ford"), source.getDirection("oneway"), source.getBoolean("area"),
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",
"busway", "bus_guideway", "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 OsmHighwayLinestring}.
*/
public interface Handler {
void process(OsmHighwayLinestring element, FeatureCollector features);
}
}
/** An OSM element that would appear in the {@code osm_railway_linestring} table generated by imposm3. */
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 boolean isTunnel, @Override boolean isBridge,
@Override boolean isRamp, @Override boolean isFord, @Override boolean isArea, @Override String service,
@Override String usage, @Override SourceFeature source) implements Row, WithRailway, WithRef, WithNetwork,
WithZOrder, WithLayer, WithLevel, WithIndoor, WithName, WithNameEn, WithNameDe, WithIsTunnel, WithIsBridge,
WithIsRamp, WithIsFord, WithIsArea, WithService, WithUsage, WithSource {
public OsmRailwayLinestring(SourceFeature source, String mappingKey) {
this(source.getString("railway"), source.getString("ref"), source.getString("network"), source.getWayZorder(),
source.getLong("layer"), source.getLong("level"), source.getBoolean("indoor"), source.getString("name"),
source.getString("name:en"), source.getString("name:de"), source.getBoolean("tunnel"),
source.getBoolean("bridge"), source.getBoolean("ramp"), source.getBoolean("ford"), source.getBoolean("area"),
source.getString("service"), source.getString("usage"), source);
}
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
public static final Expression MAPPING = and(
matchAny("railway", "rail", "narrow_gauge", "preserved", "funicular", "subway", "light_rail", "monorail", "tram"),
matchType("linestring"));
/**
* Interface for layer implementations to extend to subscribe to OSM elements filtered and parsed as
* {@link OsmRailwayLinestring}.
*/
public interface Handler {
void process(OsmRailwayLinestring element, FeatureCollector features);
}
}
/** An OSM element that would appear in the {@code osm_aerialway_linestring} table generated by imposm3. */
public record OsmAerialwayLinestring(@Override String aerialway, @Override int zOrder, @Override long layer,
@Override String name, @Override String nameEn, @Override String nameDe, @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 SourceFeature source)
implements Row, WithAerialway, WithZOrder, WithLayer, WithName, WithNameEn, WithNameDe, WithIsTunnel, WithIsBridge,
WithIsRamp, WithIsFord, WithIsOneway, WithIsArea, WithService, WithUsage, WithSource {
public OsmAerialwayLinestring(SourceFeature source, String mappingKey) {
this(source.getString("aerialway"), source.getWayZorder(), source.getLong("layer"), source.getString("name"),
source.getString("name:en"), source.getString("name:de"), 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);
}
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
public static final Expression MAPPING = and(matchAny("aerialway", "chair_lift", "drag_lift", "platter", "t-bar",
"gondola", "cable_car", "j-bar", "mixed_lift"), matchType("linestring"));
/**
* Interface for layer implementations to extend to subscribe to OSM elements filtered and parsed as
* {@link OsmAerialwayLinestring}.
*/
public interface Handler {
void process(OsmAerialwayLinestring element, FeatureCollector features);
}
}
/** An OSM element that would appear in the {@code osm_shipway_linestring} table generated by imposm3. */
public record OsmShipwayLinestring(@Override String shipway, @Override int zOrder, @Override long layer,
@Override String name, @Override String nameEn, @Override String nameDe, @Override boolean isTunnel,
@Override boolean isBridge, @Override boolean isRamp, @Override boolean isFord, @Override boolean isArea,
@Override String service, @Override String usage, @Override SourceFeature source)
implements Row, WithShipway, WithZOrder, WithLayer, WithName, WithNameEn, WithNameDe, WithIsTunnel, WithIsBridge,
WithIsRamp, WithIsFord, WithIsArea, WithService, WithUsage, WithSource {
public OsmShipwayLinestring(SourceFeature source, String mappingKey) {
this(source.getString("route"), source.getWayZorder(), source.getLong("layer"), source.getString("name"),
source.getString("name:en"), source.getString("name:de"), source.getBoolean("tunnel"),
source.getBoolean("bridge"), source.getBoolean("ramp"), source.getBoolean("ford"), source.getBoolean("area"),
source.getString("service"), source.getString("usage"), source);
}
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
public static final Expression MAPPING = and(matchAny("route", "ferry"), matchType("linestring"));
/**
* Interface for layer implementations to extend to subscribe to OSM elements filtered and parsed as
* {@link OsmShipwayLinestring}.
*/
public interface Handler {
void process(OsmShipwayLinestring element, FeatureCollector features);
}
}
/** An OSM element that would appear in the {@code osm_highway_polygon} table generated by imposm3. */
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 String service, @Override SourceFeature source)
implements Row, WithHighway, WithZOrder, WithLayer, WithLevel, WithIndoor, WithIsArea, WithPublicTransport,
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.getString("service"), source);
}
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
public static final Expression MAPPING =
and(or(matchAny("highway", "path", "cycleway", "bridleway", "footway", "corridor", "pedestrian", "steps"),
matchAny("public_transport", "platform"), matchAny("man_made", "bridge", "pier")), matchType("polygon"));
/**
* Interface for layer implementations to extend to subscribe to OSM elements filtered and parsed as
* {@link OsmHighwayPolygon}.
*/
public interface Handler {
void process(OsmHighwayPolygon element, FeatureCollector features);
}
}
/** 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 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, @Override String minLevel, @Override SourceFeature source)
implements Row, WithMaterial, WithColour, WithBuilding, WithBuildingpart, WithBuildingheight, WithBuildingminHeight,
WithBuildinglevels, WithBuildingminLevel, WithHeight, WithMinHeight, WithLevels, WithMinLevel, WithSource {
public OsmBuildingPolygon(SourceFeature source, String mappingKey) {
this(source.getString("building:material"), source.getString("building:colour"), source.getString("building"),
source.getString("building:part"), source.getString("building:height"), source.getString("building:min_height"),
source.getString("building:levels"), source.getString("building:min_level"), source.getString("height"),
source.getString("min_height"), source.getString("levels"), source.getString("min_level"), source);
}
/** 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"),
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 OsmBuildingPolygon}.
*/
public interface Handler {
void process(OsmBuildingPolygon element, FeatureCollector features);
}
}
/** An OSM element that would appear in the {@code osm_marine_point} table generated by imposm3. */
public record OsmMarinePoint(@Override String name, @Override String nameEn, @Override String nameDe,
@Override String place, @Override String natural, @Override long rank, @Override boolean isIntermittent,
@Override SourceFeature source)
implements Row, WithName, WithNameEn, WithNameDe, WithPlace, WithNatural, WithRank, WithIsIntermittent, WithSource {
public OsmMarinePoint(SourceFeature source, String mappingKey) {
this(source.getString("name"), source.getString("name:en"), source.getString("name:de"),
source.getString("place"), source.getString("natural"), source.getLong("rank"),
source.getBoolean("intermittent"), source);
}
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
public static final Expression MAPPING =
and(or(matchAny("place", "ocean", "sea"), matchAny("natural", "bay", "strait")), matchField("name"),
matchType("point"));
/**
* Interface for layer implementations to extend to subscribe to OSM elements filtered and parsed as
* {@link OsmMarinePoint}.
*/
public interface Handler {
void process(OsmMarinePoint element, FeatureCollector features);
}
}
/** An OSM element that would appear in the {@code osm_continent_point} table generated by imposm3. */
public record OsmContinentPoint(@Override String name, @Override String nameEn, @Override String nameDe,
@Override SourceFeature source) implements Row, WithName, WithNameEn, WithNameDe, WithSource {
public OsmContinentPoint(SourceFeature source, String mappingKey) {
this(source.getString("name"), source.getString("name:en"), source.getString("name:de"), source);
}
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
public static final Expression MAPPING =
and(matchAny("place", "continent"), matchField("name"), matchType("point"));
/**
* Interface for layer implementations to extend to subscribe to OSM elements filtered and parsed as
* {@link OsmContinentPoint}.
*/
public interface Handler {
void process(OsmContinentPoint element, FeatureCollector features);
}
}
/** An OSM element that would appear in the {@code osm_country_point} table generated by imposm3. */
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) implements Row, WithName, WithNameEn, WithNameDe,
WithRank, WithCountryCodeIso31661Alpha2, WithIso31661Alpha2, WithIso31661, WithSource {
public OsmCountryPoint(SourceFeature source, String mappingKey) {
this(source.getString("name"), source.getString("name:en"), source.getString("name:de"), source.getLong("rank"),
source.getString("country_code_iso3166_1_alpha_2"), source.getString("ISO3166-1:alpha2"),
source.getString("ISO3166-1"), source);
}
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
public static final Expression MAPPING = and(matchAny("place", "country"), matchField("name"), matchType("point"));
/**
* Interface for layer implementations to extend to subscribe to OSM elements filtered and parsed as
* {@link OsmCountryPoint}.
*/
public interface Handler {
void process(OsmCountryPoint element, FeatureCollector features);
}
}
/** An OSM element that would appear in the {@code osm_island_polygon} table generated by imposm3. */
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 {
public OsmIslandPolygon(SourceFeature source, String mappingKey) {
this(source.getString("name"), source.getString("name:en"), source.getString("name:de"), source.getLong("rank"),
source);
}
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
public static final Expression MAPPING = and(matchAny("place", "island"), matchField("name"), matchType("polygon"));
/**
* Interface for layer implementations to extend to subscribe to OSM elements filtered and parsed as
* {@link OsmIslandPolygon}.
*/
public interface Handler {
void process(OsmIslandPolygon element, FeatureCollector features);
}
}
/** An OSM element that would appear in the {@code osm_island_point} table generated by imposm3. */
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 {
public OsmIslandPoint(SourceFeature source, String mappingKey) {
this(source.getString("name"), source.getString("name:en"), source.getString("name:de"), source.getLong("rank"),
source);
}
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
public static final Expression MAPPING = and(matchAny("place", "island"), matchField("name"), matchType("point"));
/**
* Interface for layer implementations to extend to subscribe to OSM elements filtered and parsed as
* {@link OsmIslandPoint}.
*/
public interface Handler {
void process(OsmIslandPoint element, FeatureCollector features);
}
}
/** An OSM element that would appear in the {@code osm_state_point} table generated by imposm3. */
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("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", "province"), matchField("name"), matchType("point"));
/**
* Interface for layer implementations to extend to subscribe to OSM elements filtered and parsed as
* {@link OsmStatePoint}.
*/
public interface Handler {
void process(OsmStatePoint element, FeatureCollector features);
}
}
/** An OSM element that would appear in the {@code osm_city_point} table generated by imposm3. */
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 {
public OsmCityPoint(SourceFeature source, String mappingKey) {
this(source.getString("name"), source.getString("name:en"), source.getString("name:de"),
source.getString("place"), source.getLong("population"), source.getString("capital"), source.getLong("rank"),
source);
}
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
public static final Expression MAPPING = and(matchAny("place", "city", "town", "village", "hamlet", "borough",
"suburb", "quarter", "neighbourhood", "isolated_dwelling"), matchField("name"), matchType("point"));
/**
* Interface for layer implementations to extend to subscribe to OSM elements filtered and parsed as
* {@link OsmCityPoint}.
*/
public interface Handler {
void process(OsmCityPoint element, FeatureCollector features);
}
}
/** An OSM element that would appear in the {@code osm_housenumber_point} table generated by imposm3. */
public record OsmHousenumberPoint(@Override String housenumber, @Override String street, @Override String blockNumber,
@Override String hasName, @Override SourceFeature source)
implements Row, WithHousenumber, WithStreet, WithBlockNumber, WithHasName, WithSource {
public OsmHousenumberPoint(SourceFeature source, String mappingKey) {
this(source.getString("addr:housenumber"), source.getString("addr:street"), source.getString("addr:block_number"),
source.getString("name"), source);
}
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
public static final Expression MAPPING = or(and(matchField("addr:housenumber"), matchType("point")),
and(matchField("addr:housenumber"), matchType("polygon")));
/**
* Interface for layer implementations to extend to subscribe to OSM elements filtered and parsed as
* {@link OsmHousenumberPoint}.
*/
public interface Handler {
void process(OsmHousenumberPoint element, FeatureCollector features);
}
}
/** 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 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("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". */
public static final Expression MAPPING = and(or(matchAny("aerialway", "station"),
matchAny("amenity", "arts_centre", "atm", "bank", "bar", "bbq", "bicycle_parking", "bicycle_rental", "biergarten",
"bus_station", "cafe", "charging_station", "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", "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"),
matchAny("building", "dormitory"), matchAny("highway", "bus_stop"),
matchAny("historic", "monument", "castle", "ruins"),
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("office", "accountant", "advertising_agency", "architect", "association", "bail_bond_agent", "charity",
"company", "construction_company", "consulting", "cooperative", "courier", "coworking", "diplomatic",
"educational_institution", "employment_agency", "energy_supplier", "engineer", "estate_agent", "financial",
"financial_advisor", "forestry", "foundation", "geodesist", "government", "graphic_design", "guide",
"harbour_master", "health_insurance", "insurance", "interior_design", "it", "lawyer", "logistics", "marketing",
"moving_company", "newspaper", "ngo", "notary", "physician", "political_party", "private_investigator",
"property_management", "publisher", "quango", "religion", "research", "security", "surveyor", "tax_advisor",
"taxi", "telecommunication", "therapist", "translator", "travel_agent", "tutoring", "union", "university",
"water_utility", "web_design", "wedding_planner"),
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", "locksmith", "mall", "massage", "mobile_phone", "motorcycle", "music", "musical_instrument",
"newsagent", "optician", "outdoor", "paint", "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",
"disc_golf", "diving", "dog_racing", "equestrian", "fatsal", "field_hockey", "free_flying", "gaelic_games",
"golf", "gymnastics", "handball", "hockey", "horse_racing", "horseshoes", "ice_hockey", "ice_stock", "judo",
"karting", "korfball", "long_jump", "model_aerodrome", "motocross", "motor", "multi", "netball", "orienteering",
"paddle_tennis", "paintball", "paragliding", "pelota", "racquet", "rc_car", "rowing", "rugby", "rugby_league",
"rugby_union", "running", "sailing", "scuba_diving", "shooting", "shooting_range", "skateboard", "skating",
"skiing", "soccer", "surfing", "swimming", "table_soccer", "table_tennis", "team_handball", "tennis",
"toboggan", "volleyball", "water_ski", "yoga"),
matchAny("tourism", "alpine_hut", "aquarium", "artwork", "attraction", "bed_and_breakfast", "camp_site",
"caravan_site", "chalet", "gallery", "guest_house", "hostel", "hotel", "information", "motel", "museum",
"picnic_site", "theme_park", "viewpoint", "zoo"),
matchAny("waterway", "dock")), matchType("point"));
/**
* Interface for layer implementations to extend to subscribe to OSM elements filtered and parsed as
* {@link OsmPoiPoint}.
*/
public interface Handler {
void process(OsmPoiPoint element, FeatureCollector features);
}
}
/** 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 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("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". */
public static final Expression MAPPING = and(or(matchAny("aerialway", "station"),
matchAny("amenity", "arts_centre", "atm", "bank", "bar", "bbq", "bicycle_parking", "bicycle_rental", "biergarten",
"bus_station", "cafe", "charging_station", "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", "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"),
matchAny("building", "dormitory"), matchAny("highway", "bus_stop"),
matchAny("historic", "monument", "castle", "ruins"),
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("office", "accountant", "advertising_agency", "architect", "association", "bail_bond_agent", "charity",
"company", "construction_company", "consulting", "cooperative", "courier", "coworking", "diplomatic",
"educational_institution", "employment_agency", "energy_supplier", "engineer", "estate_agent", "financial",
"financial_advisor", "forestry", "foundation", "geodesist", "government", "graphic_design", "guide",
"harbour_master", "health_insurance", "insurance", "interior_design", "it", "lawyer", "logistics", "marketing",
"moving_company", "newspaper", "ngo", "notary", "physician", "political_party", "private_investigator",
"property_management", "publisher", "quango", "religion", "research", "security", "surveyor", "tax_advisor",
"taxi", "telecommunication", "therapist", "translator", "travel_agent", "tutoring", "union", "university",
"water_utility", "web_design", "wedding_planner"),
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", "locksmith", "mall", "massage", "mobile_phone", "motorcycle", "music", "musical_instrument",
"newsagent", "optician", "outdoor", "paint", "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",
"disc_golf", "diving", "dog_racing", "equestrian", "fatsal", "field_hockey", "free_flying", "gaelic_games",
"golf", "gymnastics", "handball", "hockey", "horse_racing", "horseshoes", "ice_hockey", "ice_stock", "judo",
"karting", "korfball", "long_jump", "model_aerodrome", "motocross", "motor", "multi", "netball", "orienteering",
"paddle_tennis", "paintball", "paragliding", "pelota", "racquet", "rc_car", "rowing", "rugby", "rugby_league",
"rugby_union", "running", "sailing", "scuba_diving", "shooting", "shooting_range", "skateboard", "skating",
"skiing", "soccer", "surfing", "swimming", "table_soccer", "table_tennis", "team_handball", "tennis",
"toboggan", "volleyball", "water_ski", "yoga"),
matchAny("tourism", "alpine_hut", "aquarium", "artwork", "attraction", "bed_and_breakfast", "camp_site",
"caravan_site", "chalet", "gallery", "guest_house", "hostel", "hotel", "information", "motel", "museum",
"picnic_site", "theme_park", "viewpoint", "zoo"),
matchAny("waterway", "dock")), matchType("polygon"));
/**
* Interface for layer implementations to extend to subscribe to OSM elements filtered and parsed as
* {@link OsmPoiPolygon}.
*/
public interface Handler {
void process(OsmPoiPolygon element, FeatureCollector features);
}
}
/** An OSM element that would appear in the {@code osm_aerodrome_label_point} table generated by imposm3. */
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) implements Row, WithName, WithNameEn,
WithNameDe, WithAerodromeType, WithAerodrome, WithMilitary, WithIata, WithIcao, WithEle, WithSource {
public OsmAerodromeLabelPoint(SourceFeature source, String mappingKey) {
this(source.getString("name"), source.getString("name:en"), source.getString("name:de"),
source.getString("aerodrome:type"), source.getString("aerodrome"), source.getString("military"),
source.getString("iata"), source.getString("icao"), source.getString("ele"), source);
}
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
public static final Expression MAPPING = or(and(matchAny("aeroway", "aerodrome"), matchType("point")),
and(matchAny("aeroway", "aerodrome"), matchType("polygon")));
/**
* Interface for layer implementations to extend to subscribe to OSM elements filtered and parsed as
* {@link OsmAerodromeLabelPoint}.
*/
public interface Handler {
void process(OsmAerodromeLabelPoint element, FeatureCollector features);
}
}
/** Rows with a String access attribute. */
public interface WithAccess {
String access();
}
/** Rows with a String aerialway attribute. */
public interface WithAerialway {
String aerialway();
}
/** Rows with a String aerodrome attribute. */
public interface WithAerodrome {
String aerodrome();
}
/** Rows with a String aerodromeType attribute. */
public interface WithAerodromeType {
String aerodromeType();
}
/** Rows with a String aeroway attribute. */
public interface WithAeroway {
String aeroway();
}
/** Rows with a String amenity attribute. */
public interface WithAmenity {
String amenity();
}
/** Rows with a String bicycle attribute. */
public interface WithBicycle {
String bicycle();
}
/** Rows with a String blockNumber attribute. */
public interface WithBlockNumber {
String blockNumber();
}
/** Rows with a String boundary attribute. */
public interface WithBoundary {
String boundary();
}
/** Rows with a String brand attribute. */
public interface WithBrand {
String brand();
}
/** Rows with a String building attribute. */
public interface WithBuilding {
String building();
}
/** Rows with a String buildingheight attribute. */
public interface WithBuildingheight {
String buildingheight();
}
/** Rows with a String buildinglevels attribute. */
public interface WithBuildinglevels {
String buildinglevels();
}
/** Rows with a String buildingminHeight attribute. */
public interface WithBuildingminHeight {
String buildingminHeight();
}
/** Rows with a String buildingminLevel attribute. */
public interface WithBuildingminLevel {
String buildingminLevel();
}
/** Rows with a String buildingpart attribute. */
public interface WithBuildingpart {
String buildingpart();
}
/** Rows with a String capital attribute. */
public interface WithCapital {
String capital();
}
/** Rows with a String colour attribute. */
public interface WithColour {
String colour();
}
/** Rows with a String construction attribute. */
public interface WithConstruction {
String construction();
}
/** Rows with a String countryCodeIso31661Alpha2 attribute. */
public interface WithCountryCodeIso31661Alpha2 {
String countryCodeIso31661Alpha2();
}
/** 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 {
String foot();
}
/** Rows with a String funicular attribute. */
public interface WithFunicular {
String funicular();
}
/** Rows with a String hasName attribute. */
public interface WithHasName {
String hasName();
}
/** Rows with a String height attribute. */
public interface WithHeight {
String height();
}
/** Rows with a String highway attribute. */
public interface WithHighway {
String highway();
}
/** Rows with a String horse attribute. */
public interface WithHorse {
String horse();
}
/** Rows with a String housenumber attribute. */
public interface WithHousenumber {
String housenumber();
}
/** Rows with a String iata attribute. */
public interface WithIata {
String iata();
}
/** Rows with a String icao attribute. */
public interface WithIcao {
String icao();
}
/** Rows with a boolean indoor attribute. */
public interface WithIndoor {
boolean indoor();
}
/** Rows with a String information attribute. */
public interface WithInformation {
String information();
}
/** Rows with a boolean isArea attribute. */
public interface WithIsArea {
boolean isArea();
}
/** Rows with a boolean isBridge attribute. */
public interface WithIsBridge {
boolean isBridge();
}
/** Rows with a boolean isFord attribute. */
public interface WithIsFord {
boolean isFord();
}
/** Rows with a String isInCountry attribute. */
public interface WithIsInCountry {
String isInCountry();
}
/** Rows with a String isInCountryCode attribute. */
public interface WithIsInCountryCode {
String isInCountryCode();
}
/** Rows with a boolean isIntermittent attribute. */
public interface WithIsIntermittent {
boolean isIntermittent();
}
/** Rows with a int isOneway attribute. */
public interface WithIsOneway {
int isOneway();
}
/** Rows with a boolean isRamp attribute. */
public interface WithIsRamp {
boolean isRamp();
}
/** Rows with a boolean isTunnel attribute. */
public interface WithIsTunnel {
boolean isTunnel();
}
/** Rows with a String iso31661 attribute. */
public interface WithIso31661 {
String iso31661();
}
/** Rows with a String iso31661Alpha2 attribute. */
public interface WithIso31661Alpha2 {
String iso31661Alpha2();
}
/** Rows with a String landuse attribute. */
public interface WithLanduse {
String landuse();
}
/** Rows with a long layer attribute. */
public interface WithLayer {
long layer();
}
/** Rows with a String leisure attribute. */
public interface WithLeisure {
String leisure();
}
/** Rows with a long level attribute. */
public interface WithLevel {
long level();
}
/** Rows with a String levels attribute. */
public interface WithLevels {
String levels();
}
/** Rows with a String manMade attribute. */
public interface WithManMade {
String manMade();
}
/** Rows with a String mappingKey attribute. */
public interface WithMappingKey {
String mappingKey();
}
/** Rows with a String material attribute. */
public interface WithMaterial {
String material();
}
/** Rows with a String military attribute. */
public interface WithMilitary {
String military();
}
/** Rows with a String minHeight attribute. */
public interface WithMinHeight {
String minHeight();
}
/** Rows with a String minLevel attribute. */
public interface WithMinLevel {
String minLevel();
}
/** Rows with a String mtbScale attribute. */
public interface WithMtbScale {
String mtbScale();
}
/** Rows with a String name attribute. */
public interface WithName {
String name();
}
/** Rows with a String nameDe attribute. */
public interface WithNameDe {
String nameDe();
}
/** Rows with a String nameEn attribute. */
public interface WithNameEn {
String nameEn();
}
/** Rows with a String natural attribute. */
public interface WithNatural {
String natural();
}
/** Rows with a String network attribute. */
public interface WithNetwork {
String network();
}
/** Rows with a String operator attribute. */
public interface WithOperator {
String operator();
}
/** Rows with a String place attribute. */
public interface WithPlace {
String place();
}
/** Rows with a long population attribute. */
public interface WithPopulation {
long population();
}
/** Rows with a String protectionTitle attribute. */
public interface WithProtectionTitle {
String protectionTitle();
}
/** Rows with a String publicTransport attribute. */
public interface WithPublicTransport {
String publicTransport();
}
/** Rows with a String railway attribute. */
public interface WithRailway {
String railway();
}
/** Rows with a long rank attribute. */
public interface WithRank {
long rank();
}
/** Rows with a String ref attribute. */
public interface WithRef {
String ref();
}
/** Rows with a String religion attribute. */
public interface WithReligion {
String religion();
}
/** Rows with a String sacScale attribute. */
public interface WithSacScale {
String sacScale();
}
/** Rows with a String service attribute. */
public interface WithService {
String service();
}
/** Rows with a String shipway attribute. */
public interface WithShipway {
String shipway();
}
/** Rows with a SourceFeature source attribute. */
public interface WithSource {
SourceFeature source();
}
/** Rows with a String sport attribute. */
public interface WithSport {
String sport();
}
/** Rows with a String station attribute. */
public interface WithStation {
String station();
}
/** Rows with a String street attribute. */
public interface WithStreet {
String street();
}
/** Rows with a String subclass attribute. */
public interface WithSubclass {
String subclass();
}
/** Rows with a String surface attribute. */
public interface WithSurface {
String surface();
}
/** Rows with a boolean toll attribute. */
public interface WithToll {
boolean toll();
}
/** Rows with a String tourism attribute. */
public interface WithTourism {
String tourism();
}
/** Rows with a String tracktype attribute. */
public interface WithTracktype {
String tracktype();
}
/** Rows with a String uicRef attribute. */
public interface WithUicRef {
String uicRef();
}
/** Rows with a String usage attribute. */
public interface WithUsage {
String usage();
}
/** Rows with a String water attribute. */
public interface WithWater {
String water();
}
/** Rows with a String waterway attribute. */
public interface WithWaterway {
String waterway();
}
/** Rows with a String wikipedia attribute. */
public interface WithWikipedia {
String wikipedia();
}
/** Rows with a int zOrder attribute. */
public interface WithZOrder {
int zOrder();
}
/** Index to efficiently choose which imposm3 "tables" an element should appear in based on its attributes. */
public static final MultiExpression<RowClassAndConstructor> MAPPINGS = MultiExpression.of(List.of(
MultiExpression.entry(new RowClassAndConstructor(OsmWaterPolygon.class, OsmWaterPolygon::new),
OsmWaterPolygon.MAPPING),
MultiExpression.entry(new RowClassAndConstructor(OsmWaterwayLinestring.class, OsmWaterwayLinestring::new),
OsmWaterwayLinestring.MAPPING),
MultiExpression.entry(new RowClassAndConstructor(OsmLandcoverPolygon.class, OsmLandcoverPolygon::new),
OsmLandcoverPolygon.MAPPING),
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(OsmBoundaryPolygon.class, OsmBoundaryPolygon::new),
OsmBoundaryPolygon.MAPPING),
MultiExpression.entry(new RowClassAndConstructor(OsmAerowayPolygon.class, OsmAerowayPolygon::new),
OsmAerowayPolygon.MAPPING),
MultiExpression.entry(new RowClassAndConstructor(OsmAerowayLinestring.class, OsmAerowayLinestring::new),
OsmAerowayLinestring.MAPPING),
MultiExpression.entry(new RowClassAndConstructor(OsmAerowayPoint.class, OsmAerowayPoint::new),
OsmAerowayPoint.MAPPING),
MultiExpression.entry(new RowClassAndConstructor(OsmHighwayLinestring.class, OsmHighwayLinestring::new),
OsmHighwayLinestring.MAPPING),
MultiExpression.entry(new RowClassAndConstructor(OsmRailwayLinestring.class, OsmRailwayLinestring::new),
OsmRailwayLinestring.MAPPING),
MultiExpression.entry(new RowClassAndConstructor(OsmAerialwayLinestring.class, OsmAerialwayLinestring::new),
OsmAerialwayLinestring.MAPPING),
MultiExpression.entry(new RowClassAndConstructor(OsmShipwayLinestring.class, OsmShipwayLinestring::new),
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),
OsmMarinePoint.MAPPING),
MultiExpression.entry(new RowClassAndConstructor(OsmContinentPoint.class, OsmContinentPoint::new),
OsmContinentPoint.MAPPING),
MultiExpression.entry(new RowClassAndConstructor(OsmCountryPoint.class, OsmCountryPoint::new),
OsmCountryPoint.MAPPING),
MultiExpression.entry(new RowClassAndConstructor(OsmIslandPolygon.class, OsmIslandPolygon::new),
OsmIslandPolygon.MAPPING),
MultiExpression.entry(new RowClassAndConstructor(OsmIslandPoint.class, OsmIslandPoint::new),
OsmIslandPoint.MAPPING),
MultiExpression.entry(new RowClassAndConstructor(OsmStatePoint.class, OsmStatePoint::new), OsmStatePoint.MAPPING),
MultiExpression.entry(new RowClassAndConstructor(OsmCityPoint.class, OsmCityPoint::new), OsmCityPoint.MAPPING),
MultiExpression.entry(new RowClassAndConstructor(OsmHousenumberPoint.class, OsmHousenumberPoint::new),
OsmHousenumberPoint.MAPPING),
MultiExpression.entry(new RowClassAndConstructor(OsmPoiPoint.class, OsmPoiPoint::new), OsmPoiPoint.MAPPING),
MultiExpression.entry(new RowClassAndConstructor(OsmPoiPolygon.class, OsmPoiPolygon::new), OsmPoiPolygon.MAPPING),
MultiExpression.entry(new RowClassAndConstructor(OsmAerodromeLabelPoint.class, OsmAerodromeLabelPoint::new),
OsmAerodromeLabelPoint.MAPPING)
));
/**
* Returns a map from imposm3 "table row" class to the layers that have a handler for it from a list of layer
* implementations.
*/
public static Map<Class<? extends Row>, List<RowHandlerAndClass<?>>> generateDispatchMap(List<?> handlers) {
Map<Class<? extends Row>, List<RowHandlerAndClass<?>>> result = new HashMap<>();
for (var handler : handlers) {
if (handler instanceof OsmWaterPolygon.Handler typedHandler) {
result.computeIfAbsent(OsmWaterPolygon.class, cls -> new ArrayList<>())
.add(new RowHandlerAndClass<>(typedHandler.getClass(), typedHandler::process));
}
if (handler instanceof OsmWaterwayLinestring.Handler typedHandler) {
result.computeIfAbsent(OsmWaterwayLinestring.class, cls -> new ArrayList<>())
.add(new RowHandlerAndClass<>(typedHandler.getClass(), typedHandler::process));
}
if (handler instanceof OsmLandcoverPolygon.Handler typedHandler) {
result.computeIfAbsent(OsmLandcoverPolygon.class, cls -> new ArrayList<>())
.add(new RowHandlerAndClass<>(typedHandler.getClass(), typedHandler::process));
}
if (handler instanceof OsmLandusePolygon.Handler typedHandler) {
result.computeIfAbsent(OsmLandusePolygon.class, cls -> new ArrayList<>())
.add(new RowHandlerAndClass<>(typedHandler.getClass(), typedHandler::process));
}
if (handler instanceof OsmPeakPoint.Handler typedHandler) {
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));
}
if (handler instanceof OsmBoundaryPolygon.Handler typedHandler) {
result.computeIfAbsent(OsmBoundaryPolygon.class, cls -> new ArrayList<>())
.add(new RowHandlerAndClass<>(typedHandler.getClass(), typedHandler::process));
}
if (handler instanceof OsmAerowayPolygon.Handler typedHandler) {
result.computeIfAbsent(OsmAerowayPolygon.class, cls -> new ArrayList<>())
.add(new RowHandlerAndClass<>(typedHandler.getClass(), typedHandler::process));
}
if (handler instanceof OsmAerowayLinestring.Handler typedHandler) {
result.computeIfAbsent(OsmAerowayLinestring.class, cls -> new ArrayList<>())
.add(new RowHandlerAndClass<>(typedHandler.getClass(), typedHandler::process));
}
if (handler instanceof OsmAerowayPoint.Handler typedHandler) {
result.computeIfAbsent(OsmAerowayPoint.class, cls -> new ArrayList<>())
.add(new RowHandlerAndClass<>(typedHandler.getClass(), typedHandler::process));
}
if (handler instanceof OsmHighwayLinestring.Handler typedHandler) {
result.computeIfAbsent(OsmHighwayLinestring.class, cls -> new ArrayList<>())
.add(new RowHandlerAndClass<>(typedHandler.getClass(), typedHandler::process));
}
if (handler instanceof OsmRailwayLinestring.Handler typedHandler) {
result.computeIfAbsent(OsmRailwayLinestring.class, cls -> new ArrayList<>())
.add(new RowHandlerAndClass<>(typedHandler.getClass(), typedHandler::process));
}
if (handler instanceof OsmAerialwayLinestring.Handler typedHandler) {
result.computeIfAbsent(OsmAerialwayLinestring.class, cls -> new ArrayList<>())
.add(new RowHandlerAndClass<>(typedHandler.getClass(), typedHandler::process));
}
if (handler instanceof OsmShipwayLinestring.Handler typedHandler) {
result.computeIfAbsent(OsmShipwayLinestring.class, cls -> new ArrayList<>())
.add(new RowHandlerAndClass<>(typedHandler.getClass(), typedHandler::process));
}
if (handler instanceof OsmHighwayPolygon.Handler typedHandler) {
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));
}
if (handler instanceof OsmMarinePoint.Handler typedHandler) {
result.computeIfAbsent(OsmMarinePoint.class, cls -> new ArrayList<>())
.add(new RowHandlerAndClass<>(typedHandler.getClass(), typedHandler::process));
}
if (handler instanceof OsmContinentPoint.Handler typedHandler) {
result.computeIfAbsent(OsmContinentPoint.class, cls -> new ArrayList<>())
.add(new RowHandlerAndClass<>(typedHandler.getClass(), typedHandler::process));
}
if (handler instanceof OsmCountryPoint.Handler typedHandler) {
result.computeIfAbsent(OsmCountryPoint.class, cls -> new ArrayList<>())
.add(new RowHandlerAndClass<>(typedHandler.getClass(), typedHandler::process));
}
if (handler instanceof OsmIslandPolygon.Handler typedHandler) {
result.computeIfAbsent(OsmIslandPolygon.class, cls -> new ArrayList<>())
.add(new RowHandlerAndClass<>(typedHandler.getClass(), typedHandler::process));
}
if (handler instanceof OsmIslandPoint.Handler typedHandler) {
result.computeIfAbsent(OsmIslandPoint.class, cls -> new ArrayList<>())
.add(new RowHandlerAndClass<>(typedHandler.getClass(), typedHandler::process));
}
if (handler instanceof OsmStatePoint.Handler typedHandler) {
result.computeIfAbsent(OsmStatePoint.class, cls -> new ArrayList<>())
.add(new RowHandlerAndClass<>(typedHandler.getClass(), typedHandler::process));
}
if (handler instanceof OsmCityPoint.Handler typedHandler) {
result.computeIfAbsent(OsmCityPoint.class, cls -> new ArrayList<>())
.add(new RowHandlerAndClass<>(typedHandler.getClass(), typedHandler::process));
}
if (handler instanceof OsmHousenumberPoint.Handler typedHandler) {
result.computeIfAbsent(OsmHousenumberPoint.class, cls -> new ArrayList<>())
.add(new RowHandlerAndClass<>(typedHandler.getClass(), typedHandler::process));
}
if (handler instanceof OsmPoiPoint.Handler typedHandler) {
result.computeIfAbsent(OsmPoiPoint.class, cls -> new ArrayList<>())
.add(new RowHandlerAndClass<>(typedHandler.getClass(), typedHandler::process));
}
if (handler instanceof OsmPoiPolygon.Handler typedHandler) {
result.computeIfAbsent(OsmPoiPolygon.class, cls -> new ArrayList<>())
.add(new RowHandlerAndClass<>(typedHandler.getClass(), typedHandler::process));
}
if (handler instanceof OsmAerodromeLabelPoint.Handler typedHandler) {
result.computeIfAbsent(OsmAerodromeLabelPoint.class, cls -> new ArrayList<>())
.add(new RowHandlerAndClass<>(typedHandler.getClass(), typedHandler::process));
}
}
return result;
}
}