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

Denis Rouzaud denis.rouzaud at gmail.com
Sat Apr 20 05:17:33 PDT 2019


Hi Tim,

Are you looking for st_force3d?
https://postgis.net/docs/ST_Force_3D.html

Denis

On Sat, 20 Apr 2019, 07:13 Tim Sutton, <tim at kartoza.com> wrote:

> 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:
>
> UPDATE poi SET
>   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!
>
> Regards
>
> Tim
>
>>
>
>
>
>
>
>
>
> *Tim Sutton*
>
> *Co-founder:* Kartoza
> *Ex Project chair:* QGIS.org
>
> Visit 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.
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20190420/eead26ec/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/eead26ec/attachment.jpg>


More information about the postgis-users mailing list