<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Not sure I understand what is happening here.<br>
    <br>
    I have a geom:<br>
    <tt>select * from my_temp ;</tt><tt><br>
    </tt><tt>                                                                                                                                                                                               
      geom                                                                                                                                                                                               
    </tt><tt><br>
    </tt><tt>----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</tt><tt><br>
    </tt><tt> 0103000020AD100000010000000B0000006D514CC326AC57C029776BF2CF214440B742588D25AC57C0D7F84CF6CF2144406E514CC326AC57C029776BF2CF21444015CCF33B28AC57C084FAF1F2CF2144405748540328AC57C096010C70E621444090EC5BF720AC57C0D8C2876DE62144409C3B551921AC57C0AFFE19EFD8214440F555A82421AC57C0043D2F70D42144401508BE2F21AC57C07110D308D02144404E70FB2F21AC57C0C5BB6DF0CF2144406D514CC326AC57C029776BF2CF214440</tt><tt><br>
    </tt><br>
    Which PostGIS says is valid:<br>
    <tt>select st_isvalid(geom) from my_temp ;</tt><tt><br>
    </tt><tt> st_isvalid </tt><tt><br>
    </tt><tt>------------</tt><tt><br>
    </tt><tt> t</tt><tt><br>
    </tt><tt>(1 row)</tt><br>
    <br>
    I then convert to a format I can read:<br>
    <tt>select st_astext(geom) from my_temp ;</tt><tt><br>
    </tt><tt>                                                                                                                                                      
      st_astext                                                                                                                                                      
    </tt><tt><br>
    </tt><tt>-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</tt><tt><br>
    </tt><tt> POLYGON((</tt><tt><font color="#ff0000">-94.6898658986372
        40.2641585373625</font></tt><tt>,-94.689792 40.264159,</tt><tt><font
        color="#ff0000">-94.6898658986372 40.2641585373625</font></tt><tt>,-94.6899557
      40.2641586,-94.6899422 40.2648449,-94.6895121
      40.2648446,-94.6895202 40.2644328,-94.6895229
      40.2642956,-94.6895255428102 40.2641612082088,-94.6895256
      40.2641583,-94.6898658986372 40.2641585373625))</tt><tt><br>
    </tt><tt>(1 row)</tt><br>
    <br>
    But that isn't valid.  It is self intersecting (point 1 and point 3
    repeat).  And if I check the validity of the st_astext version:<br>
    <tt>select st_isvalid(geom),
      st_isvalid(st_geomfromtext(st_astext(geom), 4269)) from my_temp;</tt><tt><br>
    </tt><tt>NOTICE:  Self-intersection at or near point
      -94.689865898637194 40.264158537362498</tt><tt><br>
    </tt><tt> st_isvalid | st_isvalid </tt><tt><br>
    </tt><tt>------------+------------</tt><tt><br>
    </tt><tt> t          | f</tt><tt><br>
    </tt><tt>(1 row)</tt><tt><br>
    </tt><br>
    Any idea what is going on here and how can I prevent it?<br>
    <br>
    TIA!<br>
    - brian<br>
  </body>
</html>