[gdal-dev] OGR/PROJ with +geoidgrids

Even Rouault even.rouault at mines-paris.org
Wed Aug 17 14:12:49 EDT 2011


Le mercredi 17 août 2011 03:24:58, Ben Discoe a écrit :
> It is true that geocentric XYZ coordinates are not very useful, without
> being able to convert them to coordinate with orthometric ("geoid") ("sea
> level") height.
> 
> Frank implemented 'preliminary' support for this, which i am preparing to
> test now.  Before expecting it to work in GDAL/OGR, i thought i should try
> it down in PROJ.4 first, following the description on
> http://trac.osgeo.org/proj/wiki/VerticalDatums
> 
> If i try a point near me in California, it works regularly:
> 
> cs2cs +proj=latlong +datum=WGS84 +to +proj=utm +zone=10 +datum=WGS84
> -122.272778 37.871667 10
> 563959.68       4191825.55 10.00
> 
> But if i try to provide a geoid file (from
> http://download.osgeo.org/proj/vdatum/usa_geoid2009.zip) then it seems to
> not work:
> 
> cs2cs +proj=latlong +datum=WGS84 +to +proj=utm +zone=10 +datum=WGS84
> +geoidgrids=g2009conus.gtx -122.272778 37.871667 10
> Rel. 4.7.1, 23 September 2009
> <cs2cs>: while processing file: <stdin>, line 1
> pj_transform(): Unknown error
> *       * 10.00
> 
> The goal is to transform the input elevation (10 meters, ellipsoidal
> height, i presume) to an orthometric height (which will use the geoid, i
> presume).
> 
> Maybe i'm doing it wrong?

Not sure what you would be doing wrong, but works for me :

$ PROJ_DEBUG=ON ~/gdal/proj/install-proj/bin/cs2cs  +proj=latlong +datum=WGS84 
+to +proj=utm +zone=10 +datum=WGS84 +geoidgrids=g2009conus.gtx
pj_open_lib(proj_def.dat): call fopen(/home/even/gdal/proj/install-
proj/share/proj/proj_def.dat) - succeeded

pj_open_lib(proj_def.dat): call fopen(/home/even/gdal/proj/install-
proj/share/proj/proj_def.dat) - succeeded

-122.272778 37.871667 10
pj_open_lib(g2009conus.gtx): call fopen(/home/even/gdal/proj/install-
proj/share/proj/g2009conus.gtx) - succeeded

GTX 4201x2041: LL=(-130,24) UR=(-60,58)
pj_open_lib(g2009conus.gtx): call fopen(/home/even/gdal/proj/install-
proj/share/proj/g2009conus.gtx) - succeeded

pj_apply_gridshift(): used GTX Vertical Grid Shift File
563959.68	4191825.55 42.27

Do you use latest SVN version of proj ? Do you get interesting info with 
PROJ_DEBUG set ?

> 
> Thanks,
> Ben
> 
> 
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev


More information about the gdal-dev mailing list