Skip to content

Commit

Permalink
Merge pull request #1951 from tilezen/nvkelso/#1910-canals-below-pede…
Browse files Browse the repository at this point in the history
…strian-plaza

Add handling for underground water and reorder garden and pedestrian areas to render correctly
  • Loading branch information
tgrigsby-sc authored May 17, 2021
2 parents 024909e + ff7edc0 commit 69e1a92
Show file tree
Hide file tree
Showing 5 changed files with 125 additions and 18 deletions.
85 changes: 85 additions & 0 deletions integration-test/1910-underground-water.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# -*- encoding: utf-8 -*-
import dsl
from . import FixtureTest


class UndergroundWaterTest(FixtureTest):
def test_water_level_1(self):
z, x, y = (16, 33199, 22547)

self.generate_fixtures(
# https://www.openstreetmap.org/way/236735251
dsl.way(236735251, dsl.tile_box(z, x, y), {
'layer': '-1',
'name': u'Vo\xfbte Richard Lenoir',
'source': 'openstreetmap.org',
'tunnel': 'yes',
'waterway': 'riverbank',
}),
)

self.assert_has_feature(
16, 33199, 22547, "water",
{"kind": "riverbank", "id": 236735251,
"name": "Voûte Richard Lenoir", "is_tunnel": True,
"sort_rank": 9})

def test_water_level_2(self):
z, x, y = (16, 33504, 22442)

self.generate_fixtures(
# https://www.openstreetmap.org/way/94321616
dsl.way(94321616, dsl.tile_box(z, x, y), {
'layer': '-2',
'source': 'openstreetmap.org',
'tunnel': 'yes',
'waterway': 'riverbank',
}),
)

self.assert_has_feature(
z, x, y, 'water', {
'id': 94321616,
"kind": "riverbank", "is_tunnel": True, "sort_rank": 8})

def test_pedestrian(self):
z, x, y = (16, 33199, 22546)

self.generate_fixtures(
# https://www.openstreetmap.org/way/115027186
dsl.way(115027186, dsl.tile_box(z, x, y), {
'highway': 'pedestrian',
'source': 'openstreetmap.org',
'area': 'yes',
'type': 'polygon',
}),
dsl.relation(1602299, {
'area': 'yes',
'bicycle': 'no',
'highway': 'pedestrian',
'source': 'openstreetmap.org',
'name': 'Esplanade Roger Joseph Boscovich',
'type': 'polygon',
}, ways=[115027186])
)

self.assert_has_feature(
z, x, y, "landuse",
{"kind": "pedestrian", "id": 115027186,
"sort_rank": 110})

def test_garden(self):
z, x, y = (16, 33199, 22546)

self.generate_fixtures(
# https://www.openstreetmap.org/way/115027177
dsl.way(115027177, dsl.tile_box(z, x, y), {
'leisure': 'garden',
'source': 'openstreetmap.org',
}),
)

self.assert_has_feature(
z, x, y, "landuse",
{"kind": "garden", "id": 115027177,
"sort_rank": 112})
1 change: 1 addition & 0 deletions queries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ layers:
- vectordatasource.transform.tags_create_dict
- vectordatasource.transform.tags_name_i18n
- vectordatasource.transform.tags_remove
- vectordatasource.transform.parse_layer_as_float
- vectordatasource.transform.water_tunnel
- vectordatasource.transform.add_id_to_properties
- vectordatasource.transform.detect_osm_relation
Expand Down
4 changes: 2 additions & 2 deletions spreadsheets/sort_rank/landuse.csv
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ artwork,*,116
animal,*,115
pitch,*,114
playground,*,113
pedestrian,*,112
garden,*,112
dog_park,*,111
garden,*,110
pedestrian,*,110
beach,*,109
hanami,*,108
maze,*,107
Expand Down
52 changes: 36 additions & 16 deletions spreadsheets/sort_rank/water.csv
Original file line number Diff line number Diff line change
@@ -1,16 +1,36 @@
kind,boundary,sort_rank
river,-,201
canal,-,201
stream,-,201
dam,-,201
ditch,-,201
drain,-,201
playa,-,203
lake,-,204
water,-,204
riverbank,-,204
reservoir,-,204
swimming_pool,-,206
ocean,true,205
*,true,367
*,*,200
layer::int,kind,boundary,sort_rank
*,swimming_pool,-,206
*,ocean,true,205
*,reservoir,-,204
*,lake,-,204
*,water,-,204
-1,riverbank,-,9
-2,riverbank,-,8
-3,riverbank,-,7
-4,riverbank,-,6
-5,riverbank,-,5
*,riverbank,-,204
*,playa,-,203
-1,river,-,9
-2,river,-,8
-3,river,-,7
-4,river,-,6
-5,river,-,5
*,river,-,201
-1,canal,-,9
-2,canal,-,8
-3,canal,-,7
-4,canal,-,6
-5,canal,-,5
*,canal,-,201
-1,stream,-,9
-2,stream,-,8
-3,stream,-,7
-4,stream,-,6
-5,stream,-,5
*,stream,-,201
*,dam,-,201
*,ditch,-,201
*,drain,-,201
*,*,true,367
*,*,*,200
1 change: 1 addition & 0 deletions yaml/water.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ globals:
mz_label_placement: {col: mz_label_placement}
label_placement: {col: label_placement}
boundary: {col: boundary}
layer : {col: layer}
tunnel: {col: tunnel}
wikidata_id: {col: wikidata}
- &water_standard_properties_osm
Expand Down

0 comments on commit 69e1a92

Please sign in to comment.