[OSM-talk] JOSM incomplete ways debuggung (was: Unordered segments)
Martijn van Oosterhout
kleptog at gmail.com
Tue May 1 11:54:14 BST 2007
On 4/29/07, Frederik Ramm <frederik at remote.org> wrote:
> I have followed the merging process in great detail and must agree with
> Martijn - there isn't an obvious mistake at least. If a way is
> downloaded which contains segments that are not present, "placeholder"
> objects (incomplete=1) are created; if new data arrives in later
> downloads, newly arrived segments with the same id as stored incomplete
> segments will overwrite the existing segment (more specifically, a
> "cloneFrom" method is called on the existing segment that copies all the
> new data into the old segment, unsetting the "incomplete" flag in the
> process).
Every now and then I also look at that code to see if i can work it
out. Your example did raise the point to me that the problem only
seems to happen if you redownload an area after you been working for a
while. Just downloading twice in my exerience doesn't do it.
So that gave me an idea: these lines seem problematic to me:
if (mergeAfterId(mergedNodes, ds.nodes, other))
return;
And inside that function:
if (my.realEqual(other, false))
return true; // no merge needed.
Now, say that a way got downloaded, one of the segments got editted
moved and then the way got downloaded again. This code would say the
way hasn't changed and do nothing, yet the segments. Or something. It
bugs me that it adds nothing the mergedNodes/Segments in this case.
> Can anyone provide an example where this doesn't work and where you have
> to apply the "save the whole thing as .osm, then load it again"
> workaround to actually get a complete way? - Ideally in the form of two
> files, but two bounding boxes would also be perfect as long as it is
> repeatable...
I think you need to play with modified times also, say that the second
file has an older time for the segment/way then the new one.
I also think fixReferences/Segment/Way is the right place for
assertion checks like:
Assert( ds.nodes.contains( segment.from ) );
And stuff like that, since that's what actually causes the problem in the end...
Have a nice day,
--
Martijn van Oosterhout <kleptog at gmail.com> http://svana.org/kleptog/
More information about the talk
mailing list