[postgis-users] ST_intersection

Michael Moore michaeljmoore at gmail.com
Fri Apr 15 08:01:19 PDT 2016


There is something wrong with your first polygon. go here ...
https://www.mathsisfun.com/geometry/polygons-interactive.html

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)


On Fri, Apr 15, 2016 at 6:53 AM, Graham Glanfield <
graham.glanfield at geocento.com> wrote:

> Dear list,
>
> The following query:
>
> 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);
>
> fails with the following error:
> "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"
>
> 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.
>
> I'm running:
>
> 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
> ="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
> Y RASTER
>
> Any help appreciated.
>
> Regards,
> Graham
>
> --
> Graham Glanfield
> Geocento Ltd
> Electron Building
> Fermi Avenue
> Harwell
> Didcot
> Oxfordshire
> OX11 0QR
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20160415/2dbb3526/attachment.html>


More information about the postgis-users mailing list