<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<font face="Times New Roman, Times, serif">This is the solution,
thanks Andre. </font><br>
<br>
<br>
<div class="moz-cite-prefix">On 01/20/2013 07:28 PM, Andre Joost
wrote:<br>
</div>
<br>
<br>
<blockquote cite="mid:kdhd1b$bnm$1@ger.gmane.org" type="cite">
<pre wrap="">dx values inverted:</pre>
</blockquote>
<br>
<font face="Times New Roman, Times, serif">To summarize: creating an
ntv2 file with gdal utilities:<br>
<br>
Let's say you have a list of coordinates in a non-wgs84
projection, and a list of the same locations in wgs84. You want to
create an ntv2-file to shift from one to the other.<br>
<br>
1) transfer the original coordinates to latlon, without a wgs84
shift<br>
2) compute for each point the distance in degrees between the
wgs84 location and the original latlon-location<br>
3) separate the distance in its lon and lat component, and
multiply both numbers by 3600<br>
4) invert the lon-value (<==== this was the problem)<br>
5) create two point files, one for the lons and one for the lats.
The coordinates should be the wgs84 values, and the z-value the
lon or lat. Look on the gdal_grid page how to create a
vrt-version, it's also possible with postgis or any other
ogr-format. Create also a point-file with the same coordinates and
all z-values set to zero<br>
6) create for these three point-files each a gridded raster with
gdal_grid. Set reasonable boundaries in wgs84 with -txe and -ty,
and choose output format Float32<br>
7) merge the grids into a four-band geotif: gdal_merge -separate
-o <shiftgrid> <latgrid> <longrid>
<zerogrid> <zerogrid>. Mind the order: lat first<br>
8) invert the y-direction in <shiftgrid>: gdalwarp
<shiftgrid> <new_shiftgrid> (<=== this was another
problem. Is this a bug?)<br>
9) convert to ntv2: gdal_translate <new_shiftgrid>
<ntv2_grid><br>
<br>
I would appreciate if someone would test the procedure on their
own data, and if it works, to add it to the documentation.<br>
<br>
Thanks for all your help!<br>
<br>
Jan<br>
<br>
PS I fully agree with Gerald Evenden on the reversal of the
lon-values in the ntv2-format<br>
<br>
<a class="moz-txt-link-freetext" href="http://osgeo-org.1560.n6.nabble.com/NTv2-info-td3842825.html">http://osgeo-org.1560.n6.nabble.com/NTv2-info-td3842825.html</a><br>
</font><br>
<font face="Times New Roman, Times, serif">I seem to get the idea
that the Canadians developed this format---comments <br>
please---and if they did then the designers deserve to be flogged
for 8 days <br>
with wet noodles for "positive east longitude." I can't believe
it!!!! What <br>
is unbelievable arrogance by whoever had that stupid---yes, *VERY*
<br>
stupid---idea. <br>
<br>
</font><br>
</body>
</html>