Opened 5 years ago

Closed 5 years 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: loader/dumper Version: trunk
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 5 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 (6)

comment:1 Changed 5 years ago by strk

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

comment:2 Changed 5 years ago by strk

Milestone: PostGIS 2.1.3

comment:3 Changed 5 years ago by strk

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 Changed 5 years ago by strk

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 Changed 5 years ago by strk

Keywords: history added
Resolution: fixed
Status: assignedclosed

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

Changed 5 years ago by RemiC

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

Note: See TracTickets for help on using tickets.