[PROJ] Vertical Transformations?
Even Rouault
even.rouault at spatialys.com
Fri Feb 22 11:43:08 PST 2019
Hi Paul,
> So, this is interesting... when running at the command-line, I get
> your "no grid" result...
>
> echo "45 -100 100" | cs2cs -f "%.8f" EPSG:7406 EPSG:5500
> 44.99998071 -100.00039555 30.48006096
>
> When running the same thing in PostGIS, I get an error code back...
>
> select st_astext(st_transform('SRID=7406;POINT(-80 40 100)'::geometry,
> 5500)); NOTICE: PostGIS was unable to transform the point because either
> no grid shift files were found, or the point does not lie within the
> range for which the grid shift is defined. Refer to the ST_Transform()
> section of the PostGIS manual for details on how to configure PostGIS
> to alter this behaviour.
> ERROR: transform: couldn't project point (-80 40 100): failed to load
> datum shift file (-38)
>
> Specifically, error -38.
> I guess now we get into angels-on-head-of-pin territory,
> but are there
> proj error conditions that are best ignored? Raise a NOTICE? Something
> else?
If that works with cs2cs, there is no reason that it shouldn't work in PostGIS
I assume the grid error here is due to the horizontal part being not fed with
appropriate coordinates: isn't there an issue with axis order here ? (although
I couldn't reproduce error -38 when using wrong axis order). You should pass
lat,long,Z to proj_trans(). Perhaps you didn't take into account the case of a
CompoundCRS like EPSG:7406 ? A CompoundCRS doesn't have a coordinate system
per se, so you must first query the horizontal component by using
horiz_crs = proj_crs_get_sub_crs(ctx, compound_crs, 0), and then getting its
coordinate system.
>
> Also, I just installed version 1.8 of the proj grids project, is it
> expected that I still not have the vertical grids in place for
> NGVD29/NAVD88 conversion?
Yes, I explicitly mentionned
https://download.osgeo.org/proj/proj-datumgrid-north-america-1.2RC1.tar.gz
proj-datumgrid-1.8 is just the general purposes / historical grids.
New grids get added in "regional" packages -europe, -north-america, -oceania,
-world
Apparently, this split of grids among several packages confuse people.
Kristian, shouldn't we perhaps provide a proj-datumgrid-all package ? Although
people would probably confuse it with proj-datumgrid...
Even
--
Spatialys - Geospatial professional services
http://www.spatialys.com
More information about the PROJ
mailing list