<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
The database i'm using is a fresh made one, so the error must be duplicate entries in the osm. I have the same problem with a duplicate relation in the new york city file i extracted from a cloudmade map.<br><br>Could the duplicate values be a result of a bug while extracting a bbox with osmosis?<br><br>Is there a way around those duplicate entries, like perhaps overwriting duplicate data? Going through all those entries manually seems almost impossible.<br><br><hr id="stopSpelling">Date: Tue, 4 May 2010 09:26:40 +1000<br>Subject: Re: [osmosis-dev] Can't load osm file to PostGRESql<br>From: brett@bretth.com<br>To: ibrahim_bouchrika@hotmail.com<br>CC: osmosis-dev@openstreetmap.org<br><br><div class="ecxgmail_quote">On Tue, May 4, 2010 at 12:30 AM, Ibrahim Bouchrika <span dir="ltr"><<a href="mailto:ibrahim_bouchrika@hotmail.com">ibrahim_bouchrika@hotmail.com</a>></span> wrote:<br><blockquote class="ecxgmail_quote" style="padding-left: 1ex;">




<div>
Hi,<br><br>I'm trying to load a osm file to my postgresql database.<br><br>I'm working on a windows xp system with dual core and 3GB of RAM and about 10GB of free space.<br><br>I downloaded the netherlands.osm file from <a href="http://cloudmade.com">cloudmade.com</a>, and extracted Amsterdam (which is now slightly bigger than 6MB) using Osmosis' latest version 0.35 :<br>
<br>C:\osmosis-0.35\bin>osmosis --read-xml file="netherlands.osm" --bb left="4.8828" top="52.3927" right="4.9501" bottom="52.3654" clipIncompleteEntities=true idTrackerType=BitSet --write-xml amsterdam.osm<br>
<br>This worked without issues.<br><br>I then proceeded loading the 0.6 schema and the linestring schema into a PostGIS database.<br>After that I tried using the command line to load the extracted city into this database, using next command:<br>
<br>C:\osmosis-0.35\bin>osmosis --read-xml amsterdam.osm --write-pgsql host="<a href="http://127.0.0.1:5432">127.0.0.1:5432</a>" database="Amsterdam" user="postgres" password="1kilnmouth"enableLinestringBuilder="yes" nodeLocationStoreType="TempFile"<br>
<br>This used to work without issues (Last time I used it was a few months less then a year ago, but now it doesn't seem to work anymore, while the only thing that changed is the country/city i'm trying to load. I used to use version 0.31.1, which back then worked, but now doesn't seem to do the trick anymore. That's why I switched to the newest release, which doesn't seem to solve the problem.<br>
<br>I copied the output below (excuse me for posting the whole printout, but I don't know for sure which information is relevant and which is not)<br><br>Could anyone tell me how I can get by this problem? 'cause it's really bugging me that something which worked before now all of the sudden doesn't cut it.<br>
<br></div></blockquote><div><br> </div><blockquote class="ecxgmail_quote" style="padding-left: 1ex;"><div>SEVERE: Thread for task 1-read-xml failed<br>org.openstreetmap.osmosis.core.OsmosisRuntimeException: Unable to execute statem<br>
ent.<br>        at org.openstreetmap.osmosis.core.pgsql.common.DatabaseContext.executeSt<br>atement(DatabaseContext.java:107)<br>        at org.openstreetmap.osmosis.core.pgsql.v0_6.PostgreSqlWriter.complete(P<br>ostgreSqlWriter.java:835)<br>
        at org.openstreetmap.osmosis.core.xml.v0_6.XmlReader.run(XmlReader.java:<br>110)<br>        at java.lang.Thread.run(Thread.java:619)<br>Caused by: org.postgresql.util.PSQLException: ERROR: could not create unique ind<br>
ex "pk_ways"<br>  Detail: Table contains duplicated values.<br>        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryEx<br>ecutorImpl.java:1592)<br>        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutor<br>
</div></blockquote></div><br><br>The error message above is stating that you are trying to insert a way twice.  This could be because your database already contains data, or that your data file contains multiple copies of the same way.<br>
<br>Brett<br>                                         <br /><hr />Hotmail is redefining busy with tools for the New Busy. Get more from your inbox. <a href='http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2' target='_new'>See how.</a></body>
</html>