Hi, I have georeferenced an image with gdal_translate and then reprojected it from OSGB36 to googleMaps with gdalwarp.<br>However the warped TIFF latitude/longitude coordinates are wrong.<br>The
re-projection appears to stretch the map correctly, but I discovered
there was a problem when I ran gdal2tiles and the map was not aligned
correctly.<br>
<br>For the georeferenced file, buckland.tiff, here.....<br><a href="https://docs.google.com/leaf?id=0B93lksnTC7_cNTg3OGU0MTEtNjNiMC00NWM5LTg5ZjQtMmQyNDIzNmM5NGE5">https://docs.google.com/leaf?id=0B93lksnTC7_cNTg3OGU0MTEtNjNiMC00NWM5LTg5ZjQtMmQyNDIzNmM5NGE5</a><br>
<br>According to gdalinfo the coordinates of the lower-left corner are: easting=241538.5, northing=119812<br>This corresponds to a latitude of 50.955887<br><br>I then run the warping as follows...<br>
gdalwarp.exe -s_srs EPSG:27700 -t_srs EPSG:900913 -r cubic -of GTiff buckland.tiff buckland_warped.tiff<br>..and according to gdalinfo the coordinates of the lower-left corner are: 4d15'30.51"W, 51d 8'38.06"N<br>
I.e. a latitude of 51.143906 which is miles off (infact no latitude on the map is near this value). It should be 50.955887.<br>Warped file, buckland_warped.tiff, is here....<br><a href="https://docs.google.com/leaf?id=0B93lksnTC7_cNzIzZWQ0MDYtMTY5Yy00NjY0LThiMjktZjc2YzA3MmU5NjI4">https://docs.google.com/leaf?id=0B93lksnTC7_cNzIzZWQ0MDYtMTY5Yy00NjY0LThiMjktZjc2YzA3MmU5NjI4</a><br>
<br>When
I run gdal2tiles directly on the unwarped map it does it correctly but
it is not very good quality (it doesnt seem to use such a good pixel
interpolation as gdalwarp).<br>
<br>Does this look like a bug in gdalwarp or am I doing something stupid.<br><br>I'm using gdal16 from osgeo4w on Windows 7 64-bit.<br><br>Output of gdalinfo on the georeferenced and warped images is below.<br>Thanks<br>
<br><br>BUCKLAND.TIFF...<br>C:\OSGeo4W\apps\gdal-16\bin>gdalinfo e:buckland.tiff<br>Driver: GTiff/GeoTIFF<br>Files: e:buckland.tiff<br>Size is 600, 400<br>Coordinate System is `'<br>GCP Projection = PROJCS["OSGB 1936 / British National Grid",GEOGCS["OSGB 1936",DATUM["OSGB_1936",SPHEROID["Airy 1830",63<br>
77563.396,299.3249646000044,AUTHORITY["EPSG","7001"]],AUTHORITY["EPSG","6277"]],PRIMEM["Greenwich",0],UNIT["degree",0.01<br>74532925199433],AUTHORITY["EPSG","4277"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",49],PARAMETER<br>
["central_meridian",-2],PARAMETER["scale_factor",0.9996012717],PARAMETER["false_easting",400000],PARAMETER["false_northi<br>ng",-100000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG","27700"]]<br>
GCP[ 0]: Id=1, Info=<br> (0,400) -> (241538.5,119812,0)<br>GCP[ 1]: Id=2, Info=<br> (600,0) -> (244713.5,121928.66666667,0)<br>GCP[ 2]: Id=3, Info=<br> (0,0) -> (241538.5,121928.66666667,0)<br>
GCP[ 3]: Id=4, Info=<br> (600,400) -> (244713.5,119812,0)<br>Metadata:<br> AREA_OR_POINT=Area<br>Image Structure Metadata:<br> INTERLEAVE=PIXEL<br>Corner Coordinates:<br>Upper Left ( 0.0, 0.0)<br>Lower Left ( 0.0, 400.0)<br>
Upper Right ( 600.0, 0.0)<br>Lower Right ( 600.0, 400.0)<br>Center ( 300.0, 200.0)<br>Band 1 Block=600x3 Type=Byte, ColorInterp=Red<br> Mask Flags: PER_DATASET ALPHA<br>Band 2 Block=600x3 Type=Byte, ColorInterp=Green<br>
Mask Flags: PER_DATASET ALPHA<br>Band 3 Block=600x3 Type=Byte, ColorInterp=Blue<br> Mask Flags: PER_DATASET ALPHA<br>Band 4 Block=600x3 Type=Byte, ColorInterp=Alpha<br><br><br>BUCKLAND_WARPED.TIFF...<br>C:\OSGeo4W\apps\gdal-16\bin>gdalinfo e:buckland_WARPED.tiff<br>
Driver: GTiff/GeoTIFF<br>Files: e:buckland_WARPED.tiff<br>Size is 611, 419<br>Coordinate System is:<br>PROJCS["Google Maps Global Mercator",<br> GEOGCS["WGS 84",<br> DATUM["WGS_1984",<br>
SPHEROID["WGS 84",6378137,298.2572235630016,<br> AUTHORITY["EPSG","7030"]],<br> AUTHORITY["EPSG","6326"]],<br> PRIMEM["Greenwich",0],<br>
UNIT["degree",0.0174532925199433],<br> AUTHORITY["EPSG","4326"]],<br> PROJECTION["Mercator_1SP"],<br> PARAMETER["central_meridian",0],<br> PARAMETER["scale_factor",1],<br>
PARAMETER["false_easting",0],<br> PARAMETER["false_northing",0],<br> UNIT["metre",1,<br> AUTHORITY["EPSG","9001"]]]<br>Origin = (-474051.292871501410000,6617009.987366309400000)<br>
Pixel Size = (8.392224865731517,-8.392224865731517)<br>Metadata:<br> AREA_OR_POINT=Area<br>Image Structure Metadata:<br> INTERLEAVE=PIXEL<br>Corner Coordinates:<br>Upper Left ( -474051.293, 6617009.987) ( 4d15'30.51"W, 51d 9'49.57"N)<br>
Lower Left ( -474051.293, 6613493.645) ( 4d15'30.51"W, 51d 8'38.06"N)<br>Upper Right ( -468923.643, 6617009.987) ( 4d12'44.69"W, 51d 9'49.57"N)<br>Lower Right ( -468923.643, 6613493.645) ( 4d12'44.69"W, 51d 8'38.06"N)<br>
Center ( -471487.468, 6615251.816) ( 4d14'7.60"W, 51d 9'13.82"N)<br>Band 1 Block=611x3 Type=Byte, ColorInterp=Red<br> Mask Flags: PER_DATASET ALPHA<br>Band 2 Block=611x3 Type=Byte, ColorInterp=Green<br>
Mask Flags: PER_DATASET ALPHA<br>Band 3 Block=611x3 Type=Byte, ColorInterp=Blue<br> Mask Flags: PER_DATASET ALPHA<br>Band 4 Block=611x3 Type=Byte, ColorInterp=Alpha<br><br><br><br>