I have PostGIS table with 2 geometries ( "GEOMETRY(MULTILINESTRINGZ)" and "GEOMETRY(LINESTRINGZ)" ). There are lines made just from 2 points - XY are WGS and both of them have random elevation Z (I hope default units are meters).

Example from ST_AsTExt(geom): 1) LINESTRINGZ (2.17766 41.3885803 0,2.18333 41.3833 754) 2) MULTILINESTRING Z ((2.17766 41.3885803 0,2.18333 41.3833 754))

I tried to visualize them in ArcScene, ArcGlobe, qgis2three and I can't see them as 3D nowhere. They act as 2D...

I also tried export to SHP with ogr:

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

... and checked with "ogrinfo file.SHP" which just says it's Linestring for both files (nothing about multilinestringz and Z coordinate).

None of two SHP's were displayed as 3D.

So, is there any error in my geometry types?

Should I specify CRS in data type?

Should I add Z coordinate CRS/unit somehow?

Are any other options required to set them as 3D in Arc* products?

Is there any other easy option to export and check 3D of at least few lines somehow (I am now going to explore possibilities of 3D in ST_AsGeoJson, later maybe Grass GIS)?

  • 1
    If all your tools agree the coordinates do not contain Z values, they might be right. – Vince Jan 11 '16 at 13:59
  • As per the tour there should be only one question asked per question. – PolyGeo Jan 11 '16 at 19:53
  • Does it help if the data is converted to shape using -dim 3 -zfield {field_name}? That would make gdal change the coordinate dimension to 3D. – SaultDon Jan 11 '16 at 19:55

With GRASS GIS, you can create 3D geometries with:

  • a 3D shapefile
  • a 2D shapefile with z as an attribute

3D polygon(s) (shapefile 3D) and points (shapefile 2D with z as attribute)

enter image description here

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