[postgis-users] Converting a Polygon geometry column to PolygonZ

Tim Sutton tim at kartoza.com
Sat Apr 20 05:12:55 PDT 2019

Dear PostGIS Geniuses :-)

I am in the process of converting many of my tables from using XY to XYZ. For point tables I did it by adding a new geom2 column and populating it like this:

  geom2 = st_geomfromewkt( 
    'SRID=20790;POINT(' || 
    st_x(st_transform(geom, 20790)) || 
    ' ' || 
    st_y(st_transform(geom, 20790)) || 
    ' 0)');
Then dropping the geom column and renaming geom2 to geom.

I’d like to also have my polygon and line sting layers become Z enabled. Are there any functions that do this or do I have to come up with a way to deconstruct the geometries to vertices, use a method like above and then reconstruct them?

Any pointers will be greatly appreciated!




Tim Sutton

Co-founder: Kartoza
Ex Project chair: QGIS.org

Visit http://kartoza.com <http://kartoza.com/> to find out about open source:

Desktop GIS programming services
Geospatial web development
GIS Training
Consulting Services

Skype: timlinux 
IRC: timlinux on #qgis at freenode.net

I'd love to connect. Here's my calendar link <https://calendly.com/timlinux> to make finding time easy.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20190420/48f9a8f9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: KartozaNewLogoThumbnail.jpg
Type: image/jpeg
Size: 6122 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20190420/48f9a8f9/attachment.jpg>

More information about the postgis-users mailing list