[GEOS] #1036: GeomDifference with Overlay turned on goes into infinite look in PostGIS ST_WrapX

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[GEOS] #1036: GeomDifference with Overlay turned on goes into infinite look in PostGIS ST_WrapX

geos-2
#1036: GeomDifference with Overlay turned on goes into infinite look in PostGIS
ST_WrapX
------------------------+--------------------------
 Reporter:  robe        |      Owner:  geos-devel@…
     Type:  defect      |     Status:  new
 Priority:  blocker     |  Milestone:  3.9.0
Component:  Default     |    Version:  master
 Severity:  Unassigned  |   Keywords:
------------------------+--------------------------
 This is related to https://trac.osgeo.org/postgis/ticket/4731.
 Which after much input has been determined to be an issue with the new
 GEOS 3.9 overlay logic.

 The crashing example in PostGIS


 {{{
 SELECT ST_WrapX('LINESTRING(-11.1111111 70,70 -11.1111111)'::geometry,
 20.1,20.1);
 }}}

 Related IRC discussion


 {{{
 15:30:30        Algunenano:     ReginaObe[m]: WrapX uses split by line,
 which uses GEOSUnion
 15:30:39        Algunenano:     Maybe it's that?
 15:30:57        ReginaObe[m]:   ah Algunenano so I guess we got to update
 the docs too to reflect it uses GEOS
 15:31:14        ReginaObe[m]:   who would have thunk it :)
 15:31:37        PaulRamsey[m]:  you have a winner, it crashed for me too
 15:31:42        ReginaObe[m]:   Paul Ramsey: well that's a crasher
 15:33:19        PaulRamsey[m]:  It does eventually call GEOSDifference
 15:33:28        PaulRamsey[m]:  after 25000 frames of recursion?
 15:33:41        PaulRamsey[m]:  I mean, something non-geos broken in
 there?
 15:33:48        PaulRamsey[m]:  weird
 15:36:20        PaulRamsey[m]:  probably in ` split =
 lwgeom_split(geom_in, blade);`
 15:36:34        Algunenano:     It looks like an infinite loop. Has the
 geometry type changed? Maybe line -> multiline?
 15:38:35        Algunenano:     It seems that, for some reason,
 lwgeom_split_wrapx calls lwcollection_wrapx over the result, so it it
 returns a multiline (with a single line) it might be going to infinity and
 beyond
 15:39:34        PaulRamsey[m]:  yeah, not sure why it tries to wrap the
 components of the split...
 15:39:50        PaulRamsey[m]:  but if the components were slightly
 shifted, like enough to hit the blade again
 15:39:57        PaulRamsey[m]:  it would split over and over and over
 15:45:54        ReginaObe[m]:   Hmm ST_Split also doesn't note dependency
 on GEOS
 15:46:09        ReginaObe[m]:   which version of GEOS are required for
 these
 15:46:35        PaulRamsey[m]:  it uses difference, so pretty much all of
 them
 15:47:06        PaulRamsey[m]:  once martin implements a splitter over the
 new overlay all the splitting code can get simpler and more reliable..
 right now it's a hack on difference
 15:49:35        PaulRamsey[m]:  found it, @algunano
 }}}


 {{{
 15:49:35        PaulRamsey[m]:  found it, @algunano

 select st_astext(st_difference('LINESTRING(-11.1111111 70,70
 -11.1111111)'::geometry, 'LINESTRING (20.1 90, 20.1 -90)'::geometry));
                          st_astext
 -----------------------------------------------------------
  LINESTRING(-11.1111111 70,20.1 38.7888889,70 -11.1111111)
 (1 row)
 }}}

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/1036>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).

_______________________________________________
geos-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geos-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GEOS] #1036: GeomDifference with Overlay turned on goes into infinite look in PostGIS ST_WrapX

geos-2
#1036: GeomDifference with Overlay turned on goes into infinite look in PostGIS
ST_WrapX
------------------------+---------------------------
 Reporter:  robe        |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  blocker     |   Milestone:  3.9.0
Component:  Default     |     Version:  master
 Severity:  Unassigned  |  Resolution:
 Keywords:              |
------------------------+---------------------------
Description changed by robe:

Old description:

> This is related to https://trac.osgeo.org/postgis/ticket/4731.
> Which after much input has been determined to be an issue with the new
> GEOS 3.9 overlay logic.
>
> The crashing example in PostGIS
>

> {{{
> SELECT ST_WrapX('LINESTRING(-11.1111111 70,70 -11.1111111)'::geometry,
> 20.1,20.1);
> }}}
>
> Related IRC discussion
>

> {{{
> 15:30:30        Algunenano:     ReginaObe[m]: WrapX uses split by line,
> which uses GEOSUnion
> 15:30:39        Algunenano:     Maybe it's that?
> 15:30:57        ReginaObe[m]:   ah Algunenano so I guess we got to update
> the docs too to reflect it uses GEOS
> 15:31:14        ReginaObe[m]:   who would have thunk it :)
> 15:31:37        PaulRamsey[m]:  you have a winner, it crashed for me too
> 15:31:42        ReginaObe[m]:   Paul Ramsey: well that's a crasher
> 15:33:19        PaulRamsey[m]:  It does eventually call GEOSDifference
> 15:33:28        PaulRamsey[m]:  after 25000 frames of recursion?
> 15:33:41        PaulRamsey[m]:  I mean, something non-geos broken in
> there?
> 15:33:48        PaulRamsey[m]:  weird
> 15:36:20        PaulRamsey[m]:  probably in ` split =
> lwgeom_split(geom_in, blade);`
> 15:36:34        Algunenano:     It looks like an infinite loop. Has the
> geometry type changed? Maybe line -> multiline?
> 15:38:35        Algunenano:     It seems that, for some reason,
> lwgeom_split_wrapx calls lwcollection_wrapx over the result, so it it
> returns a multiline (with a single line) it might be going to infinity
> and beyond
> 15:39:34        PaulRamsey[m]:  yeah, not sure why it tries to wrap the
> components of the split...
> 15:39:50        PaulRamsey[m]:  but if the components were slightly
> shifted, like enough to hit the blade again
> 15:39:57        PaulRamsey[m]:  it would split over and over and over
> 15:45:54        ReginaObe[m]:   Hmm ST_Split also doesn't note dependency
> on GEOS
> 15:46:09        ReginaObe[m]:   which version of GEOS are required for
> these
> 15:46:35        PaulRamsey[m]:  it uses difference, so pretty much all of
> them
> 15:47:06        PaulRamsey[m]:  once martin implements a splitter over
> the new overlay all the splitting code can get simpler and more
> reliable.. right now it's a hack on difference
> 15:49:35        PaulRamsey[m]:  found it, @algunano
> }}}
>

> {{{
> 15:49:35        PaulRamsey[m]:  found it, @algunano
>
> select st_astext(st_difference('LINESTRING(-11.1111111 70,70
> -11.1111111)'::geometry, 'LINESTRING (20.1 90, 20.1 -90)'::geometry));
>                          st_astext
> -----------------------------------------------------------
>  LINESTRING(-11.1111111 70,20.1 38.7888889,70 -11.1111111)
> (1 row)
> }}}
New description:

 This is related to https://trac.osgeo.org/postgis/ticket/4731.
 Which after much input has been determined to be an issue with the new
 GEOS 3.9 overlay logic.

 The crashing example in PostGIS


 {{{
 SELECT ST_WrapX('LINESTRING(-11.1111111 70,70 -11.1111111)'::geometry,
 20.1,20.1);
 }}}

 Related IRC discussion


 {{{
 15:30:30        Algunenano:     ReginaObe[m]: WrapX uses split by line,
 which uses GEOSUnion
 15:30:39        Algunenano:     Maybe it's that?
 15:30:57        ReginaObe[m]:   ah Algunenano so I guess we got to update
 the docs too to reflect it uses GEOS
 15:31:14        ReginaObe[m]:   who would have thunk it :)
 15:31:37        PaulRamsey[m]:  you have a winner, it crashed for me too
 15:31:42        ReginaObe[m]:   Paul Ramsey: well that's a crasher
 15:33:19        PaulRamsey[m]:  It does eventually call GEOSDifference
 15:33:28        PaulRamsey[m]:  after 25000 frames of recursion?
 15:33:41        PaulRamsey[m]:  I mean, something non-geos broken in
 there?
 15:33:48        PaulRamsey[m]:  weird
 15:36:20        PaulRamsey[m]:  probably in ` split =
 lwgeom_split(geom_in, blade);`
 15:36:34        Algunenano:     It looks like an infinite loop. Has the
 geometry type changed? Maybe line -> multiline?
 15:38:35        Algunenano:     It seems that, for some reason,
 lwgeom_split_wrapx calls lwcollection_wrapx over the result, so it it
 returns a multiline (with a single line) it might be going to infinity and
 beyond
 15:39:34        PaulRamsey[m]:  yeah, not sure why it tries to wrap the
 components of the split...
 15:39:50        PaulRamsey[m]:  but if the components were slightly
 shifted, like enough to hit the blade again
 15:39:57        PaulRamsey[m]:  it would split over and over and over
 15:45:54        ReginaObe[m]:   Hmm ST_Split also doesn't note dependency
 on GEOS
 15:46:09        ReginaObe[m]:   which version of GEOS are required for
 these
 15:46:35        PaulRamsey[m]:  it uses difference, so pretty much all of
 them
 15:47:06        PaulRamsey[m]:  once martin implements a splitter over the
 new overlay all the splitting code can get simpler and more reliable..
 right now it's a hack on difference
 15:49:35        PaulRamsey[m]:  found it, @algunano
 }}}


 {{{
 15:49:35        PaulRamsey[m]:  found it, @algunano

 select st_astext(st_difference('LINESTRING(-11.1111111 70,70
 -11.1111111)'::geometry, 'LINESTRING (20.1 90, 20.1 -90)'::geometry));
                          st_astext
 -----------------------------------------------------------
  LINESTRING(-11.1111111 70,20.1 38.7888889,70 -11.1111111)
 (1 row)
 }}}

 From related PostGIS ticket

 ----

 The lwgeom_split_wrapx function expects a split (which under the covers is
 a difference of a line away from an input) to return a collection, which
 it then iterates on. Instead we hand it a unitary object... which it then
 goes and tries to split again. Hence the infinite recursion. We need
 probably the old behaviour back, so that a GEOS 3.9 install doesn't break
 older software.

--

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/1036#comment:1>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).

_______________________________________________
geos-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geos-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GEOS] #1036: GeomDifference with Overlay turned on goes into infinite look in PostGIS ST_WrapX

geos-2
In reply to this post by geos-2
#1036: GeomDifference with Overlay turned on goes into infinite look in PostGIS
ST_WrapX
------------------------+---------------------------
 Reporter:  robe        |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  blocker     |   Milestone:  3.9.0
Component:  Default     |     Version:  master
 Severity:  Unassigned  |  Resolution:
 Keywords:              |
------------------------+---------------------------

Comment (by pramsey):

 Check against current master, this should be gone now.

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/1036#comment:2>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).

_______________________________________________
geos-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geos-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GEOS] #1036: GeomDifference with Overlay turned on goes into infinite look in PostGIS ST_WrapX

geos-2
In reply to this post by geos-2
#1036: GeomDifference with Overlay turned on goes into infinite look in PostGIS
ST_WrapX
------------------------+---------------------------
 Reporter:  robe        |       Owner:  geos-devel@…
     Type:  defect      |      Status:  closed
 Priority:  blocker     |   Milestone:  3.9.0
Component:  Default     |     Version:  master
 Severity:  Unassigned  |  Resolution:  fixed
 Keywords:              |
------------------------+---------------------------
Changes (by robe):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 yap no more crashing.

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/1036#comment:3>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).

_______________________________________________
geos-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geos-devel