OGCGeometry#contains, intersects, disjoint and distance fail with NPE on geometry collections
See original GitHub issueAll of the relationship test APIs fail with NPE when input is a geometry collection.
Here are some examples:
@Test
public void testDisjointOnGeometryCollection()
{
OGCGeometry ogcGeometry = OGCGeometry.fromText("GEOMETRYCOLLECTION (POINT (1 1))");
ogcGeometry.disjoint(OGCGeometry.fromText("POINT (1 1)"));
}
@Test
public void testContainsOnGeometryCollection()
{
OGCGeometry ogcGeometry = OGCGeometry.fromText("GEOMETRYCOLLECTION (POINT (1 1))");
ogcGeometry.contains(OGCGeometry.fromText("POINT (1 1)"));
}
@Test
public void testIntersectsOnGeometryCollection()
{
OGCGeometry ogcGeometry = OGCGeometry.fromText("GEOMETRYCOLLECTION (POINT (1 1))");
ogcGeometry.contains(OGCGeometry.fromText("POINT (1 1)"));
}
@Test
public void testDistanceOnGeometryCollection()
{
OGCGeometry ogcGeometry = OGCGeometry.fromText("GEOMETRYCOLLECTION (POINT (1 1))");
ogcGeometry.distance(OGCGeometry.fromText("POINT (1 1)"));
}
and exceptions:
java.lang.NullPointerException
at com.esri.core.geometry.RelationalOperations.relate(RelationalOperations.java:44)
at com.esri.core.geometry.OperatorDisjointLocal.execute(OperatorDisjointLocal.java:31)
at com.esri.core.geometry.GeometryEngine.disjoint(GeometryEngine.java:376)
at com.esri.core.geometry.ogc.OGCGeometry.disjoint(OGCGeometry.java:275)
at com.esri.core.geometry.TestOGC.testDisjointOnGeometryCollection(TestOGC.java:290)
java.lang.NullPointerException
at com.esri.core.geometry.RelationalOperations.relate(RelationalOperations.java:44)
at com.esri.core.geometry.OperatorContainsLocal.execute(OperatorContainsLocal.java:31)
at com.esri.core.geometry.GeometryEngine.contains(GeometryEngine.java:479)
at com.esri.core.geometry.ogc.OGCGeometry.contains(OGCGeometry.java:307)
at com.esri.core.geometry.TestOGC.testContainsOnGeometryCollection(TestOGC.java:297)
java.lang.NullPointerException
at com.esri.core.geometry.RelationalOperations.relate(RelationalOperations.java:44)
at com.esri.core.geometry.OperatorContainsLocal.execute(OperatorContainsLocal.java:31)
at com.esri.core.geometry.GeometryEngine.contains(GeometryEngine.java:479)
at com.esri.core.geometry.ogc.OGCGeometry.contains(OGCGeometry.java:307)
at com.esri.core.geometry.TestOGC.testIntersectsOnGeometryCollection(TestOGC.java:304)
java.lang.IllegalArgumentException
at com.esri.core.geometry.OperatorDistanceLocal.execute(OperatorDistanceLocal.java:38)
at com.esri.core.geometry.GeometryEngine.distance(GeometryEngine.java:592)
at com.esri.core.geometry.ogc.OGCGeometry.distance(OGCGeometry.java:333)
at com.esri.core.geometry.TestOGC.testDistanceOnGeometryCollection(TestOGC.java:311)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:11 (11 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@randallwhitman Thank you, Randall.
@mbasmanova https://github.com/Esri/geometry-api-java/releases/tag/v2.2.0 https://mvnrepository.com/artifact/com.esri.geometry/esri-geometry-api/2.2.0