Changes between Initial Version and Version 3 of Ticket #87


Ignore:
Timestamp:
Nov 21, 2007, 3:07:39 PM (16 years ago)
Author:
mloskot
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #87

    • Property Status closedreopened
    • Property Milestone imported
    • Property Resolution none
    • Property Reporter changed from mateusz@… to mloskot
  • Ticket #87 – Description

    initial v3  
    1 {{{
    21I'm getting strange result of isValid() call for non-empty, simple and closed LinearRing.
    32
    43Here is a code of one of my tests for LinearRing:
    54
     5{{{
    66// 1. Create non-empty sequence of coordiantes
    77CoordinateArraySequence* pseq = new CoordinateArraySequence();
     
    1212pseq->add(Coordinate(5, 5, 5));
    1313pseq->add(Coordinate(10, 10, 10));
    14 pseq->add(Coordinate(0, 0, 0)); // <--- [1]
     14pseq->add(Coordinate(0, 0, 0)); // <--- 1
    1515
    1616ensure_equals( pseq->size(), 4 );
     
    2626
    2727// 5. THIS TEST FAILS
    28 ensure( ring.isValid() ); // <--- [2]
    29 
     28ensure( ring.isValid() ); // <--- 2
     29}}}
    3030
    3131From my point of view, the code above seems to be valid.
    32 I add 4 points with first point repeated [1] at the end to get closed ring.
    33 Next, I create LinearRing instance and all tests pass besides isValid() in line [2].
     32I add 4 points with first point repeated 1 at the end to get closed ring.
     33Next, I create LinearRing instance and all tests pass besides isValid() in line 2.
    3434
    3535I debugged step by step and what I revealed - and what seems to be quite strange for me - it that checkValid() operation called in IsValidOp::isValid() returns validError.
     
    4040I suppose that checkValid() recognizes first and last point of LinearRing as self-intersection.
    4141
    42 I did a test with not adding the last repeated point in line [1] but then LinearRing ctor throws exception because isClosed() returns false.
     42I did a test with not adding the last repeated point in line 1 but then LinearRing ctor throws exception because isClosed() returns false.
    4343
    44 Summary:
    45 The IsValidOp::checkValid(const Geometry *g) function needs to be checked for LinearRing geometries.
    46 }}}
     44Summary: The IsValidOp::checkValid(const Geometry *g) function needs to be checked for LinearRing geometries.