Discussion:
[Gdal-dev] Transformation from UTM32 WGS84 (EPSG:32632) to latlong (EPSG:4326)
shortyII
2007-11-21 17:50:59 UTC
Permalink
Hello,
it my first time using gdalwarp for transformation a GTIFF UTM32 WGS84
(EPSG:32632) to latlong (EPSG:4326). I read a lot and tried it several times
with different parameters, but it still doesn't work:

here the info from gdalinfo form my sourcefile
Driver: GTiff/GeoTIFF
Files: l0.tif
Size is 21354, 28920
Coordinate System is:
LOCAL_CS["unnamed",
UNIT["unknown",1]]
Origin = (32270953.125000000000000,6114921.875000000000000)
Pixel Size = (31.250000000000000,-31.250000000000000)
Metadata:
TIFFTAG_XRESOLUTION=320
TIFFTAG_YRESOLUTION=320
TIFFTAG_RESOLUTIONUNIT=3 (pixels/cm)
Image Structure Metadata:
COMPRESSION=LZW
Corner Coordinates:
Upper Left (32270953.125, 6114921.875)
Lower Left (32270953.125, 5211171.875)
Upper Right (32938265.625, 6114921.875)
Lower Right (32938265.625, 5211171.875)
Center (32604609.375, 5663046.875)
Band 1 Block=21354x1 Type=Byte, ColorInterp=Palette
Color Table (RGB with 256 entries)...

1st try:
gdalwarp -s_srs EPSG:32632 -t_srs EPSG:4326 -srcnodata "-9999" l0.tif
l0_geo.tif
Copying color table from l0.tif to new file.
Creating output file that is 1P x 47502L.
Processing input file l0.tif.
ERROR 1: Too many points (441 out of 441) failed to transform,
unable to compute output bounds.
100 - done.

2nd try:
E:\Stefan\Test>gdalwarp -t_srs "EPSG:4326" -srcnodata "-9999" -co "TFW=YES"
-co "COMPRESS=LZW" l0.tif l0_geo.tif
Copying color table from l0.tif to new file.
ERROR 1: No PROJ.4 translation for source SRS, coordinate
transformation initialization has failed.
Creating output file that is 21354P x 28920L.
Processing input file l0.tif.
ERROR 1: No PROJ.4 translation for source SRS, coordinate
transformation initialization has failed.
:0...10...20...30...40...50...60...70...80...90...100 - done.

The result was:
gdalinfo l0_geo.tif

Driver: GTiff/GeoTIFF
Files: l0_geo.tif
Size is 21354, 28920
Coordinate System is:
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.2572235630016,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]]
Origin = (32270953.125000000000000,6114921.875000000000000)
Pixel Size = (31.249999999999996,-31.249999999999996)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
COMPRESSION=LZW
Corner Coordinates:
Upper Left (32270953.125, 6114921.875) (32270953d 7'115964117022.00"E,
6114921d52'21474836510.00"N)
Lower Left (32270953.125, 5211171.875) (32270953d 7'115964117022.00"E,
5211171d52'17179869214.00"N)
Upper Right (32938265.625, 6114921.875) (32938265d37'120259084318.00"E,
6114921d52'21474836510.00"N)
Lower Right (32938265.625, 5211171.875) (32938265d37'120259084318.00"E,
5211171d52'17179869214.00"N)
Center (32604609.375, 5663046.875)
(32604609d22'115964117022.00"E,5663046d52'21474836510.00"N)
Band 1 Block=21354x1 Type=Byte, ColorInterp=Palette
Color Table (RGB with 256 entries)

The issue is now, that the coordinates are false??

Could anybody help me??? Thanks!
--
View this message in context: http://www.nabble.com/Transformation-from-UTM32-WGS84-%28EPSG%3A32632%29-to-latlong-%28EPSG%3A4326%29-tf4241391.html#a12068685
Sent from the GDAL - Dev mailing list archive at Nabble.com.
Frank Warmerdam
2007-11-21 17:50:59 UTC
Permalink
Post by shortyII
Hello,
it my first time using gdalwarp for transformation a GTIFF UTM32 WGS84
(EPSG:32632) to latlong (EPSG:4326). I read a lot and tried it several times
here the info from gdalinfo form my sourcefile
Driver: GTiff/GeoTIFF
Files: l0.tif
Size is 21354, 28920
LOCAL_CS["unnamed",
UNIT["unknown",1]]
Origin = (32270953.125000000000000,6114921.875000000000000)
Pixel Size = (31.250000000000000,-31.250000000000000)
TIFFTAG_XRESOLUTION=320
TIFFTAG_YRESOLUTION=320
TIFFTAG_RESOLUTIONUNIT=3 (pixels/cm)
COMPRESSION=LZW
Upper Left (32270953.125, 6114921.875)
Lower Left (32270953.125, 5211171.875)
Upper Right (32938265.625, 6114921.875)
Lower Right (32938265.625, 5211171.875)
Center (32604609.375, 5663046.875)
Hi,

The above coordinates are not UTM 32 meter values. The earth is only
roughly 40 million meters around at the equator, so an x offset of
32 million meters is crazy. Transverse Mercator rapidly degrees past about
10 degrees off the central meridian.

So, I think the problem is that the input coordinate system is not UTM 32
*or* you have the units wrong or the file was essentially screwed up by
some previous attempt to convert it to utm 32.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, ***@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | President OSGeo, http://osgeo.org
shortyII
2007-11-21 17:50:59 UTC
Permalink
Post by Frank Warmerdam
Hi,
The above coordinates are not UTM 32 meter values. The earth is only
roughly 40 million meters around at the equator, so an x offset of
32 million meters is crazy. Transverse Mercator rapidly degrees past about
10 degrees off the central meridian.
So, I think the problem is that the input coordinate system is not UTM 32
*or* you have the units wrong or the file was essentially screwed up by
some previous attempt to convert it to utm 32.
Hi,
This coordinates are UTM 32. The first 2 numbers of the easting describe the
UTM strip (32). This notation is quite common (at least at german federal
agency for cartography and geodesie).
I could read about this problem quite often here in the mailing-archive, but
I couldn't find any solution. Is there a possibility to correct the gtiff .
The federal agenceny explains:
"As download text files are offered that contain a definition of the
georeferencing for use in the PROJECT command of ArcInfo Workstation. For
the UTM projections the indication "xshift 3..." applies to a use of the
parameters under OUTPUT. For a use under INPUT "xshift -3..." has to be
applied or the accurate definition of your UTM coordinates has to be
considered, respectively."
Can gdalwarp do any "xshifts" ?
Thanks for helping!
--
View this message in context: http://www.nabble.com/Transformation-from-UTM32-WGS84-%28EPSG%3A32632%29-to-latlong-%28EPSG%3A4326%29-tf4241391.html#a12086391
Sent from the GDAL - Dev mailing list archive at Nabble.com.
WolfgangZ
2007-11-21 17:50:59 UTC
Permalink
Post by shortyII
Post by Frank Warmerdam
Hi,
The above coordinates are not UTM 32 meter values. The earth is only
roughly 40 million meters around at the equator, so an x offset of
32 million meters is crazy. Transverse Mercator rapidly degrees past about
10 degrees off the central meridian.
So, I think the problem is that the input coordinate system is not UTM 32
*or* you have the units wrong or the file was essentially screwed up by
some previous attempt to convert it to utm 32.
Hi,
This coordinates are UTM 32. The first 2 numbers of the easting describe the
UTM strip (32). This notation is quite common (at least at german federal
agency for cartography and geodesie).
I could read about this problem quite often here in the mailing-archive, but
I couldn't find any solution. Is there a possibility to correct the gtiff .
"As download text files are offered that contain a definition of the
georeferencing for use in the PROJECT command of ArcInfo Workstation. For
the UTM projections the indication "xshift 3..." applies to a use of the
parameters under OUTPUT. For a use under INPUT "xshift -3..." has to be
applied or the accurate definition of your UTM coordinates has to be
considered, respectively."
Can gdalwarp do any "xshifts" ?
Thanks for helping!
I don't know if there is a more elegant way to do it but you can try the
following approach:

1. create a Virtual Raster File for your input map
gdal_translate -of VRT map.tif map.vrt
2. the vrt file is just a ascii file:
edit the lines
"<DstRect xOff="0" yOff="0" xSize="5000" ySize="5000"/>"
to
"<DstRect xOff="-32000000" yOff="0" xSize="5000" ySize="5000"/>"
(you have to do it for all bands in your input map)
3. use the vrt as input for gdal_warp (or for gdal_translate if you just
want a corrected input map).

Regards
Wolfgang
shortyII
2007-11-21 17:50:59 UTC
Permalink
Hi,
thank you Wolfgang. Your solution works, but I had to edit the line
<GeoTransform> 3.2256531250000000e+007...
to
<GeoTransform> 2.56531250000000e+005...

Changing the line <DstRect xOff="-32000000" ... had no effect.

Kind regards,
Stefan
Post by WolfgangZ
I don't know if there is a more elegant way to do it but you can try the
1. create a Virtual Raster File for your input map
gdal_translate -of VRT map.tif map.vrt
edit the lines
"<DstRect xOff="0" yOff="0" xSize="5000" ySize="5000"/>"
to
"<DstRect xOff="-32000000" yOff="0" xSize="5000" ySize="5000"/>"
(you have to do it for all bands in your input map)
3. use the vrt as input for gdal_warp (or for gdal_translate if you just
want a corrected input map).
Regards
Wolfgang
--
View this message in context: http://www.nabble.com/Transformation-from-UTM32-WGS84-%28EPSG%3A32632%29-to-latlong-%28EPSG%3A4326%29-tf4241391.html#a12121371
Sent from the GDAL - Dev mailing list archive at Nabble.com.
WolfgangZ
2007-11-21 17:50:59 UTC
Permalink
Post by shortyII
Hi,
thank you Wolfgang. Your solution works, but I had to edit the line
<GeoTransform> 3.2256531250000000e+007...
to
<GeoTransform> 2.56531250000000e+005...
Changing the line <DstRect xOff="-32000000" ... had no effect.
Kind regards,
Stefan
Sorry, you're right! It should have worked for creating a corrected UTM
file but not directly for warping.

Regards
Wolfgang

Zhonghai Wang
2007-11-21 17:50:59 UTC
Permalink
Hi there,

I am always using the FWTools to do some raster transformation from NUTM32
to WGS84, i didn't get any problems. Normally i do like this:

gdalwarp -s_srs "EPSG:32632" -t_srs "EPSG:4326" -of GTIFF -co TFW=YES
UTM32N_20.tif WGS84_20.tif

I am using the version FWTools-1.3.4.

hope this helps.

Zhonghai
Post by shortyII
Post by Frank Warmerdam
Hi,
The above coordinates are not UTM 32 meter values. The earth is only
roughly 40 million meters around at the equator, so an x offset of
32 million meters is crazy. Transverse Mercator rapidly degrees past about
10 degrees off the central meridian.
So, I think the problem is that the input coordinate system is not UTM
32
Post by Frank Warmerdam
*or* you have the units wrong or the file was essentially screwed up by
some previous attempt to convert it to utm 32.
Hi,
This coordinates are UTM 32. The first 2 numbers of the easting describe the
UTM strip (32). This notation is quite common (at least at german federal
agency for cartography and geodesie).
I could read about this problem quite often here in the mailing-archive, but
I couldn't find any solution. Is there a possibility to correct the gtiff .
"As download text files are offered that contain a definition of the
georeferencing for use in the PROJECT command of ArcInfo Workstation. For
the UTM projections the indication "xshift 3..." applies to a use of the
parameters under OUTPUT. For a use under INPUT "xshift -3..." has to be
applied or the accurate definition of your UTM coordinates has to be
considered, respectively."
Can gdalwarp do any "xshifts" ?
Thanks for helping!
--
http://www.nabble.com/Transformation-from-UTM32-WGS84-%28EPSG%3A32632%29-to-latlong-%28EPSG%3A4326%29-tf4241391.html#a12086391
Sent from the GDAL - Dev mailing list archive at Nabble.com.
_______________________________________________
Gdal-dev mailing list
http://lists.maptools.org/mailman/listinfo/gdal-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20070810/66b87331/attachment.html
Loading...