Transformer.update_other_tags
- classmethod Transformer.update_other_tags(prop_or_feat, mode=1)[source]
Update the original data of
'other_tags'
with parsed data.- Parameters:
prop_or_feat (dict) – original data of a feature or a
'properties'
fieldmode (int) – options include
{1, 2}
indicating what action to take; whenmode=1
(default),prop_or_feat
should be data of a feature; whenmode=2
,prop_or_feat
should be data of a'properties'
field
- Returns:
updated data of a feature or a ‘properties’ field
- Return type:
dict
Examples:
>>> from pydriosm.reader import Transformer >>> prop_dat = { ... 'properties': { ... 'osm_id': '488432', ... 'name': None, ... 'barrier': None, ... 'highway': None, ... 'ref': None, ... 'address': None, ... 'is_in': None, ... 'place': None, ... 'man_made': None, ... 'other_tags': '"odbl"=>"clean"' ... }, ... } >>> prop_dat_ = Transformer.update_other_tags(prop_dat['properties']) >>> prop_dat_ {'osm_id': '488432', 'name': None, 'barrier': None, 'highway': None, 'ref': None, 'address': None, 'is_in': None, 'place': None, 'man_made': None, 'other_tags': {'odbl': 'clean'}}
See also
Examples for the method
PBFReadParse.read_pbf()
.