Skip to content

Commit 5a64d33

Browse files
authored
Merge pull request #1720 from tilezen/zerebubuth/1096-natural-landuse-sort-key
Add sort keys for "natural" landuse kinds
2 parents 21acb94 + 7ec8850 commit 5a64d33

15 files changed

+427
-151
lines changed

docs/layers.md

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,7 @@ _TIP: Some `landuse` features only exist as point features in OpenStreetMap. Fin
489489
* `aviary`
490490
* `battlefield`
491491
* `beach` - Where the land meets the sea gradually.
492+
* `boatyard` - a place for building, fixing, and storing boats.
492493
* `breakwater`
493494
* `bridge`
494495
* `camp_site`
@@ -504,8 +505,8 @@ _TIP: Some `landuse` features only exist as point features in OpenStreetMap. Fin
504505
* `crane`
505506
* `cutline`
506507
* `cutting` - A lowered area of land, usually to carry a road or railway.
507-
* `danger_area` - e.g: military training zones, firing ranges.
508508
* `dam` - polygon, line
509+
* `danger_area` - e.g: military training zones, firing ranges.
509510
* `dike`
510511
* `ditch` line.
511512
* `dog_park`
@@ -542,10 +543,10 @@ _TIP: Some `landuse` features only exist as point features in OpenStreetMap. Fin
542543
* `military`
543544
* `mud` - An area where the surface is bare mud.
544545
* `national_park`
546+
* `natural_forest`
547+
* `natural_park`
548+
* `natural_wood`
545549
* `nature_reserve`
546-
* `natural_forest` - _See planned bug fix in [#1096](https://github.com/tilezen/vector-datasource/issues/1096)._
547-
* `natural_park` - _See planned bug fix in [#1096](https://github.com/tilezen/vector-datasource/issues/1096)._
548-
* `natural_wood` - _See planned bug fix in [#1096](https://github.com/tilezen/vector-datasource/issues/1096)._
549550
* `naval_base`
550551
* `orchard` - An area intentionally planted with trees or shrubs for their crops, rather than their wood. With `kind_detail` property.
551552
* `park`
@@ -556,18 +557,19 @@ _TIP: Some `landuse` features only exist as point features in OpenStreetMap. Fin
556557
* `pier` with mooring property.
557558
* `pitch`
558559
* `place_of_worship`
559-
* `plant`
560560
* `plant_nursery` - Land used for growing young plants.
561+
* `plant`
561562
* `playground`
562-
* `port`
563563
* `port_terminal`
564+
* `port`
564565
* `power_line` line.
565566
* `power_minor_line` line.
566567
* `prison`
567568
* `protected_area`
568569
* `quarry`
569570
* `quay` with mooring property.
570571
* `railway`
572+
* `range` - e.g: military training zones where soldiers practice with their weapons
571573
* `recreation_ground`
572574
* `recreation_track`
573575
* `residential`
@@ -786,7 +788,6 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
786788

787789
#### POI `kind` values:
788790

789-
* `art`
790791
* `accountant`
791792
* `adit`
792793
* `administrative`
@@ -804,6 +805,7 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
804805
* `aquarium`
805806
* `archaeological_site`
806807
* `architect`
808+
* `art`
807809
* `arts_centre` - A venue where arts are performed or exhibited.
808810
* `artwork`
809811
* `assisted_living`
@@ -824,24 +826,24 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
824826
* `beauty`
825827
* `bed_and_breakfast`
826828
* `bench`
829+
* `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.
827830
* `bicycle_parking`
828-
* `bicycle_rental` - Bicycle rental shop.
829831
* `bicycle_rental_station` - Bike share station offering free or low cost bicycle rentals as part of a public bike scheme.
832+
* `bicycle_rental` - Bicycle rental shop.
830833
* `bicycle_repair_station`
831834
* `bicycle` - Bicycle sales shop, often with bike repair service.
832-
* `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.
833835
* `biergarten`
834836
* `block`
835837
* `blood_bank`
838+
* `boat_lift`
836839
* `boat_rental`
837840
* `boat_storage`
838-
* `boatyard`
839-
* `boat_lift`
841+
* `boatyard` - a place for building, fixing, and storing boats.
840842
* `bollard`
841843
* `bookmaker`
842844
* `books`
843-
* `brewery`
844845
* `border_control`
846+
* `brewery`
845847
* `bunker` - A reinforced military building. With `kind_detail` property.
846848
* `bureau_de_change`
847849
* `bus_station`
@@ -850,12 +852,12 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
850852
* `cafe` - _See planned bug fixes in [#1085](https://github.com/tilezen/vector-datasource/issues/1085)._
851853
* `camera` - A shop selling cameras.
852854
* `camp_site`
853-
* `car`
854855
* `car_parts` - A shop selling car parts.
855856
* `car_rental` - A business which rents cars.
856857
* `car_repair`
857858
* `car_sharing`
858859
* `car_wash`
860+
* `car`
859861
* `caravan_site`
860862
* `care_home`
861863
* `carousel`
@@ -895,8 +897,8 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
895897
* `customs` - A place where border control is carried out, which may involve [customs taxes](https://en.wikipedia.org/wiki/Customs_(tax)).
896898
* `cycle_barrier` - Barrier for bicycles.
897899
* `dairy_kitchen`
898-
* `danger_area` - e.g: military training zones, firing ranges.
899900
* `dam`
901+
* `danger_area` - e.g: military training zones, firing ranges.
900902
* `day_care`
901903
* `defibrillator`
902904
* `deli`
@@ -925,13 +927,13 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
925927
* `fashion`
926928
* `fast_food`
927929
* `ferry_terminal`
928-
* `financial`
929930
* `field_hospital` with `kind_detail` property.
931+
* `financial`
930932
* `fire_hydrant`
931933
* `fire_station` - _See planned bug fixes in [#1085](https://github.com/tilezen/vector-datasource/issues/1085)._
932934
* `firepit`
933-
* `fishing`
934935
* `fishing_area`
936+
* `fishing`
935937
* `fishmonger` - A shop selling fish and seafood.
936938
* `fitness_station`
937939
* `fitness`
@@ -946,16 +948,16 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
946948
* `furniture`
947949
* `gallery` - An art gallery.
948950
* `gambling`
951+
* `garden_centre`
949952
* `garden` - _See planned bug fixes in [#1085](https://github.com/tilezen/vector-datasource/issues/1085)._
950953
* `gardener`
951-
* `garden_centre`
952954
* `gas_canister` - Shop selling bottled gas for cooking. Some offer gas canister refills.
953955
* `gate` with `kind_detail` property.
954956
* `generator` - A building or structure which generates power. With `kind_detail` property.
955957
* `geyser`
956958
* `gift`
957-
* `golf` - Shop selling golf equipment.
958959
* `golf_course`
960+
* `golf` - Shop selling golf equipment.
959961
* `government`
960962
* `grave_yard` with `kind_detail` and `denomination` properties.
961963
* `greengrocer` - Shop selling fruits and vegetables.
@@ -969,11 +971,11 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
969971
* `harbourmaster`
970972
* `hardware`
971973
* `hazard`
972-
* `healthcare` with `kind_detail` property.
973974
* `health_centre`
974975
* `healthcare_alternative`
975976
* `healthcare_centre`
976977
* `healthcare_laboratory`
978+
* `healthcare` with `kind_detail` property.
977979
* `helipad`
978980
* `heliport`
979981
* `hifi`
@@ -983,18 +985,18 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
983985
* `hostel`
984986
* `hot_spring`
985987
* `hotel`
986-
* `hunting`
987988
* `hunting_stand`
989+
* `hunting`
988990
* `hvac`
989991
* `ice_cream` - _See planned bug fix in [#532](https://github.com/tilezen/vector-datasource/issues/532)._
990992
* `industrial` - An industrial POI which didn't match a more specific kind.
991993
* `information`
992994
* `insurance`
993995
* `it`
994996
* `jewelry`
995-
* `kindergarten`
996997
* `karaoke_box`
997998
* `karaoke`
999+
* `kindergarten`
9981000
* `landmark`
9991001
* `laundry`
10001002
* `lawyer`
@@ -1008,35 +1010,35 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
10081010
* `love_hotel`
10091011
* `mall`
10101012
* `marina`
1013+
* `marketplace`
10111014
* `mast`
10121015
* `maze`
10131016
* `memorial`
1014-
* `marketplace`
10151017
* `metal_construction`
10161018
* `midwife`
10171019
* `military`
10181020
* `mineshaft`
1019-
* `miniature_golf` - A venue for playing miniature golf.
10201021
* `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`).
1022+
* `miniature_golf` - A venue for playing miniature golf.
10211023
* `mobile_phone`
10221024
* `money_transfer` - A business which specialises in transferring money between people, often internationally.
10231025
* `monument`
10241026
* `mooring` with `kind_detail` property.
10251027
* `motel`
1026-
* `motorcycle`
10271028
* `motorcycle_parking`
1029+
* `motorcycle`
10281030
* `motorway_junction`
10291031
* `museum`
10301032
* `music`
10311033
* `national_park`
10321034
* `nature_reserve`
1035+
* `naval_base`
10331036
* `newsagent`
10341037
* `newspaper`
10351038
* `ngo`
10361039
* `nightclub`
10371040
* `notary`
10381041
* `nursing_home` with `kind_detail` property. _See planned bug fixes in [#1085](https://github.com/tilezen/vector-datasource/issues/1085)._
1039-
* `naval_base`
10401042
* `obelisk` - A tall structure, usually a monument or memorial. If known, the `kind_detail` will be set to either `monument` or `memorial`.
10411043
* `observatory`
10421044
* `office` - An office which didn't match a more specific kind.
@@ -1047,8 +1049,8 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
10471049
* `outreach`
10481050
* `painter`
10491051
* `park` - _See planned bug fixes in [#1081](https://github.com/tilezen/vector-datasource/issues/1081)._
1050-
* `parking` - _See planned bug fixes in [#1085](https://github.com/tilezen/vector-datasource/issues/1085)._
10511052
* `parking_garage` parking type is `multi-storey`, `underground`, or `rooftop`.
1053+
* `parking` - _See planned bug fixes in [#1085](https://github.com/tilezen/vector-datasource/issues/1085)._
10521054
* `peak` A mountain peak. See above for properties available on peaks and volcanos.
10531055
* `perfumery`
10541056
* `pet`
@@ -1085,7 +1087,7 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
10851087
* `pylon`
10861088
* `quarry`
10871089
* `quay` - if available, with `mooring` property.
1088-
* `range` for military use.
1090+
* `range` - e.g: military training zones where soldiers practice with their weapons
10891091
* `ranger_station`
10901092
* `rapid`
10911093
* `recreation_ground`
@@ -1107,8 +1109,8 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
11071109
* `scuba_diving`
11081110
* `service_area`
11091111
* `shelter`
1110-
* `shipyard`
11111112
* `ship_chandler`
1113+
* `shipyard`
11121114
* `shoemaker`
11131115
* `shoes`
11141116
* `shop` - A shop or store which didn't match a more specific kind.
@@ -1180,17 +1182,17 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
11801182
* `water_well` - A location where water can be extracted from the ground. With `kind_detail` property.
11811183
* `water_works` - _See planned bug fixes in [#1085](https://github.com/tilezen/vector-datasource/issues/1085)._
11821184
* `waterfall`
1183-
* `waterway_fuel`
11841185
* `watering_place`
11851186
* `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.
1187+
* `waterway_fuel`
11861188
* `wayside_cross`
1189+
* `wharf` with mooring property.
11871190
* `wilderness_hut`
11881191
* `wildlife_park`
11891192
* `windmill`
11901193
* `wine`
11911194
* `winery` - _See planned bug fix in [#532](https://github.com/tilezen/vector-datasource/issues/532)._
11921195
* `winter_sports`
1193-
* `wharf` with mooring property.
11941196
* `wood`
11951197
* `works`
11961198
* `workshop`
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# -*- encoding: utf-8 -*-
2+
from . import FixtureTest
3+
4+
5+
class NaturalLanduseSortKeyTest(FixtureTest):
6+
7+
def _check(self, tags, expected_kind, expected_sort_rank):
8+
import dsl
9+
10+
z, x, y = (16, 0, 0)
11+
12+
full_tags = {
13+
'source': 'openstreetmap.org'
14+
}
15+
full_tags.update(tags)
16+
17+
self.generate_fixtures(
18+
dsl.way(1, dsl.tile_box(z, x, y), full_tags),
19+
)
20+
21+
self.assert_has_feature(
22+
z, x, y, 'landuse', {
23+
'id': 1,
24+
'kind': expected_kind,
25+
'sort_rank': expected_sort_rank,
26+
})
27+
28+
def test_natural_wood(self):
29+
self._check({'natural': 'wood'}, 'natural_wood', 34)
30+
31+
def test_natural_forest(self):
32+
self._check({'natural': 'forest'}, 'natural_forest', 33)
33+
34+
def test_natural_park(self):
35+
self._check({'natural': 'park'}, 'natural_park', 32)
36+
37+
def test_grass(self):
38+
self._check({'landuse': 'grass'}, 'grass', 35)
39+
40+
def test_meadow(self):
41+
self._check({'landuse': 'meadow'}, 'meadow', 36)
42+
43+
def test_scrub(self):
44+
self._check({'natural': 'scrub'}, 'scrub', 37)
45+
46+
def test_wetland(self):
47+
self._check({'natural': 'wetland'}, 'wetland', 220)

integration-test/1417-cranes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def test_crane_landuse_line(self):
1212
self.assert_has_feature(
1313
16, 32891, 21813, 'landuse',
1414
{'id': 173458931, 'kind': 'crane', 'min_zoom': 16,
15-
'sort_rank': 271})
15+
'sort_rank': 272})
1616

1717
def test_crane_pois(self):
1818
self.generate_fixtures(dsl.way(1842715058, wkt_loads('POINT (0.6785790112917439 51.43642978244269)'), {u'source': u'openstreetmap.org', u'man_made': u'crane'})) # noqa
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# -*- encoding: utf-8 -*-
2+
from . import FixtureTest
3+
4+
5+
class WetlandAboveWaterTest(FixtureTest):
6+
7+
def test_wetland_above_water(self):
8+
import dsl
9+
10+
z, x, y = (16, 0, 0)
11+
12+
self.generate_fixtures(
13+
dsl.way(1, dsl.tile_box(z, x, y), {
14+
'natural': 'wetland',
15+
'wetland': 'bog',
16+
'source': 'openstreetmap.org',
17+
}),
18+
dsl.way(2, dsl.tile_box(z, x, y), {
19+
'natural': 'water',
20+
'source': 'openstreetmap.org',
21+
}),
22+
)
23+
24+
# set here for convenience, in case we change them later. the exact
25+
# values aren't as important as the wetland one being more than the
26+
# water one.
27+
wetland_rank = 220
28+
water_rank = 204
29+
30+
self.assertTrue(wetland_rank > water_rank)
31+
self.assert_has_feature(
32+
z, x, y, 'landuse', {
33+
'id': 1,
34+
'kind': 'wetland',
35+
'sort_rank': wetland_rank,
36+
})
37+
self.assert_has_feature(
38+
z, x, y, 'water', {
39+
'id': 2,
40+
'kind': 'water',
41+
'sort_rank': water_rank,
42+
})

0 commit comments

Comments
 (0)