[GEOS] #832: LinearLocation::isValid and LinearLocation::normalize, faulty comparisons

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

[GEOS] #832: LinearLocation::isValid and LinearLocation::normalize, faulty comparisons

geos-2
#832: LinearLocation::isValid and LinearLocation::normalize, faulty comparisons
------------------------+--------------------------
 Reporter:  nila        |      Owner:  geos-devel@…
     Type:  defect      |     Status:  new
 Priority:  major       |  Milestone:
Component:  Default     |    Version:  svn-trunk
 Severity:  Unassigned  |   Keywords:
------------------------+--------------------------
 componentIndex and segmentIndex are declared as

 {{{
 unsigned int
 }}}

 in geos/linearref/LinearLocation.h:46-47, thus the comparisons, eg.

 {{{
 componentIndex < 0
 }}}

 made at linearref/LinearLocation.cpp:92, 98, 235 and 239 are always false.

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/832>
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] #832: LinearLocation::isValid and LinearLocation::normalize, faulty comparisons

geos-2
#832: LinearLocation::isValid and LinearLocation::normalize, faulty comparisons
------------------------+---------------------------
 Reporter:  nila        |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  major       |   Milestone:
Component:  Default     |     Version:  svn-trunk
 Severity:  Unassigned  |  Resolution:
 Keywords:              |
------------------------+---------------------------

Comment (by strk):

 Can you try to add a test under tests/unit/linearref exposing a bad
 consequence of that always-false comparison ? It would be great to
 have the need-for-fix clearly shown and the later fix secured.

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/832#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] #832: LinearLocation::isValid and LinearLocation::normalize, faulty comparisons

geos-2
In reply to this post by geos-2
#832: LinearLocation::isValid and LinearLocation::normalize, faulty comparisons
------------------------+---------------------------
 Reporter:  nila        |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  major       |   Milestone:
Component:  Default     |     Version:  svn-trunk
 Severity:  Unassigned  |  Resolution:
 Keywords:              |
------------------------+---------------------------

Comment (by nila):

 I cannot see the always-false comparison would introduce any bad
 conseqence as such. The code is a pretty straightforward port from JTS
 with the exception of componentIndex and segmentIndex being unsigned here,
 while they are signed in JTS. In JTS the comparisons are needed, but here
 they are redundant. The LinearLocation::normalize can therefore be reduced
 by 11 lines and 2 lines in LinearLocation::isValid can be shortened (and 4
 Clang warnings can be silenced).

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/832#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] #832: LinearLocation::isValid and LinearLocation::normalize, faulty comparisons

geos-2
In reply to this post by geos-2
#832: LinearLocation::isValid and LinearLocation::normalize, faulty comparisons
------------------------+---------------------------
 Reporter:  nila        |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  major       |   Milestone:
Component:  Default     |     Version:  svn-trunk
 Severity:  Unassigned  |  Resolution:
 Keywords:              |
------------------------+---------------------------

Comment (by strk):

 Sounds like a plan, up for a pull request ?

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/832#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
Reply | Threaded
Open this post in threaded view
|

Re: [GEOS] #832: LinearLocation::isValid and LinearLocation::normalize, faulty comparisons

geos-2
In reply to this post by geos-2
#832: LinearLocation::isValid and LinearLocation::normalize, faulty comparisons
------------------------+---------------------------
 Reporter:  nila        |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  major       |   Milestone:
Component:  Default     |     Version:  svn-trunk
 Severity:  Unassigned  |  Resolution:
 Keywords:              |
------------------------+---------------------------

Comment (by nila):

 Just sent a pull request.

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/832#comment:4>
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] #832: LinearLocation::isValid and LinearLocation::normalize, faulty comparisons

geos-2
In reply to this post by geos-2
#832: LinearLocation::isValid and LinearLocation::normalize, faulty comparisons
------------------------+---------------------------
 Reporter:  nila        |       Owner:  geos-devel@…
     Type:  defect      |      Status:  closed
 Priority:  major       |   Milestone:
Component:  Default     |     Version:  master
 Severity:  Unassigned  |  Resolution:  fixed
 Keywords:              |
------------------------+---------------------------
Changes (by Sandro Santilli <strk@…>):

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


Comment:

 In [changeset:"16183469312aef329c096f1b8a5d95521575a9d8/git"
 16183469/git]:
 {{{
 #!CommitTicketReference repository="git"
 revision="16183469312aef329c096f1b8a5d95521575a9d8"
 Remove redundant code

 Closes #832
 }}}

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/832#comment:5>
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