Changes between Initial Version and Version 3 of Ticket #87
- Timestamp:
- Nov 21, 2007, 3:07:39 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #87
- Property Status closed → reopened
- Property Milestone imported
- Property Resolution none
- Property Reporter changed from to
-
Ticket #87 – Description
initial v3 1 {{{2 1 I'm getting strange result of isValid() call for non-empty, simple and closed LinearRing. 3 2 4 3 Here is a code of one of my tests for LinearRing: 5 4 5 {{{ 6 6 // 1. Create non-empty sequence of coordiantes 7 7 CoordinateArraySequence* pseq = new CoordinateArraySequence(); … … 12 12 pseq->add(Coordinate(5, 5, 5)); 13 13 pseq->add(Coordinate(10, 10, 10)); 14 pseq->add(Coordinate(0, 0, 0)); // <--- [1]14 pseq->add(Coordinate(0, 0, 0)); // <--- 1 15 15 16 16 ensure_equals( pseq->size(), 4 ); … … 26 26 27 27 // 5. THIS TEST FAILS 28 ensure( ring.isValid() ); // <--- [2]29 28 ensure( ring.isValid() ); // <--- 2 29 }}} 30 30 31 31 From 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].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. 34 34 35 35 I 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. … … 40 40 I suppose that checkValid() recognizes first and last point of LinearRing as self-intersection. 41 41 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.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. 43 43 44 Summary: 45 The IsValidOp::checkValid(const Geometry *g) function needs to be checked for LinearRing geometries. 46 }}} 44 Summary: The IsValidOp::checkValid(const Geometry *g) function needs to be checked for LinearRing geometries.