[josm-dev] Bug in Validator Plugin
Jason Reid
osm at bowvalleytechnologies.com
Thu Dec 6 21:38:55 GMT 2007
I had noted this on one of the other lists the other day, but finally
had a chance to have a look at whats happening. The issue is with the
remove duplicate nodes feature, combined with not-yet-uploaded nodes and
I suspect is the cause of a lot of the 412 errors that people keep
running into. This was tested with josm-latest.jar (as of 2pm MST
today), and a copy of validator.jar downloaded at the same time.
I started by creating a simple way and duplicated its nodes as such:
<?xml version='1.0' encoding='UTF-8'?>
<osm version='0.5' generator='JOSM'>
<bound box='25.0,25.0,25.001,25.001'
origin='http://www.openstreetmap.org/api/0.5' />
<node id='-1' action='modify' visible='true' lat='25.000517497207184'
lon='25.00030124287105' />
<node id='-2' action='modify' visible='true' lat='25.000391053864853'
lon='25.000615946300847' />
<node id='-3' action='modify' visible='true' lat='25.000587743508476'
lon='25.00071429112266' />
<node id='-4' action='modify' visible='true' lat='25.000643940549512'
lon='25.000385538432603' />
<node id='-5' action='modify' visible='true' lat='25.000517497207184'
lon='25.00030124287105' />
<node id='-6' action='modify' visible='true' lat='25.000391053864853'
lon='25.000615946300847' />
<node id='-7' action='modify' visible='true' lat='25.000587743508476'
lon='25.00071429112266' />
<node id='-8' action='modify' visible='true' lat='25.000643940549512'
lon='25.000385538432603' />
<way id='-1' action='modify' visible='true'>
<nd ref='-1' />
<nd ref='-2' />
<nd ref='-3' />
<nd ref='-4' />
<nd ref='-1' />
</way>
</osm>
I then ran validator, and selected the remove duplicate nodes. It
results in:
<?xml version='1.0' encoding='UTF-8'?>
<osm version='0.5' generator='JOSM'>
<bound box='25.0,25.0,25.001,25.001'
origin='http://www.openstreetmap.org/api/0.5' />
<node id='-1' action='modify' visible='true' lat='25.000517497207184'
lon='25.00030124287105' />
<node id='-2' action='modify' visible='true' lat='25.000391053864853'
lon='25.000615946300847' />
<node id='-3' action='modify' visible='true' lat='25.000587743508476'
lon='25.00071429112266' />
<node id='-4' action='modify' visible='true' lat='25.000643940549512'
lon='25.000385538432603' />
<way id='-5' action='modify' visible='true'>
<nd ref='-6' />
<nd ref='-2' />
<nd ref='-7' />
<nd ref='-8' />
<nd ref='-6' />
</way>
</osm>
Which as you can see updated the way, however with nodes that it then
removed. If I use the remove unconnected nodes feature it results in the
proper:
<?xml version='1.0' encoding='UTF-8'?>
<osm version='0.5' generator='JOSM'>
<bound box='25.0,25.0,25.001,25.001'
origin='http://www.openstreetmap.org/api/0.5' />
<node id='-1' action='modify' visible='true' lat='25.000517497207184'
lon='25.00030124287105' />
<node id='-2' action='modify' visible='true' lat='25.000391053864853'
lon='25.000615946300847' />
<node id='-3' action='modify' visible='true' lat='25.000587743508476'
lon='25.00071429112266' />
<node id='-4' action='modify' visible='true' lat='25.000643940549512'
lon='25.000385538432603' />
<way id='-5' action='modify' visible='true'>
<nd ref='-1' />
<nd ref='-2' />
<nd ref='-3' />
<nd ref='-4' />
<nd ref='-1' />
</way>
</osm>
If the entire set of nodes and ways has been uploaded it does seem to
work as it should, and modifies the way appropriately however if there
is a non-uploaded node the way will get messed up similar to if all the
nodes were not uploaded.
-Jason Reid
More information about the josm-dev
mailing list