BeginBinaryImportAsync doesn't import Altitude · Issue #6567 · npgsql/npgsql · GitHub
Skip to content

BeginBinaryImportAsync doesn't import Altitude #6567

Open

Description

@smolesen

I'm trying to import points and lines, with altitude, using BeginBinaryImportAsync, however the altitude doesn't seem to get imported.

The easiest way to verify this, is to change the TestData in GeoJSONTests to look like this:

        new()
        {
            Geometry = new Point(
                    new Position(longitude: 1d, latitude: 2d, altitude:3d))
                { BoundingBoxes = [1d, 2d, 1d, 2d] },
            CommandText = "st_makepoint(1,2)"
        },

and run the 'Import_geometry' test..... It'll fail
also if you check the db, you see a point with only longitude and latitude:

POINT (1 2)

TIA

/Søren

Activity

  1. smolesen commented on May 8, 2026

    @smolesen
    Author

    Playing around with 'NpgsqlNetTopologySuite' instead, it turns out that the column has to be defined as 'POINTZ', however if I change the above mentioned test to use POINTZ

    var table = await CreateTempTable(conn, "field geometry(POINTZ, 4326)");
    

    I get this error:

    22023: Column has Z dimension but geometry does not
    

    Not quite sure what that means... or how to move on from here, except use 'NpgsqlNetTopologySuite' instead

  2. vonzshik commented on May 13, 2026

    @vonzshik
    Contributor

    Well, geometry explicitly documented as two-dimensional spatial object, so yeah, no z coord.

  3. xfischer commented on May 14, 2026

    @xfischer
    Contributor

    @smolesen, adding to @vonzshik. There is maybe a confusion between builtin postgres geometry (2 dimensions only) and the PostGIS ones.
    Using PostGIS, when you open Npgsql connection you should ask to handle Z coordinates this way:
    await using var conn = await OpenConnectionAsync(handleOrdinates: Ordinates.XYZ);

  4. xfischer commented on Jun 9, 2026

    @xfischer
    Contributor

    Regarding the first issue (GeoJSON with altitude), there's a bug in the converter: reading Z values is supported but writing isn't.
    Will submit a PR.

  5. added 4 commits that reference this issue on Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions