<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Importing into an OSM instance is always problematic due to the foreign
key relationships.  They're a good idea in the central database, but
difficult to satisfy when working offline with extracts and changesets.<br>
<br>
OPTION 1<br>
If you're just trying to import a one off extract into the database you
can use osmosis to fix the referential integrity problems.<br>
osmosis --rx myfile.osm.gz --bbox clipIncompleteEntities=true --wx
myfixedfile.osm.gz<br>
<br>
That should modify ways to only refer to nodes that actually exist.  No
coordinates have been passed to the bbox task so it will select the
entire planet (or in this case, the entire input file).  Note that
modified ways will no longer match the main API ways exactly so they
should never be uploaded back to the main database.<br>
<br>
OPTION 2<br>
If you wish to apply changesets to your database to keep it up to date
you'll probably need to drop the problematic foreign key relationships.<br>
<br>
Brett<br>
<br>
Mikel Maron wrote:
<blockquote cite="mid:755053.80336.qm@web30808.mail.mud.yahoo.com"
 type="cite">
  <style type="text/css"><!-- DIV {margin:0px;} --></style>
  <div
 style="font-family: times new roman,new york,times,serif; font-size: 12pt;">
  <div>Trying to import into psql for an OSM dev instance. Using
osmosis.<br>
  </div>
  <div
 style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br>
  <div
 style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font
 face="Tahoma" size="2">
  <hr size="1"><b><span style="font-weight: bold;">From:</span></b>
Shaun McDonald <a class="moz-txt-link-rfc2396E" href="mailto:shaun@shaunmcdonald.me.uk"><shaun@shaunmcdonald.me.uk></a><br>
  <b><span style="font-weight: bold;">To:</span></b> Mikel Maron
<a class="moz-txt-link-rfc2396E" href="mailto:mikel_maron@yahoo.com"><mikel_maron@yahoo.com></a><br>
  <b><span style="font-weight: bold;">Cc:</span></b>
<a class="moz-txt-link-abbreviated" href="mailto:dev@openstreetmap.org">dev@openstreetmap.org</a><br>
  <b><span style="font-weight: bold;">Sent:</span></b> Thursday, July
30, 2009 4:30:22 PM<br>
  <b><span style="font-weight: bold;">Subject:</span></b> Re: [OSM-dev]
CloudMade OSM download problems<br>
  </font><br>
What are you trying to import the extracts into?
  <div><br>
  </div>
  <div>Shaun</div>
  <div><br>
  <div>
  <div>On 30 Jul 2009, at 20:47, Mikel Maron wrote:</div>
  <br class="Apple-interchange-newline">
  <blockquote type="cite"><span class="Apple-style-span"
 style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
    <div>
    <div
 style="margin: 0px; font-family: 'times new roman','new york',times,serif; font-size: 12pt; color: rgb(0, 0, 0);">
    <div style="margin: 0px;">Hi<br>
    <br>
Anyone else have issues with the latest .OSM extracts from CloudMade?<br>
    <br>
I've tried importing Pakistan and California locally, and both files
have references to nodes that aren't present.<br>
    <br>
Fortunately GeoFabrik has a Pakistan extract that works. If anyone can
help with a California extract, that would be super.<br>
    <br>
-Mikel<br>
    </div>
    </div>
_______________________________________________<br>
dev mailing list<br>
    <a moz-do-not-send="true" rel="nofollow"
 ymailto="mailto:dev@openstreetmap.org" target="_blank"
 href="mailto:dev@openstreetmap.org">dev@openstreetmap.org</a><br>
    <span><a moz-do-not-send="true" target="_blank"
 href="http://lists.openstreetmap.org/listinfo/dev">http://lists.openstreetmap.org/listinfo/dev</a></span><br>
    </div>
    </span></blockquote>
  </div>
  <br>
  </div>
  </div>
  </div>
  </div>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:dev@openstreetmap.org">dev@openstreetmap.org</a>
<a class="moz-txt-link-freetext" href="http://lists.openstreetmap.org/listinfo/dev">http://lists.openstreetmap.org/listinfo/dev</a>
  </pre>
</blockquote>
<br>
</body>
</html>