View Revisions: Issue #464

Summary 0000464: Heureka fails to discover some polygon adjacencies
Revision 2021-12-30 09:29 by Peder
Steps To Reproduce 1. Import attached stand register and shape file containing two stands
2. Run Compute Adjancencies from the Tools menu

Result: No adjacencies were found
Expected result: The two polygons share 265 meter border


The following script uses Sql Server's built-in spatial methods and can be used for comparison. In this case a shared border must be at least 10 m to count.

WITH p AS (
SELECT
    b.TreatmentUnitGuid,
    b.SHAPE,
    tu.Description
FROM GIS_Polygon_New b
)

--INSERT INTO TreatmentUnitNeighbour
SELECT p.TreatmentUnitGuid
        ,c.TreatmentUnitGuid
        ,p.SHAPE.STIntersection (c.SHAPE).STLength() AS LENGTH_M
    FROM GIS_Polygon_New c
    INNER JOIN p ON p.Shape.STIntersects(c.Shape) = 1
    WHERE p.TreatmentUnitGuid<>c.TreatmentUnitGuid AND
    p.SHAPE.STIntersection (c.SHAPE).STLength() >= 10
GO
Revision 2021-12-29 17:39 by Peder
Steps To Reproduce The following script uses Sql Server's built-in spatial methods and can be used for comparison, in this case only including those with shared border of at least 10 m:

WITH p AS (
SELECT
    b.TreatmentUnitGuid,
    b.SHAPE,
    tu.Description
FROM GIS_Polygon_New b
)

--INSERT INTO TreatmentUnitNeighbour
SELECT p.TreatmentUnitGuid
        ,c.TreatmentUnitGuid
        ,p.SHAPE.STIntersection (c.SHAPE).STLength() AS LENGTH_M
    FROM GIS_Polygon_New c
    INNER JOIN p ON p.Shape.STIntersects(c.Shape) = 1
    WHERE p.TreatmentUnitGuid<>c.TreatmentUnitGuid AND
    p.SHAPE.STIntersection (c.SHAPE).STLength() >= 10
GO