Opened 10 years ago

Closed 10 years ago

Last modified 5 months ago

#2700 closed defect (fixed)

pgsql2shp output 2D when null geom in 3D table

Reported by: RemiC Owned by: strk
Priority: medium Milestone: PostGIS 2.1.3
Component: utils/pgsql2shp Version: master
Keywords: pgsql2shp null geom 3D 2D history Cc:

Description

When using pgsql2shp with a table declared as 3D geom, but containing null geom (possibly at the beginning), the programm create a 2D shapefile instead of a 3D shapefile.

Attachments (1)

pgsql2shp_debug.backup (125.9 KB ) - added by RemiC 10 years ago.
This dump create a table with mixed null and 3D linestring geom. Using pgsql2shp produce 2D output instead of 3D output

Download all attachments as: .zip

Change History (7)

comment:1 by strk, 10 years ago

Could you please show exact commandline ? Also, are you able to provide a small test dataset to add to the regression testsuite ?

comment:2 by strk, 10 years ago

Milestone: PostGIS 2.1.3

comment:3 by strk, 10 years ago

I think the problem is with max(ST_ZMFlag(geom)) returning null on null geometries and thus being interpreted as 0 as the max. A COALESCE should help.

comment:4 by strk, 10 years ago

Owner: changed from mcayland to strk
Status: newassigned

Nevermind the test dataset, it is easy to reproduce. It's not limited to max() aggregate use, but also to the geometrytype loop. I'm on it.

comment:5 by strk, 10 years ago

Keywords: history added
Resolution: fixed
Status: assignedclosed

r12420 in 2.1 branch (2.1.3), r12421 in trunk (2.2.0)

by RemiC, 10 years ago

Attachment: pgsql2shp_debug.backup added

This dump create a table with mixed null and 3D linestring geom. Using pgsql2shp produce 2D output instead of 3D output

comment:6 by strk, 5 months ago

Component: utils/shapefile-loader-dumperutils/pgsql2shp
Note: See TracTickets for help on using tickets.