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

Tim Sutton tim at kartoza.com
Sat Apr 20 15:23:12 PDT 2019


Hi Denis


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



Thanks for your reply.  Yeah I have a process working like this:

DROP VIEW vw_aoi;
DROP VIEW vw_boundary;
ALTER TABLE camps
    ALTER COLUMN geom TYPE geometry(PolygonZ,20790) USING ST_Force3D(geom);
CREATE VIEW vw_boundary AS  SELECT 1,
    st_union(camps.geom) AS geom
   FROM camps;   
CREATE VIEW vw_aoi AS  SELECT 1 AS id,
    st_buffer(st_envelope(vw_boundary.geom), 50::double precision) AS geom
   FROM vw_boundary;

I was more wondering if there is a way to do the update of the geometry type without having to drop all related views etc. and restore them again?

Regards

Tim
—









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/23fff224/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/23fff224/attachment.jpg>


More information about the postgis-users mailing list