bilaldursun1 / nettopologysuite

Automatically exported from code.google.com/p/nettopologysuite
0 stars 0 forks source link

v1.12 and failing xml tests #121

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
NTS version 1.12 reports some exceptions after that I've updated xml tests from 
JTS 1.12.
XML tests are committed in tag v.1.12, althoug looks a bad idea to fix things 
inside a tag...
http://code.google.com/p/nettopologysuite/source/detail?r=866

Original issue reported on code.google.com by diegogu...@gmail.com on 13 Aug 2012 at 11:13

GoogleCodeExporter commented 9 years ago
I thought I updated the test xml files prior to tagging v1.12.
Are the test you note as failing passing with JTS?

If not, we could branch the v1.12 tag to v1.12.1 and try to fix it there. But I 
don't know if it is worth the hustle since JTS 1.13 is to be released sometime 
soon.

Original comment by felix.ob...@netcologne.de on 29 Aug 2012 at 9:17

GoogleCodeExporter commented 9 years ago
>I thought I updated the test xml files prior to tagging v1.12.
I've updated the tests in the tag from xml in jts 1.12 and looks different from 
our tests. Now tag contains the valid XML tests (I hope)

>Are the test you note as failing passing with JTS?
No it works, and with the same results from NTS. Simply XML tests used before 
expected an actually wrong result. So actually NTS looks ok, it's only a matter 
of XML expectations.

Original comment by diegogu...@gmail.com on 29 Aug 2012 at 9:26

GoogleCodeExporter commented 9 years ago
So we can close this?

Original comment by felix.ob...@netcologne.de on 29 Aug 2012 at 9:49

GoogleCodeExporter commented 9 years ago
to me, yes.
checking the updated XML tag, there are two errors, that looks related (I need 
to investigate) to xml parsing code and not to NTS topology errors: errors that 
can be fixed in trunk for newer versions.

Original comment by diegogu...@gmail.com on 29 Aug 2012 at 9:57

GoogleCodeExporter commented 9 years ago
one of the errors is related to a behavoir of NTS that is different from JTS 
(v1.12).
Point.IsValid overrides Geometry.IsValid and uses IsValidOp.IsValidCoordinate.

This code fails this test, that throws a NunnReferenceException:
ICoordinateSequence sequence = new CoordinateArraySequence(new Coordinate[0]);
IPoint point = GeometryFactory.Default.CreatePoint(sequence);
Assert.That(point.IsValid, Is.True);

This is one of the failing tests.

Original comment by diegogu...@gmail.com on 3 Sep 2012 at 1:26

GoogleCodeExporter commented 9 years ago
The second failing test is this code:

var g = Reader.Read("POLYGON( (0 0, 0 5, 6 5, 6 0, 0 0), (2 1, 4 1, 3 2, 2 1), 
(2 1, 1 4, 5 4, 4 1, 4 3, 3 2, 2 3, 2 1) )");
var result = g.IsValid;
Assert.IsFalse(result);

there is an assertion inside IndexedNestedRingTester that throws the exception.
Assert.IsTrue(innerRingPt != null, "Unable to find a ring point not a node of 
the search ring");

JTS code skip the check for null values

Original comment by diegogu...@gmail.com on 3 Sep 2012 at 1:53

GoogleCodeExporter commented 9 years ago
fixed in tag 1.12 with changesets 866, 871 and 874.
trunk modified with changesets 867, 872 and 875

Original comment by diegogu...@gmail.com on 3 Sep 2012 at 1:58

GoogleCodeExporter commented 9 years ago
added also support for some other xml test types

Original comment by diegogu...@gmail.com on 4 Sep 2012 at 12:59