<meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">Hi All,</span><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">

<span class="Apple-style-span" style="background-color: rgb(255, 255, 255);"><br></span></div><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);">I sent this to the newbies list, but it might belong better here.</span></div>

<div><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);"><br></span></div><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">

<span class="Apple-style-span" style="background-color: rgb(255, 255, 255);">I'm trying to load OSM data for the USA into PostGres 9.0 with PostGIS. Downloaded the .pbf extracts for the different US regions from Geofabrik, combined them with Osmosis, and wrote the result to uncompressed XML like so:</span></div>

<div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);"><br></span></div></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">

<div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); border-collapse: collapse;"><font class="Apple-style-span" face="arial, sans-serif">osmosis --rb us-pacific.osm.pbf --rb us-northeast.osm.pbf --rb us-south.osm.pbf --rb us-midwest.osm.pbf --rb us-west.osm.pbf --merge --merge --merge --merge --wb USA.osm.pbf</font></span></div>

</div><div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">osmosis --rb USA.osm.pbf --wx USA.osm</span></font></div></div></blockquote><div><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">

<span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br></span></div><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);">Now, <span class="il" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(34, 34, 34); ">osm2pgsql</span> fails with the following error:</span></div>

<div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);"><br></span></div><blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">

<div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);">Processing: Node(62940k) Way(0k) Relation(0k)pgsql_nodes_set - bad result during COPY, data 114176303   415528523       -914342252      \N</span></div>

</div></blockquote><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);"><br></span></div><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">

<span class="Apple-style-span" style="background-color: rgb(255, 255, 255);">Command was:</span></div><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);"><br>

</span></div><blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">

<div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);"><span class="il" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(34, 34, 34); ">osm2pgsql</span> -S ../<span class="il" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(34, 34, 34); ">osm2pgsql</span>/<a href="http://default.st">default.st</a></span>yle --slim -d gis -C 2048 ~/OSM/workdir/USA.osm</div>

<div><br></div></blockquote><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">Machine has tons of memory, and running htop during the most recent attempt, I didn't get anywhere near close to maxing out.</span></font></div>

<div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><span style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><div><br></div><div>More curiously, when I try to use one of the Geofabrik .pbf extracts directly, without doing the merging first, the import goes just fine. i.e. the following succeeds:</div>

<div><br></div></span></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><span style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><div>

<div>osm2pgsql -S ../osm2pgsql/default.style --slim -d gis -C 2048 -r pbf /home/will/OSM/workdir/us-pacific.osm.pbf </div></div></span></div></blockquote><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">

<span style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><div><br></div><div>Do you think this might have something to do with the merging of the different extracts corrupting the data somehow? I've searched around for the answer, and found this thread, but it hasn't helped:</div>

<div><br></div><div><a href="http://www.mail-archive.com/dev@openstreetmap.org/msg11280.html" target="_blank" style="color: rgb(0, 0, 204); ">http://www.mail-archive.com/dev@openstreetmap.org/msg11280.html</a></div><div>
<br>
</div><div>Thanks,<br><font color="#888888"><font color="#888888"><font color="#888888">Will</font></font></font></div></span><br></div>