Hi Andreas,<br><br><div class="gmail_quote">On Sun, Nov 21, 2010 at 12:54 AM, Andreas Kalsch <span dir="ltr"><<a href="mailto:andreaskalsch@gmx.de">andreaskalsch@gmx.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div text="#000000" bgcolor="#ffffff">
Hi,<br>
<br>
thank you, Brett, for me this is the perfect setup. I hope that
others will find it useful as well. The names are OK. Two problems:<br>
<br>
1) I read XML or PBF, dump it to CSV and then read the dump, but now
my feature tables are blank because of these errors:<br>
<br>
ERROR: extra data after last expected column<br>
CONTEXT: COPY nodes, line 1: "125799 5 45445 2010-09-30
21:23:30+0200 5922698
0101000020E610000034034B64D592214088BE164F98894A40"<br>
ERROR: extra data after last expected column<br>
CONTEXT: COPY ways, line 1: "3999478 17 4473 1970-01-07
21:53:09+0100 4957195
"mapping_status"=>"incomplete","highway"=>"secondar..."<br>
ERROR: extra data after last expected column<br>
CONTEXT: COPY relations, line 1: "2952 23 29975 1970-01-15
10:56:44+0100 5014762 "type"=>"multipolygon""<br>
<br>
I use COPY instead of \copy like this:<br>
<br>
COPY nodes FROM 'path/to/nodes.txt';<br>
...<br>
<br>
I don't know why this happens. The number and type of columns of the
simple schema table and the CSV do fit.<br>
<br>
Reading straight into database works (but is much slower).<br></div></blockquote><div><br>I don't know what the issue could be here. But there must be a mismatch between table columns and the dump file. Perhaps the order is different?<br>
</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div text="#000000" bgcolor="#ffffff">
<br>
2) <span>--write-pgsimp-change</span><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="font-size: 13px; line-height: 19px;"></span></span>
results in this error log:<br>
<br>
Nov 20, 2010 2:49:20 PM org.openstreetmap.osmosis.core.Osmosis run<br>
INFO: Osmosis Version SNAPSHOT-r24310<br>
Nov 20, 2010 2:49:20 PM org.openstreetmap.osmosis.core.Osmosis run<br>
INFO: Preparing pipeline.<br>
Nov 20, 2010 2:49:20 PM org.openstreetmap.osmosis.core.Osmosis run<br>
INFO: Launching pipeline execution.<br>
Nov 20, 2010 2:49:20 PM org.openstreetmap.osmosis.core.Osmosis run<br>
INFO: Pipeline executing, waiting for completion.<br>
Nov 20, 2010 2:49:23 PM
org.openstreetmap.osmosis.core.pipeline.common.ActiveTaskManager
waitForCompletion<br>
SEVERE: Thread for task 1-read-replication-interval failed<br>
org.openstreetmap.osmosis.core.OsmosisRuntimeException: Unable to
insert action with type=NODE, action=MODIFY and id=996097244.<br>
at
org.openstreetmap.osmosis.pgsimple.v0_6.impl.ActionDao.addAction(ActionDao.java:80)<br>
at
org.openstreetmap.osmosis.pgsimple.v0_6.impl.EntityDao.modifyEntity(EntityDao.java:263)<br>
at
org.openstreetmap.osmosis.pgsimple.v0_6.impl.NodeDao.modifyEntity(NodeDao.java:74)<br>
at
org.openstreetmap.osmosis.pgsimple.v0_6.impl.ChangeWriter.write(ChangeWriter.java:123)<br>
at
org.openstreetmap.osmosis.pgsimple.v0_6.impl.ActionChangeWriter.process(ActionChangeWriter.java:48)<br>
at
org.openstreetmap.osmosis.core.container.v0_6.NodeContainer.process(NodeContainer.java:58)<br>
at
org.openstreetmap.osmosis.pgsimple.v0_6.PostgreSqlChangeWriter.process(PostgreSqlChangeWriter.java:71)<br>
at
org.openstreetmap.osmosis.core.sort.v0_6.ChangeSorter.complete(ChangeSorter.java:64)<br>
at
org.openstreetmap.osmosis.replication.v0_6.ReplicationDownloader.processComplete(ReplicationDownloader.java:93)<br>
at
org.openstreetmap.osmosis.replication.v0_6.BaseReplicationDownloader.runImpl(BaseReplicationDownloader.java:284)<br>
at
org.openstreetmap.osmosis.replication.v0_6.BaseReplicationDownloader.run(BaseReplicationDownloader.java:345)<br>
at java.lang.Thread.run(Thread.java:619)<br>
Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key
value violates unique constraint "pk_actions"<br>
at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062)<br>
at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795)<br>
at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)<br>
at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)<br>
at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:367)<br>
at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:321)<br>
at
org.openstreetmap.osmosis.pgsimple.v0_6.impl.ActionDao.addAction(ActionDao.java:77)<br>
... 11 more<br>
Nov 20, 2010 2:49:23 PM org.openstreetmap.osmosis.core.Osmosis main<br>
SEVERE: Execution aborted.<br>
org.openstreetmap.osmosis.core.OsmosisRuntimeException: One or more
tasks failed.<br>
at
org.openstreetmap.osmosis.core.pipeline.common.Pipeline.waitForCompletion(Pipeline.java:146)<br>
at org.openstreetmap.osmosis.core.Osmosis.run(Osmosis.java:92)<br>
at org.openstreetmap.osmosis.core.Osmosis.main(Osmosis.java:37)<br>
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br>
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br>
at java.lang.reflect.Method.invoke(Method.java:597)<br>
at
org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)<br>
at
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)<br>
at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)<br>
at
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)<br>
at org.codehaus.classworlds.Launcher.main(Launcher.java:31)<br>
<br>
Is it always guaranteed that a change for datatype/id is unique?<br></div></blockquote><div><br>If using minutely updates then it is not guaranteed. But the action table requires it. The solution is to pass the change data through the --simplify-change task before applying it to the database.<br>
<br>Incidentally this is also the reason that I can't support a non-truncating action table feature without making changes to the actions table definition.<br><br>Brett<br></div></div><br>