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

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<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:green;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@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=green>

<div class=Section1>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Is there a known bug when translating data from postgreSQL
to an ESRI shapefile?<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 am trying to do it using a sql statement as follows:<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'>&gt;ogr2ogr &#8211;f &#8220;ESRI Shapefile&#8221; skamaniacounty.shp
&#8220;PG:dbname=dcmms host=localhost user=postgres password=password&#8221; &#8211;sql
&#8220;select * from wacounties a, wacounties b where b.county_nm=&#8217;Skamania&#8217;
and a.wkb_geometry &amp;&amp; b.wkb_geometry and distance(a.wkb_geometry,
b.wkb_geometry) = 0;&#8221;<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'>After a few moments I get a Microsoft Windows error report
popup stating that ogr2ogr.exe has encountered a problem and needs to close. However
if I execute the exact same line replacing &#8220;*&#8221; with &#8220;a.county_nm&#8221;
it works. It&#8217;s not the &#8220;*&#8221; because I also tried spelling out
all of the field names. Here is a list of the fields in the wacounties: ogc_fid
:: int, wkb_geometry :: geometry, area :: float, perimeter :: float, wacounties
:: int, wacounti_1 :: int, county_cod :: int, county_fip :: varchar, county_nm
:: varchar, ecy_region :: varchar, air_region :: varchar, shape_leng :: float,
shape_area :: float. I am assuming it is because of either the ogc_fid field or
the wkb_geometry field but I have no idea why. Any ideas would be great.<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'>Thank you,<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'>Frances Collier<o:p></o:p></span></font></p>

</div>

</body>

</html>