Skip to content

postgis binary writer does not support jts m-dimension #140

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

Open
TimPigden opened this issue Jan 27, 2025 · 1 comment
Open

postgis binary writer does not support jts m-dimension #140

TimPigden opened this issue Jan 27, 2025 · 1 comment

Comments

@TimPigden
Copy link

TimPigden commented Jan 27, 2025

This method:

    public static final int getCoordSequenceDim(CoordinateSequence coords) {
        if (coords == null || coords.size() == 0)
            return 0;
        // JTS has a really strange way to handle dimensions!
        // Just have a look at PackedCoordinateSequence and
        // CoordinateArraySequence
        int dimensions = coords.getDimension();
        if (dimensions == 3) {
            // CoordinateArraySequence will always return 3, so we have to
            // check, if
            // the third ordinate contains NaN, then the geom is actually
            // 2-dimensional
            return Double.isNaN(coords.getOrdinate(0, CoordinateSequence.Z)) ? 2 : 3;
        } else {
            return dimensions;
        }
    }

will check for a Z dimension but not the M dimension which is used, for example, in pgMapMatching
Nothing in here has changed inyears. What's the status if i do a pull request?

@phillipross
Copy link
Contributor

Hi @TimPigden, it's definitely been awhile since there were features/fixes in the code beyond dependency version updates. PRs are always welcome and appreciated.

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

2 participants