[Moderation] How goes?
Frederik Ramm
frederik at remote.org
Wed Nov 4 14:26:28 GMT 2009
Hi,
Peter Miller wrote:
> In particular ... are there any plans to get the history tab on the
> main OSM site to only show changes that do actually impact on the view
> area
I am repeating myself here but I believe this could, and should, be done
in a standalone application.
I believe that we should not rely to heavily on the central Rails
application to deliver the tools and information required for effective
anti-vandalism. This is bound to cause trouble - the central servers
don't necessarily have enough power to deliver what is needed, and what
few Rails developers we have may be concerned with other things.
Checking whether or not a certain bounding box is affected by a
changeset can be an expensive operation, and cannot be computed in
advance (because the bounding box is not known). The "affected bbox"
that we currently store with each relation is relatively cheap to
compute and that's why the API does it. If you wanted to find out "does
this 500-change changeset affect the bounding box I am looking at", then
you would have to do the following:
* retrieve all nodes that were changed in the changeset - *two* versions
of each, the "before" and the "after" version - and see whether they are
contained in the bounding box.
* retrieve all ways that were changed in the changeset - again, two
versions of each -, retrieve all nodes used by these ways, check if any
is contained in the bounding box.
* do the same for relations.
This is something that could only be done at a high cost if implemented
in the current database. In contrast, if we were to set up a specialised
mirror that fetches the replication diffs from the server and builds
"geo fingerprints" for each relation from them, it could be relatively
easy to query changesets this way.
So my advice would be, stop pestering the API programmers with this
request because even if you get them to implement it, it will be slow,
and painful, and not scale very well. Instead, use a PostGIS database,
the minute replicate diffs, and some brains to build a specialist
"monitoring and anti-vandalism" storage.
I think we should even remove the "Changes" tab from the web site
because it suggests that people think that they will get something
filtered for their viewport, but they don't get that. The bounding box
stored with the changeset is something for internal use, a rough index
that helps you filter out the stuff that is on the other side of the
world from where you are looking, but nothing more.
Bye
Frederik
More information about the Moderation
mailing list