[OSM-dev] [OSM-talk] Trouble in Rangoon

Tom Hughes tom at compton.nu
Thu Feb 28 12:29:33 GMT 2008

In message <47C69D6C.5040104 at wolschon.biz>
        Marcus Wolschon <marcus at wolschon.biz> wrote:

> In the end we really need something like
> the history-tab in wikipedia without breaking
> referential integrity uppon restores. Once
> accidents and vandalism becomes more common
> there is not much of a way around that.

That's basically not possible - we can't even maintain proper
referential integrity on ordinary uploads so how you expect to
maintain it through a bulk restore is beyond me.

> Maybe it would be a good idea to have an
> optional timestamp-parameter in the api
> for fetching map-parts as they where at
> a given time or (maybe easier to implement)
> give all changes between 2 timestamps for a
> bounding-box.

That's very hard - the problem is that it's essentially not
possible to write efficient SQL to find the first version of
each object in an area that predates a given timestamp.

For example you can do:

  FROM nodes
  WHERE tile IN (...) AND timestamp <= ...

but that will get you all versions of each node that predate
the given timestamp. Which might be a lot more data than you

You can limit the whole query to only return one row, but you
can't limit it to returning one row for each node id.


Tom Hughes (tom at compton.nu)

More information about the dev mailing list