<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="PlaceName" downloadurl="http://www.5iantlavalamp.com/"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="PlaceType" downloadurl="http://www.5iantlavalamp.com/"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="place" downloadurl="http://www.5iantlavalamp.com/"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:Arial;
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Hi,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
As an experiment I&#8217;m attempting to import USGS NHD data <a
href="ftp://nhdftp.usgs.gov/SubRegions/">ftp://nhdftp.usgs.gov/SubRegions/</a>
&nbsp;into PostGIS. </span></font><font size=2 color=black face=Arial><span
lang=EN style='font-size:10.0pt;font-family:Arial;color:black'>The NHD data
comes as ESRI geodatabase .mdb files. I was glad to see that ogr2ogr now
supports ESRI geodatabase mdb format, so I tried using </span></font><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>ogr2ogr
1.4.0 in </span></font><font size=2 color=black face=Arial><span lang=EN
style='font-size:10.0pt;font-family:Arial;color:black'>FWTools 1.1.3, but ran
into some problems.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=black face=Arial><span lang=EN
style='font-size:10.0pt;font-family:Arial;color:black'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=black face=Arial><span lang=EN
style='font-size:10.0pt;font-family:Arial;color:black'>Using:<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 color=black
face=Arial><span lang=EN style='font-size:10.0pt;font-family:Arial;color:black'>Windows
2003<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 color=black
face=Arial><span lang=EN style='font-size:10.0pt;font-family:Arial;color:black'>PostgreSQL
8.1<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 color=black
face=Arial><span lang=EN style='font-size:10.0pt;font-family:Arial;color:black'>postgis-1.1.3<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 color=black
face=Arial><span lang=EN style='font-size:10.0pt;font-family:Arial;color:black'>FWTools
1.1.3<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>ogr2ogr 1.4.0<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>First, I used this shell command:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>ogr2ogr -f PostgreSQL PG:&quot;user=user dbname=NHD
host=localhost password=password port=5432&quot; D:\NHD\NHDH0101\NHDH0101.mdb<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>The translation went smoothly without apparent error resulting
in a set of tables with geometry_columns entries:<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&quot;8012398&quot;;&quot;''&quot;;&quot;public&quot;;&quot;Basin&quot;;&quot;wkb_geometry&quot;;&quot;2&quot;;&quot;32767&quot;;&quot;GEOMETRY&quot;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&quot;8012493&quot;;&quot;''&quot;;&quot;public&quot;;&quot;HYDRO_NET_Junctions&quot;;&quot;wkb_geometry&quot;;&quot;2&quot;;&quot;32767&quot;;&quot;GEOMETRY&quot;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&quot;8009168&quot;;&quot;''&quot;;&quot;public&quot;;&quot;NHDArea&quot;;&quot;wkb_geometry&quot;;&quot;2&quot;;&quot;32767&quot;;&quot;GEOMETRY&quot;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&quot;8009194&quot;;&quot;''&quot;;&quot;public&quot;;&quot;NHDFlowline&quot;;&quot;wkb_geometry&quot;;&quot;2&quot;;&quot;32767&quot;;&quot;GEOMETRY&quot;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&quot;8012333&quot;;&quot;''&quot;;&quot;public&quot;;&quot;NHDLine&quot;;&quot;wkb_geometry&quot;;&quot;2&quot;;&quot;32767&quot;;&quot;GEOMETRY&quot;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&quot;8012359&quot;;&quot;''&quot;;&quot;public&quot;;&quot;NHDLineEventFC&quot;;&quot;wkb_geometry&quot;;&quot;2&quot;;&quot;32767&quot;;&quot;GEOMETRY&quot;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&quot;8012346&quot;;&quot;''&quot;;&quot;public&quot;;&quot;NHDPoint&quot;;&quot;wkb_geometry&quot;;&quot;2&quot;;&quot;32767&quot;;&quot;GEOMETRY&quot;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&quot;8012372&quot;;&quot;''&quot;;&quot;public&quot;;&quot;NHDPointEventFC&quot;;&quot;wkb_geometry&quot;;&quot;2&quot;;&quot;32767&quot;;&quot;GEOMETRY&quot;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&quot;8009181&quot;;&quot;''&quot;;&quot;public&quot;;&quot;NHDWaterbody&quot;;&quot;wkb_geometry&quot;;&quot;2&quot;;&quot;32767&quot;;&quot;GEOMETRY&quot;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&quot;8012385&quot;;&quot;''&quot;;&quot;public&quot;;&quot;Region&quot;;&quot;wkb_geometry&quot;;&quot;2&quot;;&quot;32767&quot;;&quot;GEOMETRY&quot;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&quot;8012436&quot;;&quot;''&quot;;&quot;public&quot;;&quot;Subbasin&quot;;&quot;wkb_geometry&quot;;&quot;2&quot;;&quot;32767&quot;;&quot;GEOMETRY&quot;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&quot;8012417&quot;;&quot;''&quot;;&quot;public&quot;;&quot;Subregion&quot;;&quot;wkb_geometry&quot;;&quot;2&quot;;&quot;32767&quot;;&quot;GEOMETRY&quot;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&quot;8012480&quot;;&quot;''&quot;;&quot;public&quot;;&quot;Subwatershed&quot;;&quot;wkb_geometry&quot;;&quot;2&quot;;&quot;32767&quot;;&quot;GEOMETRY&quot;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>&quot;8012467&quot;;&quot;''&quot;;&quot;public&quot;;&quot;Watershed&quot;;&quot;wkb_geometry&quot;;&quot;2&quot;;&quot;32767&quot;;&quot;GEOMETRY&quot;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>However, several of the tables, but not all, have empty
wkb_geometry columns. In addition a couple of tables have incompletely
translated wkb_geometry with only some rows containing data. There were no
errors shown in the output.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I then tried using an ODBC DSN for a specific table:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>ogr2ogr -f PostgreSQL &#8211;update &#8211;overwrite
PG:&quot;user=user dbname=NHD host=localhost password=password port=5432&quot;
PGeo:<st1:place w:st="on"><st1:PlaceName w:st="on">NHD</st1:PlaceName> <st1:PlaceType
 w:st="on">Basin</st1:PlaceType></st1:place> <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>but the resulting Basin.wkb_geometry was still empty. <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>The NHD geodatabase MS Access mdb file does have long binary
data in the Shape column. I verified that the geometry Shape column is not
empty using my own geodatabase to svg translator. The resulting &lt;path&gt;
elements appear to be valid?<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Has anyone else run into this type of problem using ogr to
access a geodatabase? Perhaps I&#8217;m missing a required parameter?<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Thanks<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Randy<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 color=black
face=Arial><span lang=EN style='font-size:10.0pt;font-family:Arial;color:black'><o:p>&nbsp;</o:p></span></font></p>

</div>

</body>

</html>