<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Ack, I forgot version information:<br>
<tt>SELECT version() || ' ' || postgis_full_version();</tt><tt><br>
</tt><tt>
?column? <font color="#ff0000"> </font>
</tt><tt><br>
</tt><tt>--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</tt><tt><br>
</tt><tt> PostgreSQL 9.3.13 on x86_64-unknown-linux-gnu, compiled by
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4, 64-bit POSTGIS="2.1.2
r12389" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.8.0, 6 March
2012" GDAL="GDAL 1.10.1, released 2013/08/26" LIBXML="2.9.1"
LIBJSON="UNKNOWN" TOPOLOGY RASTER</tt><tt><br>
</tt><tt>(1 row)</tt><br>
<br>
- brian<br>
<br>
<div class="moz-cite-prefix">On 07/21/2016 10:04 AM, Brian wrote:<br>
</div>
<blockquote cite="mid:5790E46C.5020500@occinc.com" type="cite">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
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>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Brian Peschel
One Call Concepts, Inc
Systems Division
Voice: 414-259-1047 ext. 93
Fax: 414-777-3666 </pre>
</body>
</html>