Skip to content

Current code is invalid with Postgis 3.2+ #20

@3nids

Description

@3nids

We currently use null values for Z coordinates in linestrings using NaN.
For instance in reach insert trigger:

NEW.progression3d_geometry = ST_ForceCurve(ST_SetPoint(ST_CurveToLine(NEW.progression3d_geometry),0,
ST_MakePoint(ST_X(ST_StartPoint(NEW.progression3d_geometry)),ST_Y(ST_StartPoint(NEW.progression3d_geometry)),COALESCE(NEW.rp_from_level,'NaN'))));
NEW.progression3d_geometry = ST_ForceCurve(ST_SetPoint(ST_CurveToLine(NEW.progression3d_geometry),ST_NumPoints(NEW.progression3d_geometry)-1,
ST_MakePoint(ST_X(ST_EndPoint(NEW.progression3d_geometry)),ST_Y(ST_EndPoint(NEW.progression3d_geometry)),COALESCE(NEW.rp_to_level,'NaN'))));

Starting with Postgis 3.2, this fails with Geometry contains invalid coordinates error message.

I don't know how to handle this yet and have posted an issue on stackexchange and osgeo trac.

SE: https://gis.stackexchange.com/questions/470332/how-to-handle-null-z-m-values-in-postgis
osgeo ticket: https://trac.osgeo.org/postgis/ticket/5610#ticket

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdatamodelConcerns the datamodel

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions