[OSM-dev] Osmosis diffs: "delete" shows the wrong user?

Brett Henderson brett at bretth.com
Fri Jul 4 14:55:49 BST 2008


Hakan Tandogan wrote:
> Hi,
>
>
> I'm watching the areas I'm interested in by downloading daily excerpts
> from osmxapi and building a diff via osmosis.
>
> For the delete actions, the diffs show the wrong user. In one example
> node, the user "djanda" deleted a node, but the diffs show the last user
> that manipulated node, in this case, "uboot".
>
> Is this intentional, does anyone depend on this behaviour? If not, I'll
> try to fix it one of those days...
>   
It's not intentional and it does sound like a bug.  I had a quick look 
at the code and couldn't immediately see the problem but if you can 
figure it out by all means do so.

The class in question is likely to be:
com.bretth.osmosis.core.mysql.v0_5.impl.NodeHistoryReader

It contains this query:
        "SELECT n.id, n.timestamp, u.data_public, u.display_name, 
n.latitude, n.longitude, n.tags, n.visible" +
        " FROM nodes n" +
        " INNER JOIN (" +
        "   SELECT id" +
        "   FROM nodes" +
        "   WHERE timestamp > ? AND timestamp <= ?" +
        "   GROUP BY id" +
        " ) idList ON n.id = idList.id" +
        " LEFT OUTER JOIN users u ON n.user_id = u.id" +
        " WHERE n.timestamp <= ?" +
        " ORDER BY n.id, n.timestamp";

The inner query identifies all nodes that have changed in the specified 
time period.  The outer query then selects the complete history of those 
nodes up to the end of the changeset interval.

The class that then examines the history is:
com.bretth.osmosis.core.mysql.v0_5.impl.NodeChangeReader

It examines the complete history to figure out what the action needs to 
be (ie. create, modify or delete).

The user id is taken from the most recent history item though ... strange.

Brett





More information about the dev mailing list