Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JTS intersects side location conflict #947

Open
ebocher opened this issue Mar 27, 2024 · 1 comment
Open

JTS intersects side location conflict #947

ebocher opened this issue Mar 27, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ebocher
Copy link
Member

ebocher commented Mar 27, 2024

The following topology configuration returns a side location conflict when the intersect operator is called.

This bug is currently present in version 1.19 of JTS used by H2GIS.

Same bug on version 1.20-SNAPSHOT

image

JTS test

   public void testGeometryIntersects() throws Exception {
        Geometry gc0 = reader.read(
                "POLYGON ((414188.5999999999 6422867.1, 414193.7 6422866.5, 414205.1 6422859.4, 414223.7 6422846.8, 414229.6 6422843.2, 414235.2 6422835.4, 414224.7 6422837.9, 414219.4 6422842.1, 414210.9 6422849, 414199.2 6422857.6, 414191.1 6422863.4, 414188.5999999999 6422867.1))");
        Geometry gc1 = reader.read(
                "LINESTRING (414187.2 6422831.6, 414179 6422836.1, 414182.2 6422841.8, 414176.7 6422844, 414184.5 6422859.5, 414188.6 6422867.1)");
        assertTrue(gc0.intersects(gc1));
    }

H2GIS test issue

    @Test
    public void test_ST_Intersects() throws Exception {
        ResultSet rs = st.executeQuery("SELECT ST_INTERSECTS('POLYGON ((414188.5999999999 6422867.1, 414193.7 6422866.5, 414205.1 6422859.4, 414223.7 6422846.8, 414229.6 6422843.2, 414235.2 6422835.4, 414224.7 6422837.9, 414219.4 6422842.1, 414210.9 6422849, 414199.2 6422857.6, 414191.1 6422863.4, 414188.5999999999 6422867.1))'::GEOMETRY, " +
                "'LINESTRING (414187.2 6422831.6, 414179 6422836.1, 414182.2 6422841.8, 414176.7 6422844, 414184.5 6422859.5, 414188.6 6422867.1)'::GEOMETRY)");
        assertTrue(rs.next());
        assertTrue(rs.getBoolean(1));
    }

Error

Exception calling user-defined function: "isIntersects(POLYGON ((414188.5999999999 6422867.1, 414193.7 6422866.5, 414205.1 6422859.4, 414223.7 6422846.8, 414229.6 6422843.2, 414235.2 6422835.4, 414224.7 6422837.9, 414219.4 6422842.1, 414210.9 6422849, 414199.2 6422857.6, 414191.1 6422863.4, 414188.5999999999 6422867.1)), LINESTRING (414187.2 6422831.6, 414179 6422836.1, 414182.2 6422841.8, 414176.7 6422844, 414184.5 6422859.5, 414188.6 6422867.1)): side location conflict [ (414188.6, 6422867.1, NaN) ]"; SQL statement:
@j3r3m1
Copy link
Collaborator

j3r3m1 commented Mar 27, 2024

Good catch !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants