[OSM-dev] Tool to simplify ways

Maarten Deen mdeen at xs4all.nl
Mon May 6 17:05:04 UTC 2013


On 5-5-2013 20:13, Maarten Deen wrote:
> On 2013-05-05 15:38, Christian Müller wrote:
>> Hi,
>>
>> have a look at
>>
>> http://lists.openstreetmap.org/pipermail/dev/2012-May/024947.html
>> https://github.com/podolsir/osmosis-simplifyways
>
> That doesn't want to work for me. I have the latest germany file and
> when I run that (with enableDateParsing set to no, otherwise it won't
> even start reading it), I get this error:
>
> maarten at watcheye:~/osm$ osmosis/bin/osmosis --read-xml
> file=germany-latest.osm enableDateParsing=no --simplify-ways
> epsilonMeters=10 --write-xml file=germany-simplifyied.osm
> May 5, 2013 8:11:30 PM org.openstreetmap.osmosis.core.Osmosis run
> INFO: Osmosis Version 0.43.1

Ok, I found out that osmosis-simplifyways is not compatible with osmosis 0.43.1. 
It will work with 0.39.
But the tool is buggy. It removes nodes from ways where it connects to other 
ways. So in my example it ends up with
<way id="1">
     <nd ref="1"/>
     <nd ref="6"/>
</way>
<way id="2">
     <nd ref="3"/>
     <nd ref="10"/>
</way>

It does not delete node 3 because it is still in use by way 2, but it will 
delete it from way 1, therefore totaly breaking any connectivity.
Furthermore: it does not delete nodes from the osm file. Unused nodes are left 
in the file as stray nodes.

Regards,
Maarten


>> Am 05.05.2013 14:56, schrieb Maarten Deen:
>>> Hi,
>>>
>>> is there a tool already existing that can simplify ways in an .osm
>>> file?
>>>
>>> What I'm looking for is something that removes all intermediate nodes
>>> from a way, as long as they are not used in another way.
>>>
>>> Example:
>>> <way id="1">
>>>     <nd ref="1"/>
>>>     <nd ref="2"/>
>>>     <nd ref="3"/>
>>>     <nd ref="4"/>
>>>     <nd ref="5"/>
>>>     <nd ref="6"/>
>>> </way>
>>> <way id="2">
>>>     <nd ref="3"/>
>>>     <nd ref="7"/>
>>>     <nd ref="8"/>
>>>     <nd ref="9"/>
>>>     <nd ref="10"/>
>>> </way>
>>>
>>> After simplifying:
>>> <way id="1">
>>>     <nd ref="1"/>
>>>     <nd ref="3"/>
>>>     <nd ref="6"/>
>>> </way>
>>> <way id="2">
>>>     <nd ref="3"/>
>>>     <nd ref="10"/>
>>> </way>
>>>
>>> And then also remove the unused nodes from the osm files.
>>>




More information about the dev mailing list