Skip to content

Commit

Permalink
#28 Use ; as value separator in tags
Browse files Browse the repository at this point in the history
  • Loading branch information
roelderickx committed Dec 2, 2022
1 parent b59abe5 commit 56c71c5
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ogr2osm/osm_geometries.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def get_parents(self):

def _add_tags_to_xml(self, xmlobject, suppress_empty_tags):
for (key, value_list) in self.tags.items():
value = ','.join([ v for v in value_list if v ])
value = ';'.join([ v for v in value_list if v ])
if value or not suppress_empty_tags:
tag = etree.Element('tag', { 'k':key, 'v':value })
xmlobject.append(tag)
Expand Down
2 changes: 1 addition & 1 deletion ogr2osm/pbf_datawriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def _get_tag_iterator(self, tags):
based on suppress_empty_tags.
'''
for (key, value_list) in tags.items():
value = ','.join([ v for v in value_list if v ])
value = ';'.join([ v for v in value_list if v ])
if value or not self.suppress_empty_tags:
yield (self._add_string(key), self._add_string(value))

Expand Down
2 changes: 1 addition & 1 deletion test/mergetags.pbf.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<osm version="0.6" generator="osmconvert 0.8.10">
<node id="-1" lat="33.4838" lon="-23.094721">
<tag k="name" v="the_point"/>
<tag k="description" v="Description of the_point,Alternative description of the_point"/>
<tag k="description" v="Description of the_point;Alternative description of the_point"/>
<tag k="longitude" v="-23.094721"/>
<tag k="latitude" v="33.4838"/>
<tag k="extra_empty" v=""/>
Expand Down
2 changes: 1 addition & 1 deletion test/mergetags.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<osm version="0.6" generator="ogr2osm 1.1.2" upload="false">
<node visible="true" id="-1" lat="33.4838" lon="-23.094721">
<tag k="name" v="the_point"/>
<tag k="description" v="Description of the_point,Alternative description of the_point"/>
<tag k="description" v="Description of the_point;Alternative description of the_point"/>
<tag k="longitude" v="-23.094721"/>
<tag k="latitude" v="33.4838"/>
<tag k="extra_empty" v=""/>
Expand Down
2 changes: 1 addition & 1 deletion test/mergetagsnonempty.pbf.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<osm version="0.6" generator="osmconvert 0.8.10">
<node id="-1" lat="33.4838" lon="-23.094721">
<tag k="name" v="the_point"/>
<tag k="description" v="Description of the_point,Alternative description of the_point"/>
<tag k="description" v="Description of the_point;Alternative description of the_point"/>
<tag k="longitude" v="-23.094721"/>
<tag k="latitude" v="33.4838"/>
</node>
Expand Down
2 changes: 1 addition & 1 deletion test/mergetagsnonempty.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<osm version="0.6" generator="ogr2osm 1.1.2" upload="false">
<node visible="true" id="-1" lat="33.4838" lon="-23.094721">
<tag k="name" v="the_point"/>
<tag k="description" v="Description of the_point,Alternative description of the_point"/>
<tag k="description" v="Description of the_point;Alternative description of the_point"/>
<tag k="longitude" v="-23.094721"/>
<tag k="latitude" v="33.4838"/>
</node>
Expand Down

0 comments on commit 56c71c5

Please sign in to comment.