digidem / osm-p2p-db

Peer-to-peer database for OpenStreetMap data
BSD 2-Clause "Simplified" License
235 stars 25 forks source link

How to index deleted points? #41

Open gmaclennan opened 7 years ago

gmaclennan commented 7 years ago

Consider the following scenario:

For a point A, one user changes a tag, and another user moves the point, creating a fork. The point is then deleted:

        /--- A1 <---\
A0 <----             ---- A3 (deleted)
        \--- A2 <---/

If we are going to return deleted points, what should be returned from a bbox query?

My thoughts: A3 should be returned whether A1 or A2 is in the bbox. The client should be responsible for choosing what to do next (e.g. read the two linked points A1 and A2 and display them on the map). This would mean that there should be two references in the kdb index both pointing to A3. We would probably need to dedupe for the results of a bbox that included both A1 and A2.

gmaclennan commented 7 years ago

We would also need to consider the following scenario:

        /--- A1 <-----\
A0 <----               ---- A3 (deleted)
        \             /
         \--- A2 <----
                      \---- A4

I think the above solution would work for that too.