<div dir="ltr">There is something wrong with your first polygon. go here ...<div><a href="https://www.mathsisfun.com/geometry/polygons-interactive.html">https://www.mathsisfun.com/geometry/polygons-interactive.html</a></div><div><br><div>and put in this (-3.577895,53.954289)(0.816178,54.779474)(2.624587, 51.01611)(0.702327,50.669834)(-1.425339,50.243136)(-1.424992,50.243209)(-3.577895,53.954289)</div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 15, 2016 at 6:53 AM, Graham Glanfield <span dir="ltr"><<a href="mailto:graham.glanfield@geocento.com" target="_blank">graham.glanfield@geocento.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  

    
  
  <div bgcolor="#FFFFFF" text="#000000">
    Dear list,<br>
    <br>
    The following query:<br>
    <br>
    <span>SELECT ST_intersection(st_geometryfromtext(('MULTIPOLYGON(((-3.577895
      53.954289,0.816178 54.779474,2.624587 51.01611,0.702327
      50.669834,-1.425339 50.243136,-1.424992 50.243209,-3.577895
      53.954289)))'),4326)::geography,st_geometryfromtext(('POLYGON((-0.38928
      51.5446,-0.1703 51.5446,-0.1703 51.389328,-0.38928
      51.389328,-0.38928 51.5446))'),4326)::geography);<br>
    </span><br>
    fails with the following error:<br>
    "ERROR:  Error performing intersection: TopologyException: Input
    geom 0 is invalid: Self-intersection at or near point
    1482705.9601906976 781580.61046449794 at 1482705.9601906976
    781580.61046449794"<br>
    <span><br>
      If I remove "::geography" from both geometry's, it works. It also
      works if I add a small buffer to the first geometry. Postgis
      reports that both geometry's are valid.<br>
      <br>
      I'm running:<br>
    </span><br>
    <span>PostgreSQL 9.4.1 on x86_64-unknown-linux-gnu, compiled by gcc
      (GCC) 4.8.2 20140120 (Red Hat 4.8.2-16), 64-bit POSTGIS="2.1.5
      r13152" GEOS<br>
      ="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.8.0, 6 March 2012"
      GDAL="GDAL 1.11.2, released 2015/02/10" LIBXML="2.9.1"
      LIBJSON="UNKNOWN" TOPOLOG<br>
      Y RASTER<br>
      <br>
      Any help appreciated.<br>
      <br>
      Regards,<br>
      Graham<span class="HOEnZb"><font color="#888888"><br>
    </font></span></span><span class="HOEnZb"><font color="#888888">
    <pre cols="72">-- 
Graham Glanfield
Geocento Ltd
Electron Building
Fermi Avenue
Harwell
Didcot
Oxfordshire
OX11 0QR</pre>
  </font></span></div>

<br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>