[gdal-dev] Correct gdalwarp usage from UTM to Equidistant Cylindrical Projection

Christopher Hunt huntc at internode.on.net
Tue Jul 15 22:16:15 EDT 2008


Hi Frank,

Thanks so much for responding. Here are my responses...

On 16/07/2008, at 10:09 AM, Frank Warmerdam wrote:

> This world file gives consistent locations for the upper left
> corner.  I didn't try the bottom right corner, but how did you
> come up with 45 meter pixels when the metadata indicated
> "Native Resolution: 15" which I might guess to mean 15m pixels?
Yes, that is interesting isn't it... the description of the image  
(ReadMe.txt) and the world file both came from TerraServer.

Given that the overall area is 18,225.00 sq km (it also tells me that  
in the readme) and the dimensions are 3000x3000, I get 45m per pixel.  
So who knows what the 15 refers to...

>>>
> Please, always use datum definitions when using PROJ.4 style strings.
> So the -t_srs argument would be '+proj=eqc +datum=WGS84'.  It likely
> doesn't matter, but it makes my skin crawl not to have this specified.
We wouldn't want that! I shall do this.

>> I certainly get a resultant image but I'm not experienced enough  
>> with cartography to understand whether the image is correct.
>> One thing that does confuse me slightly is that the centre lat/long  
>> in the resultant image is not the same as in the source image... I  
>> would have expected that they would be, or at least that the top  
>> left corner (which is what I thinking the northerly and easterly  
>> parameters point to) should be the same.
>
> The center and top left should be similar, but need not be exactly
> the same.  The UTM image will have a non-rectangular shape in a
> different projection and so the region of the output image will be
> somewhat larger than the original image (to contain the odd shape).
> This will have some effect on corners and center.  But the differences
> should be modest.
Thanks for the explanation.

> The gdalwarp command will default to creating the output image with a
> similar pixel size to the source image.  But you can specify a  
> particular
> pixel size or extents if you want fine control.
>
> It would have been interesting if you could have included the gdalinfo
> report for the output file so we could easily compare the region to  
> the
> region described in your metadata.
Here's the gdalinfo:

Driver: GTiff/GeoTIFF
Files: /Volumes/Users HD/Users/huntc/Documents/Class Action Doco/Titan  
Class/Heathrow/169460-65786.tif
Size is 3000, 3000
Coordinate System is `'
Origin = (609603.500119999982417,5772321.500249000266194)
Pixel Size = (45.000000000000000,-45.000000000000000)
Metadata:
   TIFFTAG_XRESOLUTION=96
   TIFFTAG_YRESOLUTION=96
   TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
Image Structure Metadata:
   INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (  609603.500, 5772321.500)
Lower Left  (  609603.500, 5637321.500)
Upper Right (  744603.500, 5772321.500)
Lower Right (  744603.500, 5637321.500)
Center      (  677103.500, 5704821.500)
Band 1 Block=3000x1 Type=Byte, ColorInterp=Red
Band 2 Block=3000x1 Type=Byte, ColorInterp=Green
Band 3 Block=3000x1 Type=Byte, ColorInterp=Blue

Finally then, here's how my command now looks - is it complete?

   gdalwarp -s_srs '+proj=utm +zone=30 +datum=WGS84' -t_srs '+proj=eqc  
+datum=WGS84' -dstalpha -multi 169460-65786.tif out.tif

(I'm presuming that I don't need to specify the northerly or easterly  
component because the file contains this as the origin... and also,  
the origin assumes the top left corner...)

Thanks again for your help.

Cheers,
-C



More information about the gdal-dev mailing list