Hi Stefan!<br><br>This is exactly what I was planning to do, but in a much more complicated way, because of my defficiencies with SQL!<br><br>So thanks for your code, this is very helpful. I will also just run it everyday in a cron task<br>
<br>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<br><br>Thanks again for your help<br>
<br>cheers<br><br>Stéphane<br clear="all">--<br>"Le mot progrès n'aura aucun sens tant qu'il y aura des enfants malheureux" -- Albert Einstein<br><br>"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<br>
<br>Photos de voyages, photos de montagne: <a href="http://www.henriod.info/" target="_blank">http://www.henriod.info</a><span dir="ltr"><span dir="ltr" title="Appeler ce numéro de téléphone en/au(x) Tadjikistan avec Skype : +992934624662"><span> </span></span> <br>
</span><br>
<br><br><div class="gmail_quote">On Thu, Sep 6, 2012 at 9:35 AM, Stephan Knauss <span dir="ltr"><<a href="mailto:osm@stephans-server.de" target="_blank">osm@stephans-server.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Stéphane Henriod writes: <br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
My problem is that, despite the *osm2pgsql -b* option, it seems that my<br>
bounding box is ignored and the full diff file is added to my database, As<br>
a consequence, the database is growing very quickly and includes lots of<br>
data outside of my area of interest.<br>
</blockquote>
<br>
Only nodes have a coordinate, so only these can be checked against a bounding box. <br>
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? <br>
I thought about extending osm2pgsql but the runtime effort to fetch all this data is quite expensive when running minutely diffs. <br>
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. <br>
Find it in the wiki:<br>
<a href="http://wiki.openstreetmap.org/wiki/User:Stephankn/knowledgebase#Cleanup_of_w" target="_blank">http://wiki.openstreetmap.org/<u></u>wiki/User:Stephankn/<u></u>knowledgebase#Cleanup_of_w</a><br>
ays_outside_the_bounding_box <br>
If you are happy with nodes and ways and don't need relations then the upcoming augmented diffs might be an option. <br><span class="HOEnZb"><font color="#888888">
Stephan<br>
<br>
</font></span></blockquote></div><br>