Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce office POI class #29

Merged
merged 2 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 42 additions & 29 deletions src/main/java/org/openmaptiles/generated/OpenMapTilesSchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
import org.openmaptiles.Layer;

/**
* All vector tile layer definitions, attributes, and allowed values generated from the
* <a href="https://github.com/openmaptiles/openmaptiles/blob/master/openmaptiles.yaml">OpenMapTiles vector tile schema
* master</a>.
* All vector tile layer definitions, attributes, and allowed values generated from the <a href=
* "https://github.com/openmaptiles/openmaptiles/blob/3cf77e2a542d8a369bb08bf2538cdde0b3effb2b/openmaptiles.yaml">OpenMapTiles
* vector tile schema 3cf77e2a542d8a369bb08bf2538cdde0b3effb2b</a>.
*/
@SuppressWarnings("unused")
public class OpenMapTilesSchema {
Expand Down Expand Up @@ -95,8 +95,8 @@ public static List<Layer> createInstances(Translations translations, PlanetilerC
* polygons to improve rendering performance. This however can lead to less rendering options in clients since these
* boundaries show up. So you might not be able to use border styling for ocean water features.
*
* Generated from
* <a href="https://github.com/openmaptiles/openmaptiles/blob/master/layers/water/water.yaml">water.yaml</a>
* Generated from <a href=
* "https://github.com/openmaptiles/openmaptiles/blob/3cf77e2a542d8a369bb08bf2538cdde0b3effb2b/layers/water/water.yaml">water.yaml</a>
*/
public interface Water extends Layer {
double BUFFER_SIZE = 4.0;
Expand Down Expand Up @@ -194,8 +194,8 @@ final class FieldMappings {
* there is also <code>canal</code> generated, starting z13 there is no generalization according to <code>class</code>
* field applied. Waterways do not have a <code>subclass</code> field.
*
* Generated from
* <a href="https://github.com/openmaptiles/openmaptiles/blob/master/layers/waterway/waterway.yaml">waterway.yaml</a>
* Generated from <a href=
* "https://github.com/openmaptiles/openmaptiles/blob/3cf77e2a542d8a369bb08bf2538cdde0b3effb2b/layers/waterway/waterway.yaml">waterway.yaml</a>
*/
public interface Waterway extends Layer {
double BUFFER_SIZE = 4.0;
Expand Down Expand Up @@ -280,7 +280,7 @@ final class FieldMappings {
* layer is to style wood (<code>class=wood</code>) and grass (<code>class=grass</code>) areas.
*
* Generated from <a href=
* "https://github.com/openmaptiles/openmaptiles/blob/master/layers/landcover/landcover.yaml">landcover.yaml</a>
* "https://github.com/openmaptiles/openmaptiles/blob/3cf77e2a542d8a369bb08bf2538cdde0b3effb2b/layers/landcover/landcover.yaml">landcover.yaml</a>
*/
public interface Landcover extends Layer {
double BUFFER_SIZE = 4.0;
Expand Down Expand Up @@ -436,8 +436,8 @@ final class FieldMappings {
* Landuse is used to describe use of land by humans. At lower zoom levels this is from Natural Earth data for
* residential (urban) areas and at higher zoom levels mostly OSM <code>landuse</code> tags.
*
* Generated from
* <a href="https://github.com/openmaptiles/openmaptiles/blob/master/layers/landuse/landuse.yaml">landuse.yaml</a>
* Generated from <a href=
* "https://github.com/openmaptiles/openmaptiles/blob/3cf77e2a542d8a369bb08bf2538cdde0b3effb2b/layers/landuse/landuse.yaml">landuse.yaml</a>
*/
public interface Landuse extends Layer {
double BUFFER_SIZE = 4.0;
Expand Down Expand Up @@ -533,7 +533,7 @@ final class FieldMappings {
* <a href="http://wiki.openstreetmap.org/wiki/Tag:natural%3Dpeak">Natural peaks</a>
*
* Generated from <a href=
* "https://github.com/openmaptiles/openmaptiles/blob/master/layers/mountain_peak/mountain_peak.yaml">mountain_peak.yaml</a>
* "https://github.com/openmaptiles/openmaptiles/blob/3cf77e2a542d8a369bb08bf2538cdde0b3effb2b/layers/mountain_peak/mountain_peak.yaml">mountain_peak.yaml</a>
*/
public interface MountainPeak extends Layer {
double BUFFER_SIZE = 64.0;
Expand Down Expand Up @@ -611,8 +611,8 @@ final class FieldMappings {
* Indigenous boundaries are not parks, but they are included in this layer for technical reasons related to data
* processing. These boundaries represent areas with special legal and administrative status for indigenous peoples.
*
* Generated from
* <a href="https://github.com/openmaptiles/openmaptiles/blob/master/layers/park/park.yaml">park.yaml</a>
* Generated from <a href=
* "https://github.com/openmaptiles/openmaptiles/blob/3cf77e2a542d8a369bb08bf2538cdde0b3effb2b/layers/park/park.yaml">park.yaml</a>
*/
public interface Park extends Layer {
double BUFFER_SIZE = 4.0;
Expand Down Expand Up @@ -672,8 +672,8 @@ final class FieldMappings {
* <a href="http://wiki.openstreetmap.org/wiki/Tag:boundary%3Dadministrative#admin_level"><code>admin_level</code></a>
* but for most styles it makes sense to just style <code>admin_level=2</code> and <code>admin_level=4</code>.
*
* Generated from
* <a href="https://github.com/openmaptiles/openmaptiles/blob/master/layers/boundary/boundary.yaml">boundary.yaml</a>
* Generated from <a href=
* "https://github.com/openmaptiles/openmaptiles/blob/3cf77e2a542d8a369bb08bf2538cdde0b3effb2b/layers/boundary/boundary.yaml">boundary.yaml</a>
*/
public interface Boundary extends Layer {
double BUFFER_SIZE = 4.0;
Expand Down Expand Up @@ -773,8 +773,8 @@ final class FieldMappings {
* buildings are contained in the <strong>building</strong> layer but all other airport related polygons can be found
* in the <strong>aeroway</strong> layer.
*
* Generated from
* <a href="https://github.com/openmaptiles/openmaptiles/blob/master/layers/aeroway/aeroway.yaml">aeroway.yaml</a>
* Generated from <a href=
* "https://github.com/openmaptiles/openmaptiles/blob/3cf77e2a542d8a369bb08bf2538cdde0b3effb2b/layers/aeroway/aeroway.yaml">aeroway.yaml</a>
*/
public interface Aeroway extends Layer {
double BUFFER_SIZE = 4.0;
Expand Down Expand Up @@ -834,7 +834,7 @@ final class FieldMappings {
* features like plazas.
*
* Generated from <a href=
* "https://github.com/openmaptiles/openmaptiles/blob/master/layers/transportation/transportation.yaml">transportation.yaml</a>
* "https://github.com/openmaptiles/openmaptiles/blob/3cf77e2a542d8a369bb08bf2538cdde0b3effb2b/layers/transportation/transportation.yaml">transportation.yaml</a>
*/
public interface Transportation extends Layer {
double BUFFER_SIZE = 4.0;
Expand Down Expand Up @@ -1178,8 +1178,8 @@ final class FieldMappings {
* (<a href="http://wiki.openstreetmap.org/wiki/Key:building"><code>building= </code></a>). Only buildings with tag
* location:underground are excluded.
*
* Generated from
* <a href="https://github.com/openmaptiles/openmaptiles/blob/master/layers/building/building.yaml">building.yaml</a>
* Generated from <a href=
* "https://github.com/openmaptiles/openmaptiles/blob/3cf77e2a542d8a369bb08bf2538cdde0b3effb2b/layers/building/building.yaml">building.yaml</a>
*/
public interface Building extends Layer {
double BUFFER_SIZE = 4.0;
Expand Down Expand Up @@ -1221,7 +1221,7 @@ final class FieldMappings {
* from OSM water bodies. Only the most important lakes contain labels.
*
* Generated from <a href=
* "https://github.com/openmaptiles/openmaptiles/blob/master/layers/water_name/water_name.yaml">water_name.yaml</a>
* "https://github.com/openmaptiles/openmaptiles/blob/3cf77e2a542d8a369bb08bf2538cdde0b3effb2b/layers/water_name/water_name.yaml">water_name.yaml</a>
*/
public interface WaterName extends Layer {
double BUFFER_SIZE = 256.0;
Expand Down Expand Up @@ -1291,7 +1291,7 @@ final class FieldMappings {
* while for other roads you should use <code>name</code>.
*
* Generated from <a href=
* "https://github.com/openmaptiles/openmaptiles/blob/master/layers/transportation_name/transportation_name.yaml">transportation_name.yaml</a>
* "https://github.com/openmaptiles/openmaptiles/blob/3cf77e2a542d8a369bb08bf2538cdde0b3effb2b/layers/transportation_name/transportation_name.yaml">transportation_name.yaml</a>
*/
public interface TransportationName extends Layer {
double BUFFER_SIZE = 8.0;
Expand Down Expand Up @@ -1520,8 +1520,8 @@ final class FieldMappings {
* of the more important layers to create a beautiful map. We suggest you use different font styles and sizes to
* create a text hierarchy.
*
* Generated from
* <a href="https://github.com/openmaptiles/openmaptiles/blob/master/layers/place/place.yaml">place.yaml</a>
* Generated from <a href=
* "https://github.com/openmaptiles/openmaptiles/blob/3cf77e2a542d8a369bb08bf2538cdde0b3effb2b/layers/place/place.yaml">place.yaml</a>
*/
public interface Place extends Layer {
double BUFFER_SIZE = 256.0;
Expand Down Expand Up @@ -1632,7 +1632,7 @@ final class FieldMappings {
* tag are prioritized for preservation).
*
* Generated from <a href=
* "https://github.com/openmaptiles/openmaptiles/blob/master/layers/housenumber/housenumber.yaml">housenumber.yaml</a>
* "https://github.com/openmaptiles/openmaptiles/blob/3cf77e2a542d8a369bb08bf2538cdde0b3effb2b/layers/housenumber/housenumber.yaml">housenumber.yaml</a>
*/
public interface Housenumber extends Layer {
double BUFFER_SIZE = 8.0;
Expand Down Expand Up @@ -1664,7 +1664,8 @@ final class FieldMappings {
* <a href="http://wiki.openstreetmap.org/wiki/Points_of_interest">Points of interests</a> containing a of a variety
* of OpenStreetMap tags. Mostly contains amenities, sport, shop and tourist POIs.
*
* Generated from <a href="https://github.com/openmaptiles/openmaptiles/blob/master/layers/poi/poi.yaml">poi.yaml</a>
* Generated from <a href=
* "https://github.com/openmaptiles/openmaptiles/blob/3cf77e2a542d8a369bb08bf2538cdde0b3effb2b/layers/poi/poi.yaml">poi.yaml</a>
*/
public interface Poi extends Layer {
double BUFFER_SIZE = 64.0;
Expand Down Expand Up @@ -1693,6 +1694,7 @@ final class Fields {
* allowed values:
* <ul>
* <li>shop
* <li>office
* <li>town_hall
* <li>golf
* <li>fast_food
Expand Down Expand Up @@ -1788,6 +1790,7 @@ final class Fields {
/** Attribute values for map elements in the poi layer. */
final class FieldValues {
public static final String CLASS_SHOP = "shop";
public static final String CLASS_OFFICE = "office";
public static final String CLASS_TOWN_HALL = "town_hall";
public static final String CLASS_GOLF = "golf";
public static final String CLASS_FAST_FOOD = "fast_food";
Expand Down Expand Up @@ -1821,8 +1824,8 @@ final class FieldValues {
public static final String CLASS_SWIMMING = "swimming";
public static final String CLASS_CASTLE = "castle";
public static final String CLASS_ATM = "atm";
public static final Set<String> CLASS_VALUES = Set.of("shop", "town_hall", "golf", "fast_food", "park", "bus",
"railway", "aerialway", "entrance", "campsite", "laundry", "grocery", "library", "college", "lodging",
public static final Set<String> CLASS_VALUES = Set.of("shop", "office", "town_hall", "golf", "fast_food", "park",
"bus", "railway", "aerialway", "entrance", "campsite", "laundry", "grocery", "library", "college", "lodging",
"ice_cream", "post", "cafe", "school", "alcohol_shop", "bar", "harbor", "car", "hospital", "cemetery",
"attraction", "beer", "music", "stadium", "art_gallery", "clothing_store", "swimming", "castle", "atm");
}
Expand All @@ -1837,6 +1840,16 @@ final class FieldMappings {
"locksmith", "lamps", "mall", "massage", "motorcycle", "mobile_phone", "newsagent", "optician", "outdoor",
"paint", "perfumery", "perfume", "pet", "photo", "second_hand", "shoes", "sports", "stationery", "tailor",
"tattoo", "ticket", "tobacco", "toys", "travel_agency", "watches", "weapons", "wholesale")),
MultiExpression.entry("office",
matchAny("subclass", "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")),
MultiExpression.entry("town_hall",
matchAny("subclass", "townhall", "public_building", "courthouse", "community_centre")),
MultiExpression.entry("golf", matchAny("subclass", "golf", "golf_course", "miniature_golf")),
Expand Down Expand Up @@ -1883,7 +1896,7 @@ final class FieldMappings {
* <a href="http://wiki.openstreetmap.org/wiki/Tag:aeroway%3Daerodrome">Aerodrome labels</a>
*
* Generated from <a href=
* "https://github.com/openmaptiles/openmaptiles/blob/master/layers/aerodrome_label/aerodrome_label.yaml">aerodrome_label.yaml</a>
* "https://github.com/openmaptiles/openmaptiles/blob/3cf77e2a542d8a369bb08bf2538cdde0b3effb2b/layers/aerodrome_label/aerodrome_label.yaml">aerodrome_label.yaml</a>
*/
public interface AerodromeLabel extends Layer {
double BUFFER_SIZE = 64.0;
Expand Down
25 changes: 21 additions & 4 deletions src/main/java/org/openmaptiles/generated/Tables.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE

/**
* 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/master/openmaptiles.yaml">OpenMapTiles vector tile
* schema</a>.
* in the <a href=
* "https://github.com/openmaptiles/openmaptiles/blob/3cf77e2a542d8a369bb08bf2538cdde0b3effb2b/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
Expand Down Expand Up @@ -725,7 +726,15 @@ public OsmPoiPoint(SourceFeature source, String mappingKey) {
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", "diplomatic"),
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",
Expand Down Expand Up @@ -795,7 +804,15 @@ public OsmPoiPolygon(SourceFeature source, String mappingKey) {
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", "diplomatic"),
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",
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/openmaptiles/layers/PoiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ void testGridRank() throws GeometryException {
void testEmbassy() {
assertFeatures(7, List.of(Map.of(
"_layer", "poi",
"class", "diplomatic",
"class", "office",
"subclass", "diplomatic",
"name", "The Embassy"
)), process(pointFeature(Map.of(
Expand Down