[gdal-dev] modify zvalue in database when inserted using zfield option

Donovan Cameron sault.don at gmail.com
Fri Aug 13 14:13:07 PDT 2021


Oh! Thank you! I'm thinking maybe I'll generate a trigger in the 
database to update the zvalue when the ELEVATION field is updated.

On 2021-08-13 2:04 p.m., Jan Heckman wrote:
> Quite possibly in the Z-coordinate of your geometry column. You can 
> check in pgadmin or psql (or another program like omnidb) what the 
> exact type of the postgis geometry in your table is.
> You should see something like geometry(LineStringZM,28992) what i.c. 
> means a dutch projection of a linestring with Z and M coordinates.
> You can access these (outside gdal) only through postgis, like
> select st_astext(st_pointn(polyline,1)) from ehrdtracks limit 1;
>             st_astext
> ----------------------------------
>  POINT ZM (71905.9 417771 1504 0)
>
> Esp with points you can formulate an update query replacing the 
> geometry element with a condition,
> using ST_Makepoint(), see https://postgis.net/docs/ST_MakePoint.html 
> <https://postgis.net/docs/ST_MakePoint.html>
>
> Perhaps Qgis might help, too, but I can't tell for sure.
>
> Hope this helps,
> Jan
>
> On Fri, Aug 13, 2021 at 10:34 PM Saulteau Don <sault.don at gmail.com 
> <mailto:sault.don at gmail.com>> wrote:
>
>     I used ogr2ogr to append contours into a larger dataset. I opted
>     for the zfield option using the ELEVATION field.
>
>     I realized one of my contours has a bad value and need to modify
>     it to match the other contours it is connected to.
>
>     I can edit the attribute ELEVATION fine, but when I rerun a mesh
>     tool it uses the zfield like its the old value instead of the
>     modified one in the ELEVATION field.
>
>     Where are the zvalues hidden in PostGIS to change them? Do I
>     delete the old line and re-append after I've made the change?
>     That's one option but I was wondering if I can just easily edit it
>     inside postgis first.
>
>
>
>     Donovan
>     _______________________________________________
>     gdal-dev mailing list
>     gdal-dev at lists.osgeo.org <mailto:gdal-dev at lists.osgeo.org>
>     https://lists.osgeo.org/mailman/listinfo/gdal-dev
>     <https://lists.osgeo.org/mailman/listinfo/gdal-dev>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20210813/630cecbd/attachment.html>


More information about the gdal-dev mailing list