PostGIS 2.1 ST_Force_2D is depreciated #4803

Merged
merged 2 commits into from Nov 25, 2013

Projects

None yet

3 participants

@akrherz
Contributor
akrherz commented Oct 29, 2013

mappostgis.c uses the ST_Force_2D function, which is now depreciated with PostGIS 2.1 . Postgresql logs

WARNING:  ST_Force_2d signature was deprecated in 2.1.0. Please use ST_Force2D
@tbonfort
Member

@pramsey could you please have a quick sanity check at this one? The aim is to stop using the deprecated st_force_2d for recent postgis version, or leave out the force_2d call completely if PROCESSING "FORCE2D=off" is added to the layer.

@tbonfort tbonfort was assigned Nov 20, 2013
@pramsey
Contributor
pramsey commented Nov 20, 2013

The code on its own looks fine, but it's going to run into a mess in the WKB handler, which expects 2D inputs only. So that code will also need to be touched a bit to recognize 3D wkb types and then do the Right Thing when they arrive.

@tbonfort
Member

@pramsey I see it more as an optional parameter you can add to avoid going through force_2d when you know that your geometries are not in 3D. It's off by default, and can be documented as resulting in undefined behaviour if used with 3D geometries.

@pramsey
Contributor
pramsey commented Nov 25, 2013

Ah, I see. A bit scary, since people might easily assume that it means support for 3d, rather than lack of 2d forcing. But I think (looking at the code) the result won't be a crash but an error... pretty sure.

@pramsey pramsey closed this Nov 25, 2013
@pramsey pramsey reopened this Nov 25, 2013
@pramsey pramsey merged commit b081e9f into mapserver:branch-6-4 Nov 25, 2013

1 check passed

default The Travis CI build passed
Details
@tbonfort tbonfort added a commit to tbonfort/mapserver that referenced this pull request Dec 3, 2013
@tbonfort tbonfort Merge PR #4803 259d804
@rouault rouault added a commit to rouault/mapserver that referenced this pull request Jun 11, 2014
@rouault rouault PostGIS input: add 2.5D support when USE_POINT_Z_M is defined
Consequently the PROCESSING option FORCE2D is assumed to be NO by
default when USE_POINT_Z_M is defined (related to #4803)
62d3e61
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment