diff --git a/src/main/java/com/esri/core/geometry/MultiPath.java b/src/main/java/com/esri/core/geometry/MultiPath.java index f2b80e89..8e778725 100644 --- a/src/main/java/com/esri/core/geometry/MultiPath.java +++ b/src/main/java/com/esri/core/geometry/MultiPath.java @@ -653,7 +653,7 @@ boolean hasNonLinearSegments(int pathIndex) { * @param bReverse * Creates reversed path. */ - void addEnvelope(Envelope2D envSrc, boolean bReverse) { + public void addEnvelope(Envelope2D envSrc, boolean bReverse) { m_impl.addEnvelope(envSrc, bReverse); } diff --git a/src/main/java/com/esri/core/geometry/PairwiseIntersectorImpl.java b/src/main/java/com/esri/core/geometry/PairwiseIntersectorImpl.java index cb3c5c00..d02cc4fa 100644 --- a/src/main/java/com/esri/core/geometry/PairwiseIntersectorImpl.java +++ b/src/main/java/com/esri/core/geometry/PairwiseIntersectorImpl.java @@ -34,7 +34,7 @@ class PairwiseIntersectorImpl { private double m_tolerance; private int m_path_index; private int m_element_handle; - private Envelope2D m_paths_query; // only used for m_b_paths == true case + private Envelope2D m_paths_query = new Envelope2D(); // only used for m_b_paths == true case private QuadTreeImpl m_quad_tree; private QuadTreeImpl.QuadTreeIteratorImpl m_qt_iter; private SegmentIteratorImpl m_seg_iter; diff --git a/src/main/java/com/esri/core/geometry/SimpleRasterizer.java b/src/main/java/com/esri/core/geometry/SimpleRasterizer.java index 27a87351..783b8a8f 100644 --- a/src/main/java/com/esri/core/geometry/SimpleRasterizer.java +++ b/src/main/java/com/esri/core/geometry/SimpleRasterizer.java @@ -48,7 +48,7 @@ public class SimpleRasterizer { public static interface ScanCallback { /** * Rasterizer calls this method for each scan it produced - * @param scan array of scans. Scans are triplets of numbers. The start X coordinate for the scan (inclusive), + * @param scans array of scans. Scans are triplets of numbers. The start X coordinate for the scan (inclusive), * the end X coordinate of the scan (exclusive), the Y coordinate for the scan. * @param scanCount3 The number of initialized elements in the scans array. The scan count is scanCount3 / 3. */ diff --git a/src/main/java/com/esri/core/geometry/Wkid.java b/src/main/java/com/esri/core/geometry/Wkid.java index 29b119f5..9fd9cca0 100644 --- a/src/main/java/com/esri/core/geometry/Wkid.java +++ b/src/main/java/com/esri/core/geometry/Wkid.java @@ -146,7 +146,7 @@ public static double find_tolerance_from_wkid(int wkid) { if (tol == 1e38) { int old = wkid_to_old(wkid); if (old != wkid) - tol = find_tolerance_from_wkid_helper(wkid); + tol = find_tolerance_from_wkid_helper(old); if (tol == 1e38) return 1e-10; } diff --git a/src/test/java/com/esri/core/geometry/TestRelation.java b/src/test/java/com/esri/core/geometry/TestRelation.java index 10386f82..ec21049d 100644 --- a/src/test/java/com/esri/core/geometry/TestRelation.java +++ b/src/test/java/com/esri/core/geometry/TestRelation.java @@ -5481,4 +5481,16 @@ public void testCrosses_github_issue_40() { null); assertTrue(answer2); } + + @Test + public void testDisjointCrash() { + Polygon g1 = new Polygon(); + g1.addEnvelope(Envelope2D.construct(0, 0, 10, 10), false); + Polygon g2 = new Polygon(); + g2.addEnvelope(Envelope2D.construct(10, 1, 21, 21), false); + g1 = (Polygon)OperatorDensifyByLength.local().execute(g1, 0.1, null); + OperatorDisjoint.local().accelerateGeometry(g1, SpatialReference.create(4267), GeometryAccelerationDegree.enumHot); + boolean res = OperatorDisjoint.local().execute(g1, g2, SpatialReference.create(4267), null); + assertTrue(!res); + } } diff --git a/src/test/java/com/esri/core/geometry/TestWkid.java b/src/test/java/com/esri/core/geometry/TestWkid.java index fc09a66c..d953ae95 100644 --- a/src/test/java/com/esri/core/geometry/TestWkid.java +++ b/src/test/java/com/esri/core/geometry/TestWkid.java @@ -19,4 +19,13 @@ public void test() { assertTrue(Math.abs(tol84 - 1e-8) < 1e-8 * 1e-8); } + @Test + public void test_80() { + SpatialReference sr = SpatialReference.create(3857); + assertTrue(sr.getID() == 3857); + assertTrue(sr.getLatestID() == 3857); + assertTrue(sr.getOldID() == 102100); + assertTrue(sr.getTolerance() == 0.001); + } + }