Skip to content

Commit 887ae63

Browse files
committed
fix(osm-building): key error
1 parent d8382d3 commit 887ae63

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG
22

3+
## 4.1.1
4+
FIXED :
5+
- osm building key error
6+
37
## 4.1.0
48
ADDED :
59
- added new osm-specific tags in osm building for valhalla costing options

r2gg/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
__uri_tracker__ = f"{__uri_repository__}issues/"
3535
__uri__ = __uri_repository__
3636

37-
__version__ = "4.1.0"
37+
__version__ = "4.1.1"
3838
__version_info__ = tuple(
3939
[
4040
int(num) if num.isdigit() else num

r2gg/_osm_building.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,18 +216,18 @@ def writeWayTags(wayEl, way):
216216
tag.set('k', '%s' %k)
217217
tag.set('v', '%s' %str(v))
218218
tags_present.add(k)
219-
if PIVOT_ATTRIBUTE_TO_OSM[k] != "" and isinstance(PIVOT_ATTRIBUTE_TO_OSM[k], dict):
220-
for attr_value, new_tags in PIVOT_ATTRIBUTE_TO_OSM[k].items():
219+
if PIVOT_ATTRIBUTE_TO_OSM.get(k, "") != "" and isinstance(PIVOT_ATTRIBUTE_TO_OSM.get(k, ""), dict):
220+
for attr_value, new_tags in PIVOT_ATTRIBUTE_TO_OSM.get(k, "").items():
221221
if v == attr_value:
222222
for t, val in new_tags.items():
223223
if t not in tags_present:
224224
newtag = etree.SubElement(wayEl, 'tag')
225225
newtag.set('k', '%s' %t)
226226
newtag.set('v', '%s' %str(val))
227227
tags_present.add(t)
228-
elif PIVOT_ATTRIBUTE_TO_OSM[k] != "" and isinstance(PIVOT_ATTRIBUTE_TO_OSM[k], str):
228+
elif PIVOT_ATTRIBUTE_TO_OSM.get(k, "") != "" and isinstance(PIVOT_ATTRIBUTE_TO_OSM.get(k, ""), str):
229229
tag = etree.SubElement(wayEl, 'tag')
230-
tag.set('k', '%s' %PIVOT_ATTRIBUTE_TO_OSM[k])
230+
tag.set('k', '%s' %PIVOT_ATTRIBUTE_TO_OSM.get(k, ""))
231231
tag.set('v', '%s' %str(v))
232232
tags_present.add(k)
233233
# Cas particulier : vitesse

0 commit comments

Comments
 (0)