Hi Stefan! This is exactly what I was planning to do, but in a much more complicated way, because of my defficiencies with SQL!
So thanks for your code, this is very helpful. I will also just run it everyday in a cron task Then it's not a prioirity for me anymore but I guess it would be good in the future to check why the x and y coordinates of planet_osn_nodes are all messed up after import with osm2pgsql Thanks again for your help cheers Stéphane -- "Le mot progrès n'aura aucun sens tant qu'il y aura des enfants malheureux" -- Albert Einstein "A journey does not need reasons. Before long, it proves to be reason enough in itself. One thinks that one is going to make a journey, yet soon it is the journey that makes or unmakes you." -- Nicolas Bouvier Photos de voyages, photos de montagne: http://www.henriod.info On Thu, Sep 6, 2012 at 9:35 AM, Stephan Knauss <[email protected]>wrote: > Stéphane Henriod writes: > >> My problem is that, despite the *osm2pgsql -b* option, it seems that my >> bounding box is ignored and the full diff file is added to my database, As >> a consequence, the database is growing very quickly and includes lots of >> data outside of my area of interest. >> > > Only nodes have a coordinate, so only these can be checked against a > bounding box. > For ways and even worse relations you have to look up the coordinates of > the member nodes and then decide on a strategy. Will you include ways where > all nodes are inside you bbox or just a single? > I thought about extending osm2pgsql but the runtime effort to fetch all > this data is quite expensive when running minutely diffs. > So I ended up with a simple query to clear up the DB. This runs by a cron > job and removes excess data from the db within minutes. The vacuum taking > the most time. > Find it in the wiki: > http://wiki.openstreetmap.org/**wiki/User:Stephankn/** > knowledgebase#Cleanup_of_w<http://wiki.openstreetmap.org/wiki/User:Stephankn/knowledgebase#Cleanup_of_w> > ays_outside_the_bounding_box > If you are happy with nodes and ways and don't need relations then the > upcoming augmented diffs might be an option. > Stephan > >
_______________________________________________ dev mailing list [email protected] http://lists.openstreetmap.org/listinfo/dev

