openstreetmap / merkaartor

Home of Merkaartor, an openstreetmap mapping program.
http://merkaartor.be/
Other
290 stars 79 forks source link

keep existing objects #268

Closed fkv1 closed 2 years ago

fkv1 commented 2 years ago

When 2 (or more) ways or areas are joined, the ID of the resulting object is randomly taken from one of the original objects, disregarding even whether the IDs are positive (existing objects) or negative (temporary objects). This is bad, because the history of the existing object essentially gets lost.

Minimum solution: If at least one of the merging objects has a positive (= existing) ID, skip all negative IDs when determining the ID of the resulting object.

Even better solution: Take the ID of the "most important" existing object. This can mean: a) the object with most nodes b) the longest way / largest area c) the object with the lowest ID d) the object which is a member of most relations e the object with the highest version number f) the object which had the most tags before the edit

I suggest to use some of these criteria in a defined order (e.g. compare the number of nodes, and if it's the same, compare way lengths, and so on), or in a weigthed score function.

Krakonos commented 2 years ago

A lot of the things are a bit harder to compute and TBH I'm not sure what should take precedence where. However, taking the positive id out of the two is a no brainer. After that, the number of tags seems like a logical way, so I implemented that in PR #269. Have a go and see if it works for you, I only did elementary testing. Too tired today.

Cheers.

Krakonos commented 2 years ago

PR merged, closing as is. Please reopen a new issue if more criteria is deemed necessary and in what order, though the current solutions looks like a good level of compromise.