[Gdal-dev] need tools for TIF image reprojection

Charles Wivell Charles.Wivell at dnr.state.mn.us
Fri Jul 14 11:23:15 EDT 2006


Hi Zhonghai;

Yup, I just found that document myself (but thanks). Pretty simple even though I don't read Swiss (but math is universal).

The equations shown are approximations of the full transform (pretty good ones to about 1 meter). But they assume some original datum. Maybe the images you have are not in this original datum (most likely they are ok, but might be worth checking). When you compare the original tiffs to a reference in the Swiss National System, are they accurate? If they are accurate, then the original datum is ok and there is something wrong with the transforming software.

I write custom code (MS VS C++) and it would take me about a day to write a ditty (scientific name for quick program) to convert your tiffs, but I'd need example tiffs and a reference (to make sure I got it right). 

Did you try using the individual point transform calculations on those web sites to see if GDAL matches the results from them?

Have you done a full re-projection of an image and checked its accuracy? The upper left corner values might be different if there is any rotation between the two map projections. The software either has to pad the image or cut off part of image so the image fits in the frame if there is rotation (or other non-linear differences betweent the projections).

Chuck Wivell

P.S. Sorry if you know all this already....




>>> "Zhonghai Wang" <zhonghaiw at gmail.com> 7/14/2006 8:53 AM >>>
Hi Charles,

you are right, the errors are somehow like that.

acturally, the transformation process can be done a little bit simple:

Swiss National System -> WGS84 -> ETRS89 / UTM 32N

talking about WGS84 and ETRS89, they are almost the same, so there is no
need to make any transformtion between them.

BTW, this info may be useful for you, it's a official document:

http://www.swisstopo.ch/en/online/calculation/index 
http://www.swisstopo.ch/pub/down/basics/geo/system/ch1903_wgs84_en.pdf 


kind regards

zhonghai


>>> "Zhonghai Wang" <zhonghaiw at gmail.com> 7/14/2006 2:52 AM >>>
Hi Andrew,

you are right, in the most cases the GDAL utilities work well, and I've also
use the GDAL utilities for a long time, especially the FWTools made by
Frank, we should all thank Frank for such a wonderful GIS toolkit.

I've check again and again with the GDALWARP, but things are not going in
the right way. I am trying to translate the TIF images from the coordinate
system CH1903 (Swiss National System) to ETRS89 / UTM ZONE 32N, and there
are always  some displacement with the base maps, I am sure that the base
map and the original coordinate info for the TIF is correct. and here is an
example:

(the transforming process is : CH1903 -> WGS84 -> ETRS89 / UTM ZONE 32N)

the TIF image coordinate Info (*.tif): (Swiss National System)
 0.500000
 0.000000
 0.000000
 -0.500000
 598125.250000
199999.750000

If I transform the coordinate to WGS84 with GDAL, the value is:

0.0000059839
0.0000000000
0.0000000000
-0.0000059839
7.4149523128
46.9529994915

but the lon/lat of the upper left corner should be:

7.41401039348263
46.9510762167473

I would say that this is already big difference, because If I use this
lon/lat to get the UTM coordinate, this small difference will be propagated,
and will cause a displacement about hundreds meters.

I am trying to find the source code, which does this coordinate
transformation, so that I can check if the transformation parameters are
correct, but unfortunately I can not find the source for this.


If someone has done something similar, please point me out how to fix this
problem, especially the GIS people in Switzerland. I would really appreciate
it.

zhonghai

On 7/14/06, Andrew Williams <awilliams at rapidmap.com.au> wrote:
>
> zhonghai,
> I've litterally translated hundereds of TIF's from all over the world from
> multiple projections to multiple projections. I have also had "failures".
> However, in every case, it was either my fault in specifying the -s_srs or
> -t_srs. In some cases the fault lay in the original image. The TIFF itself
> was supplied with incorrect georefernceing information and so it was never
> going to work.
>
> Have you got a dump from GDALINFO that we can see and the GDALwarp command
> line you've used?
>
> regards
> Andrew
>
>        -----Original Message-----
>        From: Zhonghai Wang [mailto:zhonghaiw at gmail.com] 
>        Sent: Fri 7/14/2006 12:14 AM
>        To: gdal-dev at lists.maptools.org 
>        Cc:
>        Subject: [Gdal-dev] need tools for TIF image reprojection
>
>
>        Hi guys,
>
>        I need a tool to reproject my TIF images, either free or non-free
> software.
>        I've tried with the GDAL utilities, sure I can do the reprojection,
> but the coordinates seems not correct, there are serveral hundert meters
> displacement according to the my base maps.
>
>        thanks for your info.
>
>        zhonghai
>
>
>
>




More information about the Gdal-dev mailing list