Sign up ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a table containing 3D geometry in a PostGIS 2.0 database (the geometry is of type LINESTRING Z).

I need to get the geometry out and into a DXF, DGN or 3D Shapefile. What is the easiest way to do this?

(I was sure I had achieved this via QGIS before, but it seems to remove the Z value and produce only a 2D file when attempting a 'Save As ...' from a PostGIS layer).

share|improve this question

1 Answer 1

up vote 1 down vote accepted

GDAL is able to do this. The following command creates a 3D Shapefile:

ogr2ogr -f "ESRI Shapefile" "~/myshape" PG:"user={user} password={pass} dbname={dbname} host={host}" {table}

QGIS is not able to handle 3D geometries. I would be very surprised, if it would be able to transform 3D information from one format to another.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.