<div>After executing:</div><div>$ osmosis --rb file="/home/historic/data/planet-natural.pbf" --wd user="openstreetmap" password="openstreetmap" database="osm" validateSchemaVersion=no</div>
<div><br></div><div>I'm running into the following error:</div><div>(full excerpt below)</div><div><div>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"</div>
<div>  Detail: Key (node_id)=(25918312) is not present in table "current_nodes".</div></div><div><br></div><div>Most of what I can find about this on the intrawebs indicates that this is typically a bbox-related issue, but I haven't used any bboxes to create my planet-natural file. (see steps below)</div>
<div><br></div><div>Any guesses / suggestions / obvious things I'm missing?</div><div><br></div><div>Here's the sequence I've used to generate the planet-natural.pbf file - my goal is to cut down the size of the file and retain only big waterways and natural features - just ways and relations, no nodes. I believe osmfilter should keep nodes required by ways and relations, but could be wrong there.</div>
<div><br></div><div><div>$ osmconvert planet-121226.osm.pbf -o=planet.o5m</div><div>$ ./osmfilter planet.o5m --drop-tags="created_by= nhd:*= yf:*= canvec:*= gnis:*= NHD:*= KSJ2:*= massgis:*=" --drop-author --drop="natural=wood waterway=drain or waterway=ditch or waterway=stream or leisure=park" -o=planet-natural-temp1.o5m</div>
<div>$ ./osmfilter planet-natural-temp1.o5m --keep= --keep-ways="natural= or waterway=" --keep-relations="natural= or waterway=" -o=planet-natural-temp2.o5m</div><div>$ ./osmconvert planet-natural-temp2.o5m -o=planet-natural.pbf</div>
</div><div><br></div><div>Thanks, Jeff</div><div><br></div><div><br></div><div><br></div><div>Osmosis error:</div><div><br></div><div>SEVERE: Thread for task 1-rb failed</div><div>org.openstreetmap.osmosis.core.OsmosisRuntimeException: Unable to load current way nodes.</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>at org.openstreetmap.osmosis.apidb.v0_6.ApidbWriter.populateCurrentWays(ApidbWriter.java:980)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>at org.openstreetmap.osmosis.apidb.v0_6.ApidbWriter.populateCurrentTables(ApidbWriter.java:1031)</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>at org.openstreetmap.osmosis.apidb.v0_6.ApidbWriter.complete(ApidbWriter.java:1064)</div><div><span class="Apple-tab-span" style="white-space:pre">  </span>at crosby.binary.osmosis.OsmosisBinaryParser.complete(OsmosisBinaryParser.java:35)</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>at crosby.binary.file.BlockInputStream.process(BlockInputStream.java:37)</div><div><span class="Apple-tab-span" style="white-space:pre">     </span>at crosby.binary.osmosis.OsmosisReader.run(OsmosisReader.java:45)</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>at java.lang.Thread.run(Thread.java:679)</div><div>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"</div>
<div>  Detail: Key (node_id)=(25918312) is not present in table "current_nodes".</div><div><span class="Apple-tab-span" style="white-space:pre">  </span>at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102)</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835)</div><div><span class="Apple-tab-span" style="white-space:pre">      </span>at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:500)</div><div><span class="Apple-tab-span" style="white-space:pre">      </span>at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:388)</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:381)</div><div><span class="Apple-tab-span" style="white-space:pre">      </span>at org.openstreetmap.osmosis.apidb.v0_6.ApidbWriter.populateCurrentWays(ApidbWriter.java:977)</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>... 6 more</div><div>Jan 3, 2013 7:41:55 PM org.openstreetmap.osmosis.core.Osmosis main</div><div>SEVERE: Execution aborted.</div><div>org.openstreetmap.osmosis.core.OsmosisRuntimeException: One or more tasks failed.</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>at org.openstreetmap.osmosis.core.pipeline.common.Pipeline.waitForCompletion(Pipeline.java:146)</div><div><span class="Apple-tab-span" style="white-space:pre">      </span>at org.openstreetmap.osmosis.core.Osmosis.run(Osmosis.java:92)</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>at org.openstreetmap.osmosis.core.Osmosis.main(Osmosis.java:37)</div><div><span class="Apple-tab-span" style="white-space:pre">      </span>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)</div><div><span class="Apple-tab-span" style="white-space:pre">     </span>at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>at java.lang.reflect.Method.invoke(Method.java:616)</div><div><span class="Apple-tab-span" style="white-space:pre">  </span>at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)</div><div><span class="Apple-tab-span" style="white-space:pre">       </span>at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>at org.codehaus.classworlds.Launcher.main(Launcher.java:47)</div>
<div><br></div>-- <br><font size="1">Jeff Meyer<br>Global World History Atlas<br><a href="http://www.gwhat.org" target="_blank">www.gwhat.org</a><br><a href="mailto:jeff@gwhat.org" target="_blank">jeff@gwhat.org</a><br>206-676-2347</font><div>
<font size="1"><a href="http://www.openstreetmap.org/user/jeffmeyer" target="_blank">www.openstreetmap.org/user/jeffmeyer</a></font></div><div><font size="1"><br></font><br></div>