<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Dear list,<br>
    <br>
    The following query:<br>
    <br>
    <span>SELECT ST_intersection(<wbr>st_geometryfromtext(<wbr>('MULTIPOLYGON((<wbr>(-3.577895<wbr>
      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)<wbr>::geography,st_geome<wbr>tryfromtext(('POLYGON(<wbr>(-0.38928<wbr>
      51.5446,-0.1703 51.5446,-0.1703 51.389328,-0.38928
      51.389328,-0.38928 51.5446))'),4326)<wbr>::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<br>
    </span>
    <pre class="moz-signature" cols="72">-- 
Graham Glanfield
Geocento Ltd
Electron Building
Fermi Avenue
Harwell
Didcot
Oxfordshire
OX11 0QR</pre>
  </body>
</html>