[OSM-dev] How to keep a geographic local part of OSM updated with minutely diffs?

tb osm at qayx.net
Tue Dec 1 10:33:50 UTC 2015


Hi,

On 11/30/2015 07:40 PM, Frederik Ramm wrote:
> On 11/30/2015 03:29 PM, tb wrote:
>> Now i'm interested in keeping just a region like a city or a small state
>> updated the same way (on a much smaller system).
>
> ...
>
>> But unfortunately the other tables used by osm2pgsql
>> (planet_osm_nodes, ...ways, ...rels) getting bigger by time.
>
> Option 1:
>
> Use bounding box option with osm2pgsql import, and run the cleanup
> queries documented here:
>
> http://wiki.openstreetmap.org/wiki/User:Stephankn/knowledgebase#Cleanup_of_ways_outside_the_bounding_box

hm, this has some constraints:
1. use of "--flat-nodes" is not allowed, which IMHO is no problemo for a 
small database.
2. (at least to me) some unpredictable behavior in a case where an 
object location is changed from outside of the bounding box partially or 
fully inside the bounding box (partially also means no node inside the 
bounding box, but having a crossing edge). Also moving an object in two 
changes out of the bounding box and in again is questionable.
Will this work reliable?





> Option 2:
>
> Instead of applying diffs to the database directly, do this:
>
> * download worldwide diffs
> * apply them to an extract (file containing only your regional data)
> with osmosis
> * have osmosis cut out your polygon of interest from the resulting
> updated file (since applying diffs will have added stuff outside your
> region)
> * have osmosis compare a diff between your previous local extract and
> the new, updated local extract
> * update your database with that diff

This seems to be the best approach according to data quality. Another 
advantage is this works not only with bounding boxes but also with 
(multiple) polygons.
But the disadvantage here is time: the computation of the three steps 
might take to much time and brings me way behind even by using minutely 
diffs. On the other hand i can start over every night by using a fresh 
cut my region(s) of interest.
I'll give it a try and check the usage of time and resources.



Thanks a lot for everybody's suggestions!
-tb




More information about the dev mailing list