[Proj] How to offset height above ellipsoid.

Hermann Peifer peifer at gmx.eu
Mon Mar 23 20:56:52 EST 2015


Hi Paul,

As a confessing non-programmer, I can't answer your C API related 
question, but I do have some hints below, as you mentioned cs2cs and a 
"gtx" file with only one value.

The horizontal null shift has 3 x 3 zero values. I tried to be smart the 
other day and gdal_translated it into a 3 x 3 null.gtx file, which cs2cs 
did not like (as far as I understand it), throwing a weird error 
message. The same error occurred for my 4 x 4 and 5 x 5 null.gtx file 
(which were technically OK, according to their hexdump). Eventually, I 
went for the 7 x 7 option, see [0] and [1] below.

Hermann

P.S. and by the way:
If some "inline" solution for a 0-shift (horizontal, or vertical) would 
make sense (which I obviously can't tell): it should have been invented, 
say: 10 years ago, in order to avoid the FAQ: what does the '@' mean, in 
+nadgrids=@null ?


[0] "gta" representation of my null.gtx
-90 -180 30 60 7 7
0
0
0
(46 more zeros here...)

[1] One can simply do: gdal_translate -of gtx null.asc null.gtx
$ cat null.asc
ncols        7
nrows        7
xllcorner    -210.000000000000
yllcorner    -105.000000000000
dx           60.000000000000
dy           30.000000000000
NODATA_value  -88.88880157470703125
  0 0 0 0 0 0 0
  0 0 0 0 0 0 0
  0 0 0 0 0 0 0
  0 0 0 0 0 0 0
  0 0 0 0 0 0 0
  0 0 0 0 0 0 0
  0 0 0 0 0 0 0



On 2015-03-23 23:14, Paul Chavent wrote:
> Hi.
>
> I try to convert lat/long coordinates to eqc. The origin of the eqc projection plane is at (43.315959 1.402896 320.000). My eqc specification take into account the altitude of the projection plane, so the plane should be tangeant to a sphere with a radius of 6368437.553703493.
>
> The specification of the translation is then :
>
> +proj=longlat +datum=WGS84 +no_defs +to +proj=eqc +a=6368437.553703493 +lat_ts=43.315959 +lat_0=43.315959 +lon_0=1.402896 +no_defs
>
> At this point, if i give an altitude in the LLA input, it isn't translated since no datum have been specified for my destination projection.
>
> For datum conversion, +towgs84 and +nadgrids seems to be the preferred choice for horizontal datum shifting, although +geoidgrid seems the preferred way for vertical datum shift.
>
> In order to add a constant offset to the LLA altitude, i could provide a "gtx" file with only one value for the whole lat/long space.
>
> I wonder if it is a good practice, or if there is other way of doing it ?
>
> Wouldn't be possible to specify the offset on the description string for such a simple case (that also would be easier in the case of the usage of the c API with frequent altitude offset changes) ?
>
> The expected result is
>
> cs2cs -rs \
>       +proj=longlat \
>       +datum=WGS84 \
>       +no_defs \
>       +to \
>       +proj=eqc \
>       +a=6368437.553703493 \
>       +lat_ts=43.3159590 \
>       +lat_0=43.3159590 \
>       +lon_0=1.4028960 \
>       +no_defs \
>        <<EOF
> 43.3159590  1.4028960  320
> 43.3155991  1.4024014  340
> 43.3155991  1.4033906  360
> 43.3163189  1.4033906  380
> 43.3163189  1.4024014  300
> EOF
>      0     0   0
>    -40   -40   20
>    -40    40   40
>     40    40   60
>     40   -40  -20
>
>
> Thanks for your help.
>
> Regards.
>
> Paul.
> _______________________________________________
> Proj mailing list
> Proj at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/proj
>




More information about the Proj mailing list