[postgis-devel] ST_Intersection failing on valid geometries

Rémi Cura remi.cura at gmail.com
Fri Jun 27 05:43:39 PDT 2014


Hey,
PostGIS is not magic and bound by numeric precision (double), as every
other computer program.

For the moment we don't know if this is causing your issue. Trying a
translation would help determine that.

When you do processing on geom , it is wise to start by translating them,
do your stuff, then translate it back.

If you provide me a simple test case, I can try it if you want.
(simple test case : 2 geom as wkt, the intersection, not working)

Cheers,
Rémi-C


2014-06-27 13:48 GMT+02:00 Komяpa <me at komzpa.net>:

> Hi,
>
> 2014-06-27 14:21 GMT+03:00 Rémi Cura <remi.cura at gmail.com>:
> > Seems like a precision issue.
> > Can you try to translate your  geometry and round theim (ST_SnpaToGrid) a
> > bit to reduce the number of digits?
>
> I'd prefer not to, as
> a) this is intermediate step in more complex processing;
> b) I bumped into this issue multiple times, and now I have a testing
> case dataset.
>
> Can something be done inside PostGIS not to fail on such geometries?
>
> > Cheers,
> > Rémi-C
> >
> >
> > 2014-06-27 12:18 GMT+02:00 Komяpa <me at komzpa.net>:
> >>
> >> Hi,
> >>
> >> I managed to create a set of geometries that I'd like to intersect.
> >>
> >> POSTGIS="2.1.3 r12547" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.8.0,
> >> 6 March 2012" GDAL="GDAL 1.11.0, released 2014/04/16" LIBXML="2.9.1"
> >> LIBJSON="UNKNOWN" (core procs from "2.1.2 r12389" need upgrade)
> >> TOPOLOGY (topology procs from "2.1.2 r12389" need upgrade) RASTER
> >> (raster procs from "2.1.2 r12389" need upgrade)
> >>
> >> Test table:
> >> http://pastebin.com/qSYLGfvs
> >>
> >> After that:
> >>
> >> select ST_Intersection(p.geom, g.geom) from bad_intersections p,
> >> bad_intersections g;
> >>
> >> ERROR:  XX000: Error performing intersection: TopologyException: found
> >> non-noded intersection between LINESTRING (1.45784e+07 -1.40333e+06,
> >> 1.45784e+07 -1.40333e+06) and LINESTRING (1.45784e+07 -1.40333e+06,
> >> 1.45784e+07 -1.40333e+06) at 14578380.693885569 -1403332.55464
> >> LOCATION:  pg_error, lwgeom_pg.c:162
> >> Time: 10,674 ms
> >>
> >> All geometries are valid.
> >>
> >> Can this be fixed?
> >>
> >> --
> >> Darafei "Komяpa" Praliaskouski
> >> OSM BY Team - http://openstreetmap.by/
> >> xmpp:me at komzpa.net mailto:me at komzpa.net
> >> _______________________________________________
> >> postgis-devel mailing list
> >> postgis-devel at lists.osgeo.org
> >> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel
> >
> >
> >
> > _______________________________________________
> > postgis-devel mailing list
> > postgis-devel at lists.osgeo.org
> > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel
>
>
>
> --
> Darafei "Komяpa" Praliaskouski
> OSM BY Team - http://openstreetmap.by/
> xmpp:me at komzpa.net mailto:me at komzpa.net
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20140627/26cb1a9e/attachment.html>


More information about the postgis-devel mailing list