<br>- Downloaded planet file planet-110202.osm.bz2<br>- Extracted a osm for the zone 43.5N -3.5W | 42N -1W with osmosis : <br>bzcat planet-101027.osm.bz2 | osmosis --read-xml file=/dev/stdin enableDateParsing=no --bounding-box top=43.5 left=-3.5 bottom=42 right=-1 --write-xml file=- | bzip2 > extracted.osm.bz2<br>
It takes 2 hours to complete but it finishes with no errors.<br><br>- Clear the API DB : <br>dropdb openstreetmap<br>createdb -E UTF8 -O openstreetmap openstreetmap<br>dropdb osm_test<br>createdb -E UTF8 -O openstreetmap osm_test<br>
dropdb osm<br>createdb -E UTF8 -O openstreetmap osm<br>psql -d openstreetmap < /usr/share/postgresql/8.4/contrib/btreet_gist.sql<br>rake db:migrate<br>rake test<br><br>- Import extracted osm file to the API DB with osmosis :<br>
bzcat extracted.osm.bz2 | osmosis --read-xml-0.6 file=- --write-apidb-0.6 populateCurrentTables=yes host="localhost" database="openstreetmap" user="openstreetmap" password="xxx" validateSchemaVersion=no<br>
<br>Ends with error :<br><br>org.openstreetmap.osmosis.core.OsmosisRuntimeException: Unable to load current way nodes.<br>...<br>Caused by: org.postgresql.util.PSQLException: ERROR: insert or update on table "current_way_nodes" violates foreign key constraint "current_way_nodes_node_id_fkey"<br>
Detail: Key (node_id)=(490767853) is not present in table "current_nodes"<br>...<br><br>The 'weird' thing is that 490767853 node is out of the bounding box <a href="http://www.openstreetmap.org/browse/node/490767853">http://www.openstreetmap.org/browse/node/490767853</a> : 42.3951781, -3.5017794<a href="http://www.openstreetmap.org/?lat=42.3951781&lon=-3.5017794&zoom=18"><span class="latitude"></span><span class="longitude"></span></a><br>
<br>Am I doing the process to extract+import correctly ? Is there a way to avoid this error ?<br><div style="visibility: hidden; left: -5000px; position: absolute; z-index: 9999; padding: 0px; margin-left: 0px; margin-top: 0px; overflow: hidden; word-wrap: break-word; color: black; font-size: 10px; text-align: left; line-height: 130%;" id="avg_ls_inline_popup">
</div>