Skip to content

Commit

Permalink
Merge pull request #1720 from tilezen/zerebubuth/1096-natural-landuse…
Browse files Browse the repository at this point in the history
…-sort-key

Add sort keys for "natural" landuse kinds
  • Loading branch information
zerebubuth committed Dec 11, 2018
2 parents 21acb94 + 7ec8850 commit 5a64d33
Show file tree
Hide file tree
Showing 15 changed files with 427 additions and 151 deletions.
62 changes: 32 additions & 30 deletions docs/layers.md
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ _TIP: Some `landuse` features only exist as point features in OpenStreetMap. Fin
* `aviary`
* `battlefield`
* `beach` - Where the land meets the sea gradually.
* `boatyard` - a place for building, fixing, and storing boats.
* `breakwater`
* `bridge`
* `camp_site`
Expand All @@ -504,8 +505,8 @@ _TIP: Some `landuse` features only exist as point features in OpenStreetMap. Fin
* `crane`
* `cutline`
* `cutting` - A lowered area of land, usually to carry a road or railway.
* `danger_area` - e.g: military training zones, firing ranges.
* `dam` - polygon, line
* `danger_area` - e.g: military training zones, firing ranges.
* `dike`
* `ditch` line.
* `dog_park`
Expand Down Expand Up @@ -542,10 +543,10 @@ _TIP: Some `landuse` features only exist as point features in OpenStreetMap. Fin
* `military`
* `mud` - An area where the surface is bare mud.
* `national_park`
* `natural_forest`
* `natural_park`
* `natural_wood`
* `nature_reserve`
* `natural_forest` - _See planned bug fix in [#1096](https://github.com/tilezen/vector-datasource/issues/1096)._
* `natural_park` - _See planned bug fix in [#1096](https://github.com/tilezen/vector-datasource/issues/1096)._
* `natural_wood` - _See planned bug fix in [#1096](https://github.com/tilezen/vector-datasource/issues/1096)._
* `naval_base`
* `orchard` - An area intentionally planted with trees or shrubs for their crops, rather than their wood. With `kind_detail` property.
* `park`
Expand All @@ -556,18 +557,19 @@ _TIP: Some `landuse` features only exist as point features in OpenStreetMap. Fin
* `pier` with mooring property.
* `pitch`
* `place_of_worship`
* `plant`
* `plant_nursery` - Land used for growing young plants.
* `plant`
* `playground`
* `port`
* `port_terminal`
* `port`
* `power_line` line.
* `power_minor_line` line.
* `prison`
* `protected_area`
* `quarry`
* `quay` with mooring property.
* `railway`
* `range` - e.g: military training zones where soldiers practice with their weapons
* `recreation_ground`
* `recreation_track`
* `residential`
Expand Down Expand Up @@ -786,7 +788,6 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o

#### POI `kind` values:

* `art`
* `accountant`
* `adit`
* `administrative`
Expand All @@ -804,6 +805,7 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
* `aquarium`
* `archaeological_site`
* `architect`
* `art`
* `arts_centre` - A venue where arts are performed or exhibited.
* `artwork`
* `assisted_living`
Expand All @@ -824,24 +826,24 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
* `beauty`
* `bed_and_breakfast`
* `bench`
* `bicycle_junction` - Common in Europe for signed bicycle routes with named junctions. The cycle network reference point's `ref` value is derived from one of `icn_ref`, `ncn_ref`, `rcn_ref` or `lcn_ref`, in descending order and is suitable for naming or use in a shield.
* `bicycle_parking`
* `bicycle_rental` - Bicycle rental shop.
* `bicycle_rental_station` - Bike share station offering free or low cost bicycle rentals as part of a public bike scheme.
* `bicycle_rental` - Bicycle rental shop.
* `bicycle_repair_station`
* `bicycle` - Bicycle sales shop, often with bike repair service.
* `bicycle_junction` - Common in Europe for signed bicycle routes with named junctions. The cycle network reference point's `ref` value is derived from one of `icn_ref`, `ncn_ref`, `rcn_ref` or `lcn_ref`, in descending order and is suitable for naming or use in a shield.
* `biergarten`
* `block`
* `blood_bank`
* `boat_lift`
* `boat_rental`
* `boat_storage`
* `boatyard`
* `boat_lift`
* `boatyard` - a place for building, fixing, and storing boats.
* `bollard`
* `bookmaker`
* `books`
* `brewery`
* `border_control`
* `brewery`
* `bunker` - A reinforced military building. With `kind_detail` property.
* `bureau_de_change`
* `bus_station`
Expand All @@ -850,12 +852,12 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
* `cafe` - _See planned bug fixes in [#1085](https://github.com/tilezen/vector-datasource/issues/1085)._
* `camera` - A shop selling cameras.
* `camp_site`
* `car`
* `car_parts` - A shop selling car parts.
* `car_rental` - A business which rents cars.
* `car_repair`
* `car_sharing`
* `car_wash`
* `car`
* `caravan_site`
* `care_home`
* `carousel`
Expand Down Expand Up @@ -895,8 +897,8 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
* `customs` - A place where border control is carried out, which may involve [customs taxes](https://en.wikipedia.org/wiki/Customs_(tax)).
* `cycle_barrier` - Barrier for bicycles.
* `dairy_kitchen`
* `danger_area` - e.g: military training zones, firing ranges.
* `dam`
* `danger_area` - e.g: military training zones, firing ranges.
* `day_care`
* `defibrillator`
* `deli`
Expand Down Expand Up @@ -925,13 +927,13 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
* `fashion`
* `fast_food`
* `ferry_terminal`
* `financial`
* `field_hospital` with `kind_detail` property.
* `financial`
* `fire_hydrant`
* `fire_station` - _See planned bug fixes in [#1085](https://github.com/tilezen/vector-datasource/issues/1085)._
* `firepit`
* `fishing`
* `fishing_area`
* `fishing`
* `fishmonger` - A shop selling fish and seafood.
* `fitness_station`
* `fitness`
Expand All @@ -946,16 +948,16 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
* `furniture`
* `gallery` - An art gallery.
* `gambling`
* `garden_centre`
* `garden` - _See planned bug fixes in [#1085](https://github.com/tilezen/vector-datasource/issues/1085)._
* `gardener`
* `garden_centre`
* `gas_canister` - Shop selling bottled gas for cooking. Some offer gas canister refills.
* `gate` with `kind_detail` property.
* `generator` - A building or structure which generates power. With `kind_detail` property.
* `geyser`
* `gift`
* `golf` - Shop selling golf equipment.
* `golf_course`
* `golf` - Shop selling golf equipment.
* `government`
* `grave_yard` with `kind_detail` and `denomination` properties.
* `greengrocer` - Shop selling fruits and vegetables.
Expand All @@ -969,11 +971,11 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
* `harbourmaster`
* `hardware`
* `hazard`
* `healthcare` with `kind_detail` property.
* `health_centre`
* `healthcare_alternative`
* `healthcare_centre`
* `healthcare_laboratory`
* `healthcare` with `kind_detail` property.
* `helipad`
* `heliport`
* `hifi`
Expand All @@ -983,18 +985,18 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
* `hostel`
* `hot_spring`
* `hotel`
* `hunting`
* `hunting_stand`
* `hunting`
* `hvac`
* `ice_cream` - _See planned bug fix in [#532](https://github.com/tilezen/vector-datasource/issues/532)._
* `industrial` - An industrial POI which didn't match a more specific kind.
* `information`
* `insurance`
* `it`
* `jewelry`
* `kindergarten`
* `karaoke_box`
* `karaoke`
* `kindergarten`
* `landmark`
* `laundry`
* `lawyer`
Expand All @@ -1008,35 +1010,35 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
* `love_hotel`
* `mall`
* `marina`
* `marketplace`
* `mast`
* `maze`
* `memorial`
* `marketplace`
* `metal_construction`
* `midwife`
* `military`
* `mineshaft`
* `miniature_golf` - A venue for playing miniature golf.
* `mini_roundabout` - has optional property `drives_on_left` to indicate whether the roundabout is in a country which drives on the left (`drives_on_left=true`) and therefore goes around the mini roundabout in a clockwise direction as seen from above. The property is omitted when the country drives on the right and has counter-clockwise mini roundabouts (i.e: default `false`).
* `miniature_golf` - A venue for playing miniature golf.
* `mobile_phone`
* `money_transfer` - A business which specialises in transferring money between people, often internationally.
* `monument`
* `mooring` with `kind_detail` property.
* `motel`
* `motorcycle`
* `motorcycle_parking`
* `motorcycle`
* `motorway_junction`
* `museum`
* `music`
* `national_park`
* `nature_reserve`
* `naval_base`
* `newsagent`
* `newspaper`
* `ngo`
* `nightclub`
* `notary`
* `nursing_home` with `kind_detail` property. _See planned bug fixes in [#1085](https://github.com/tilezen/vector-datasource/issues/1085)._
* `naval_base`
* `obelisk` - A tall structure, usually a monument or memorial. If known, the `kind_detail` will be set to either `monument` or `memorial`.
* `observatory`
* `office` - An office which didn't match a more specific kind.
Expand All @@ -1047,8 +1049,8 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
* `outreach`
* `painter`
* `park` - _See planned bug fixes in [#1081](https://github.com/tilezen/vector-datasource/issues/1081)._
* `parking` - _See planned bug fixes in [#1085](https://github.com/tilezen/vector-datasource/issues/1085)._
* `parking_garage` parking type is `multi-storey`, `underground`, or `rooftop`.
* `parking` - _See planned bug fixes in [#1085](https://github.com/tilezen/vector-datasource/issues/1085)._
* `peak` A mountain peak. See above for properties available on peaks and volcanos.
* `perfumery`
* `pet`
Expand Down Expand Up @@ -1085,7 +1087,7 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
* `pylon`
* `quarry`
* `quay` - if available, with `mooring` property.
* `range` for military use.
* `range` - e.g: military training zones where soldiers practice with their weapons
* `ranger_station`
* `rapid`
* `recreation_ground`
Expand All @@ -1107,8 +1109,8 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
* `scuba_diving`
* `service_area`
* `shelter`
* `shipyard`
* `ship_chandler`
* `shipyard`
* `shoemaker`
* `shoes`
* `shop` - A shop or store which didn't match a more specific kind.
Expand Down Expand Up @@ -1180,17 +1182,17 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
* `water_well` - A location where water can be extracted from the ground. With `kind_detail` property.
* `water_works` - _See planned bug fixes in [#1085](https://github.com/tilezen/vector-datasource/issues/1085)._
* `waterfall`
* `waterway_fuel`
* `watering_place`
* `watermill` - A structure for using water power to do work. Note that this is different from a modern structure to generate electric power from water, which would be a `generator`. Abandoned or disused features are not shown unless they are attractions, landmarks or other kinds.
* `waterway_fuel`
* `wayside_cross`
* `wharf` with mooring property.
* `wilderness_hut`
* `wildlife_park`
* `windmill`
* `wine`
* `winery` - _See planned bug fix in [#532](https://github.com/tilezen/vector-datasource/issues/532)._
* `winter_sports`
* `wharf` with mooring property.
* `wood`
* `works`
* `workshop`
Expand Down
47 changes: 47 additions & 0 deletions integration-test/1096-natural-landuse-sort-key.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# -*- encoding: utf-8 -*-
from . import FixtureTest


class NaturalLanduseSortKeyTest(FixtureTest):

def _check(self, tags, expected_kind, expected_sort_rank):
import dsl

z, x, y = (16, 0, 0)

full_tags = {
'source': 'openstreetmap.org'
}
full_tags.update(tags)

self.generate_fixtures(
dsl.way(1, dsl.tile_box(z, x, y), full_tags),
)

self.assert_has_feature(
z, x, y, 'landuse', {
'id': 1,
'kind': expected_kind,
'sort_rank': expected_sort_rank,
})

def test_natural_wood(self):
self._check({'natural': 'wood'}, 'natural_wood', 34)

def test_natural_forest(self):
self._check({'natural': 'forest'}, 'natural_forest', 33)

def test_natural_park(self):
self._check({'natural': 'park'}, 'natural_park', 32)

def test_grass(self):
self._check({'landuse': 'grass'}, 'grass', 35)

def test_meadow(self):
self._check({'landuse': 'meadow'}, 'meadow', 36)

def test_scrub(self):
self._check({'natural': 'scrub'}, 'scrub', 37)

def test_wetland(self):
self._check({'natural': 'wetland'}, 'wetland', 220)
2 changes: 1 addition & 1 deletion integration-test/1417-cranes.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def test_crane_landuse_line(self):
self.assert_has_feature(
16, 32891, 21813, 'landuse',
{'id': 173458931, 'kind': 'crane', 'min_zoom': 16,
'sort_rank': 271})
'sort_rank': 272})

def test_crane_pois(self):
self.generate_fixtures(dsl.way(1842715058, wkt_loads('POINT (0.6785790112917439 51.43642978244269)'), {u'source': u'openstreetmap.org', u'man_made': u'crane'})) # noqa
Expand Down
42 changes: 42 additions & 0 deletions integration-test/1569-wetland-above-water.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# -*- encoding: utf-8 -*-
from . import FixtureTest


class WetlandAboveWaterTest(FixtureTest):

def test_wetland_above_water(self):
import dsl

z, x, y = (16, 0, 0)

self.generate_fixtures(
dsl.way(1, dsl.tile_box(z, x, y), {
'natural': 'wetland',
'wetland': 'bog',
'source': 'openstreetmap.org',
}),
dsl.way(2, dsl.tile_box(z, x, y), {
'natural': 'water',
'source': 'openstreetmap.org',
}),
)

# set here for convenience, in case we change them later. the exact
# values aren't as important as the wetland one being more than the
# water one.
wetland_rank = 220
water_rank = 204

self.assertTrue(wetland_rank > water_rank)
self.assert_has_feature(
z, x, y, 'landuse', {
'id': 1,
'kind': 'wetland',
'sort_rank': wetland_rank,
})
self.assert_has_feature(
z, x, y, 'water', {
'id': 2,
'kind': 'water',
'sort_rank': water_rank,
})
Loading

0 comments on commit 5a64d33

Please sign in to comment.