@@ -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