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

WKTReader silently adds dimensions when setIsOldJtsCoordinateSyntaxAllowed is true #939

Open
chenhh021 opened this issue Dec 8, 2022 · 0 comments

Comments

@chenhh021
Copy link
Contributor

chenhh021 commented Dec 8, 2022

As the title says, WKTReader silently adds dimension.

For example, it will create coordinate sequence 10 10 NaN after load POINT (10, 10). The following test can reproduce this behavior.

public void testDimensionConsistence() throws Exception {
    //test 2-d point with XY coordinate
    CoordinateSequence seq1 = createSequence(Ordinate.createXY(), new double[] {10, 10});
    Point pt1 = (Point)readerXYOld.read("POINT (10 10)");
    assertTrue(isEqual(seq1, pt1.getCoordinateSequence()));
}

Is it designed to behave this way?

I could fix the dimension change alone. But a thorough fix may need some more time, as there may need some conversion for mixed use of 2-d and 3-d coordinates. At present such conversion is useless as WKTReader always extend 2-d coordinates to 3-d.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant