I've installed Rails port using the guide from <a href="http://wiki.openstreetmap.org/wiki/Rails">http://wiki.openstreetmap.org/wiki/Rails</a> and <a href="http://wiki.openstreetmap.org/wiki/Rails_on_Ubuntu">http://wiki.openstreetmap.org/wiki/Rails_on_Ubuntu</a><br>
Also installed osmosis using the guide from <a href="http://wiki.openstretmap.org/wiki/Osmosis/Installation">http://wiki.openstretmap.org/wiki/Osmosis/Installation</a><br><br>All installed ok on an Ubuntu 10.04 server running over a DELL PowerEdge R710 with 450Gb for the Postgres DB partition and 12Gb of RAM.<br>
<br>I downloaded the planet osm file form <a href="http://planet.openstreetmap.org/planet-latest.osm.bz2">http://planet.openstreetmap.org/planet-latest.osm.bz2</a> ( to be honest is the planet-latest for 27 October 2010, at the moment I'm downloading the new current latest ) and also downloaded some osm files for different countries from <a href="http://downloads.cloudmade.com">http://downloads.cloudmade.com</a><br>
<br>To extract the information of a zone using the planet osm file I use this sentence :<br><br>bzcat planet-101027.osm.bz2 | osmosis --read-xml file=/dev/stdin enableDateParsing=no --bounding-box top=43.5 left=-3.5 bottom=42.0 right=-1.0 --write-xml file=- | bzip2 > extracted.osm.bz2<br>
<br>It takes a long time to complete but all seems to be ok.<br><br>To populate an empty API DB from the osm files I use this sentence :<br><br>bzcat file.osm.bz2 | osmosis --read-xml-0.6 file=- --write-apidb-0.6 populateCurrentTables=yes host="localhost" database="openstreetmap" user="openstreetmap" password="xxxxx" validateSchemaVersion=no<br>
<br>I'm getting the following types of errors ( depending on the osm file used ) :<br><br>Using Ecuador osm file form Cloudmade at Feb 8, 2011 :<br>SEVERE: Thread for task 1-read-xml-0.6 failed<br>org.openstreetmap.osmosis.core.OsmosisRuntimeException: Unable to insert user with id 222199 into the database.<br>
Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "users_display_name_idx"<br><br>Using Ghana osm file form Cloudmade at Feb 8, 2011 :<br>SEVERE: Thread for task 1-read-xml-0.6 failed<br>
org.openstreetmap.osmosis.core.OsmosisRuntimeException: Unable to load current way nodes.<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)=(24152848) is not present in table "current_nodes"<br>
<br>Using the osm file result of the extract sentence I've writed earlier :<br>SEVERE: Thread for task 1-read-xml-0.6 failed<br>
org.openstreetmap.osmosis.core.OsmosisRuntimeException: Unable to load current way nodes.<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>Using Spain osm file from Cloudmade at Feb 8, 2011 :<br>All ok. I can use JOSM to access ( and even change ) the data from the API DB.<br><br>The API BD is always new ( dropdb : createdb : rake db:migrate : rake test ) before the population senteces.<br>
<br>What I'm doing wrong ?<br><br><br>
<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>