[postgis-tickets] [PostGIS] #3402: geometry crosses edges with 0 tolerance

PostGIS trac at osgeo.org
Fri Dec 18 09:07:21 PST 2015


#3402: geometry crosses edges with 0 tolerance
-----------------------+---------------------------
  Reporter:  strk      |      Owner:  strk
      Type:  defect    |     Status:  new
  Priority:  medium    |  Milestone:  PostGIS 2.1.9
 Component:  topology  |    Version:  2.1.x
Resolution:            |   Keywords:
-----------------------+---------------------------

Comment (by strk):

 What I don't yet understand is how do edge crossing exactly happens.
 According to GEOS, these two edges cross:
 {{{
 010200000003000000C1AABC2B192739418E7DE0E6AB9652411F85EB5119283941F6285CEF2D96524187EB51382828394115AE47D12C965241
 010200000003000000C1AABC2B192739418E7DE0E6AB96524185EB51382828394115AE47D12C96524187EB51382828394115AE47D12C965241
 }}}

 That is, they have a puntual interior-interior intersection according to
 GEOSRelate:

 {{{
 0F1F0F1F2
 }}}

 The first line geometry (call it A) is the existing edge.
 The second line geometry (call it B) is the line being added, with the
 tiny final segment.

 The first and last points of the second line are equal to the first and
 last point of the first line:
 {{{
 =# select ST_Equals( ST_StartPoint(a), ST_StartPoint(b) ) from xx;
  st_equals
 -----------
  t
 =# select ST_Equals( ST_EndPoint(a), ST_EndPoint(b) ) from xx;
  st_equals
 -----------
  t
 }}}

 So we have two lines each of 3 vertices.
 The start and end vertices are _the_same_.
 The second/middle vertex is NOT the same and not equal to any of the other
 two vertices:
 {{{
 =# select ST_Equals( ST_PointN(b,2), ST_PointN(a,2) ) from xx;
  st_equals
 -----------
  f
 strk=# select ST_Equals( ST_PointN(b,2), ST_PointN(b,3) ) from xx;
  st_equals
 -----------
  f
 (1 row)

 strk=# select ST_Equals( ST_PointN(b,2), ST_PointN(b,1) ) from xx;
  st_equals
 -----------
  f
 (1 row)
 }}}

 For confirmation, neither A covers middle point of B nor B covers middle-
 point of A:
 {{{
 strk=# select ST_Covers( a, ST_PointN(b,2) ) from xx;
  st_covers
 -----------
  f
 (1 row)

 strk=# select ST_Covers( b, ST_PointN(a,2) ) from xx;
  st_covers
 -----------
  f
 (1 row)
 }}}

 So now the question is: how can A and B possibly have an Interior-Interior
 intersection ???

 This sounds like a bug in GEOS.

 Martin: any chance for you to try this case in JTS ?
 If GEOS Relate computer is wrong, this edge-crosses-edge error is a false
 positive !

--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3402#comment:11>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list