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.
Could the duplicate values be a result of a bug while extracting a bbox with
osmosis?
Is there a way around those duplicate entries, like perhaps overwriting
duplicate data? Going through all those entries manually seems almost
impossible.
Date: Tue, 4 May 2010 09:26:40 +1000
Subject: Re: [osmosis-dev] Can't load osm file to PostGRESql
From: [email protected]
To: [email protected]
CC: [email protected]
On Tue, May 4, 2010 at 12:30 AM, Ibrahim Bouchrika
<[email protected]> wrote:
Hi,
I'm trying to load a osm file to my postgresql database.
I'm working on a windows xp system with dual core and 3GB of RAM and about 10GB
of free space.
I downloaded the netherlands.osm file from cloudmade.com, and extracted
Amsterdam (which is now slightly bigger than 6MB) using Osmosis' latest version
0.35 :
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
This worked without issues.
I then proceeded loading the 0.6 schema and the linestring schema into a
PostGIS database.
After that I tried using the command line to load the extracted city into this
database, using next command:
C:\osmosis-0.35\bin>osmosis --read-xml amsterdam.osm --write-pgsql
host="127.0.0.1:5432" database="Amsterdam" user="postgres"
password="1kilnmouth"enableLinestringBuilder="yes"
nodeLocationStoreType="TempFile"
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.
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)
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.
SEVERE: Thread for task 1-read-xml failed
org.openstreetmap.osmosis.core.OsmosisRuntimeException: Unable to execute statem
ent.
at org.openstreetmap.osmosis.core.pgsql.common.DatabaseContext.executeSt
atement(DatabaseContext.java:107)
at org.openstreetmap.osmosis.core.pgsql.v0_6.PostgreSqlWriter.complete(P
ostgreSqlWriter.java:835)
at org.openstreetmap.osmosis.core.xml.v0_6.XmlReader.run(XmlReader.java:
110)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.postgresql.util.PSQLException: ERROR: could not create unique ind
ex "pk_ways"
Detail: Table contains duplicated values.
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryEx
ecutorImpl.java:1592)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutor
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.
Brett
_________________________________________________________________
Hotmail is redefining busy with tools for the New Busy. Get more from your
inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2_______________________________________________
osmosis-dev mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/osmosis-dev