[postgis-users] POINT Z geometry transformation issue

Klemen Špruk spruk.klemen at gmail.com
Fri May 25 07:19:35 PDT 2018


Hello Felix!

Thank for your answer.

Code 3795 was my typing error. It should be 3794. The right statement:
with data as (
select st_setsrid(st_makepoint(466180.66, 110950.00, 500), 3912) as point)
select st_astext(data.point) as ok,
st_astext(st_transform(data.point, 3794)) as not_ok from data;

3912 uses Bessel ellipsoid and 3794 uses GRS80. Upper query gives result:

If I transform to EPSG:3907 which also uses Bessel:
with data as (
select st_setsrid(st_makepoint(466180.66, 110950.00, 500), 3912) as point)
select st_astext(data.point) as ok,
st_astext(st_transform(data.point, 3907)) as not_ok from data;

The result is ok

Thanks for answer!


On Fri, May 25, 2018 at 3:25 PM, Felix Kunde <felix-kunde at gmx.de> wrote:

> It's not a bug. I think, it's because you're changing the datum. EPSG 3795
> (https://epsg.io/3795) uses the Clarke Spheroid, EPSG 3912 (
> https://epsg.io/3912) uses Bessel. Different height triangulation. In
> case, you want to keep the Z value, you need to cache it to replace the
> tranformed value. Btw. Cuba CRS -> Slovenvia CRS ?!!
>
>
> Von: "Klemen Špruk" <spruk.klemen at gmail.com>
> An: postgis-users at lists.osgeo.org
> Betreff: [postgis-users] POINT Z geometry transformation issue
>
> Hello!
>
> I have a issue with Z coordinate value when transforming coordinates:
>
> Simlple test on postgresql-postgis server:
>
> with data as (
> select st_setsrid(st_makepoint(466180.66, 110950.00, 500), 3912) as point)
> select st_astext(data.point) as ok,
> st_astext(st_transform(data.point, 3795)) as not_ok from data;
>
>
> When transforming point to other SRID Z value is corrupted.
> Query result:
>
> DB server info: PostgreSQL 10.1 on x86_64-pc-linux-gnu, compiled by gcc
> (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609, 64-bit POSTGIS="2.4.3
> r16312" PGSQL="100" GEOS="3.5.1-CAPI-1.9.1 r4246" PROJ="Rel. 4.9.2, 08
> September 2015" GDAL="GDAL 1.11.3, released 2015/09/16" LIBXML="2.9.3"
> LIBJSON="0.11.99" LIBPROTOBUF="1.2.1" RASTER
>
> Does anyone have any idea why Z value is corrupted or I am I doing
> something wrong or this is a bug?
>
> Thank Klemen!_______________________________________________
> postgis-users mailing list postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
> _______________________________________________
> 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/20180525/cdd1e0e5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 7582 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20180525/cdd1e0e5/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 7768 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20180525/cdd1e0e5/attachment-0001.png>


More information about the postgis-users mailing list