[gdal-dev] Gdalwarp Mercator problem

Geoff Shipton geoff at tritonimaginginc.com
Thu Jul 12 17:58:46 PDT 2012


Hello again,

 

Been having good success reprojecting TIFs from/to various different
projections (UTMs, State Plane, Mercator etc.)  but I have run into a
problem with gdalwarp generating a particular Mercator GeoTIFF.  At the
bottom of the mail is the console output from three operations:

 

1.       Gdalinfo output from the input, a standard UTM Zone 35N Geotiff

2.       Gdalwarp  output warping to a Mercator Projection.

3.       Gdalinfo output from the resulting Tif.

 

Although the TIF image looks OK and is rotated about as you would expect, as
you can see there are some invalid fields in the output from step #3,

 

In case it helps the three Proj4 strings are:

 

"+proj=utm +zone=35 +datum=WGS84 +units=m +no_defs"  (from the original TIF)

"+proj=merc +datum=WGS84 +lon_0=0 +lat_ts=41.5 +x_0=0 +y_0=2000000" (input
to gdawarp)

"+proj=merc +lon_0=0 +k=1 +x_0=-1.#IND +y_0=0 +datum=WGS84 +to_meter=0
+no_defs" (the proj4 string from the final TIF)

 

If it helps I can provide links to the TIF files.

 

Can anyone spot what I am doing wrong?

 

Many thanks,

 

Geoff

 

STEP#1:

----------------------------------------------------------------------------
--

 

gdalinfo -proj4 G:\Tifftest\Marmara\testTrans_0_TRANS.tif

Driver: GTiff/GeoTIFF

Files: G:\Tifftest\Marmara\testTrans_0_TRANS.tif

       G:\Tifftest\Marmara\testTrans_0_TRANS.tfw

Size is 1030, 740

Coordinate System is:

PROJCS["WGS 84 / UTM zone 35N",

    GEOGCS["WGS 84",

        DATUM["WGS_1984",

            SPHEROID["WGS 84",6378137,298.257223563,

                AUTHORITY["EPSG","7030"]],

            AUTHORITY["EPSG","6326"]],

        PRIMEM["Greenwich",0],

        UNIT["degree",0.0174532925199433],

        AUTHORITY["EPSG","4326"]],

    PROJECTION["Transverse_Mercator"],

    PARAMETER["latitude_of_origin",0],

    PARAMETER["central_meridian",27],

    PARAMETER["scale_factor",0.9996],

    PARAMETER["false_easting",500000],

    PARAMETER["false_northing",0],

    UNIT["metre",1,

        AUTHORITY["EPSG","9001"]],

    AUTHORITY["EPSG","32635"]]

PROJ.4 string is:

'+proj=utm +zone=35 +datum=WGS84 +units=m +no_defs '

Origin = (640314.119512796050000,4530851.144891739800000)

Pixel Size = (0.999893837330017,-0.999390728012785)

Metadata:

  AREA_OR_POINT=Area

  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)

  TIFFTAG_XRESOLUTION=96

  TIFFTAG_YRESOLUTION=96

Image Structure Metadata:

  INTERLEAVE=PIXEL

Corner Coordinates:

Upper Left  (  640314.120, 4530851.145) ( 28d39'58.54"E, 40d55' 0.27"N)

Lower Left  (  640314.120, 4530111.596) ( 28d39'57.94"E, 40d54'36.30"N)

Upper Right (  641344.010, 4530851.145) ( 28d40'42.55"E, 40d54'59.63"N)

Lower Right (  641344.010, 4530111.596) ( 28d40'41.94"E, 40d54'35.66"N)

Center      (  640829.065, 4530481.370) ( 28d40'20.24"E, 40d54'47.96"N)

Band 1 Block=1030x1 Type=Byte, ColorInterp=Red

  Mask Flags: PER_DATASET ALPHA

Band 2 Block=1030x1 Type=Byte, ColorInterp=Green

  Mask Flags: PER_DATASET ALPHA

Band 3 Block=1030x1 Type=Byte, ColorInterp=Blue

  Mask Flags: PER_DATASET ALPHA

Band 4 Block=1030x1 Type=Byte, ColorInterp=Alpha

 

STEP#2

----------------------------------------------------------------------------
--

 

Gdalwarp -co TFW=YES -t_srs "+proj=merc +datum=WGS84 +lon_0=0 +lat_ts=41.5
+x_0=0 +y_0=20

00000" G:\Tifftest\Marmara\testTrans_0_TRANS.tif
G:\Tifftest\Marmara\test.tif

Creating output file that is 1044P x 759L.

Processing input file G:\Tifftest\Marmara\testTrans_0_TRANS.tif.

Using band 4 of source image as alpha.

Using band 4 of destination image as alpha.

0...10...20...30...40...50...60...70...80...90...100 - done.

 

STEP#3

----------------------------------------------------------------------------
---

 

 

gdalinfo -proj4 G:\Tifftest\Marmara\test.tif

Driver: GTiff/GeoTIFF

Files: G:\Tifftest\Marmara\test.tif

       G:\Tifftest\Marmara\test.tfw

Size is 1044, 759

Coordinate System is:

PROJCS["unnamed",

    GEOGCS["WGS 84",

        DATUM["WGS_1984",

            SPHEROID["WGS 84",6378137,298.257223563,

                AUTHORITY["EPSG","7030"]],

            AUTHORITY["EPSG","6326"]],

        PRIMEM["Greenwich",0],

        UNIT["degree",0.0174532925199433],

        AUTHORITY["EPSG","4326"]],

    PROJECTION["Mercator_1SP"],

    PARAMETER["central_meridian",0],

    PARAMETER["scale_factor",1],

    PARAMETER["false_easting","-1.#IND"],

    PARAMETER["false_northing","1.#INF"],

    UNIT["degree minute second hemisphere",0,

        AUTHORITY["EPSG","9108"]]]

PROJ.4 string is:

'+proj=merc +lon_0=0 +k=1 +x_0=-1.#IND +y_0=0 +datum=WGS84 +to_meter=0
+no_defs

'

Origin = (2393508.975926194800000,5729350.050399892000000)

Pixel Size = (0.990987191737565,-0.990987191737565)

Metadata:

  AREA_OR_POINT=Area

Image Structure Metadata:

  INTERLEAVE=PIXEL

Corner Coordinates:

Upper Left  ( 2393508.976, 5729350.050) (  0d 0' 0.03"E,  0d 0' 0.01"N)

Lower Left  ( 2393508.976, 5728597.891) (  0d 0' 0.03"E,  0d 0' 0.01"N)

Upper Right ( 2394543.567, 5729350.050) (  0d 0' 0.03"E,  0d 0' 0.01"N)

Lower Right ( 2394543.567, 5728597.891) (  0d 0' 0.03"E,  0d 0' 0.01"N)

Center      ( 2394026.271, 5728973.971) (  0d 0' 0.03"E,  0d 0' 0.01"N)

Band 1 Block=1044x1 Type=Byte, ColorInterp=Red

  Mask Flags: PER_DATASET ALPHA

Band 2 Block=1044x1 Type=Byte, ColorInterp=Green

  Mask Flags: PER_DATASET ALPHA

Band 3 Block=1044x1 Type=Byte, ColorInterp=Blue

  Mask Flags: PER_DATASET ALPHA

Band 4 Block=1044x1 Type=Byte, ColorInterp=Alpha

Geoff Shipton,
Triton Imaging Inc.
Customer Support.
Capitola CA.
 <mailto:geoff at tritonimaginginc.com> geoff at tritonimaginginc.com

The information contained in this message may be privileged or confidential
information intended solely for the use of the addressee(s).  Any views or
opinions presented in this communication do not necessarily represent those
of Triton Imaging, Inc.  If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.  If you have received
this communication in error, please immediately notify me and you are hereby
instructed to delete all electronic copies and destroy all printed copies.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120712/fa263474/attachment-0001.html>


More information about the gdal-dev mailing list