I have a GeoTiff image mymap.tif https://www.dropbox.com/s/51chrzv9vp9olg8/mymap.tif

$ gdalinfo mymap.tif Driver: GTiff/GeoTIFF Files: mymap.tif Size is 1085, 281 Coordinate System is: 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"]] Origin = (-122.509475852140255,37.769141730303630) Pixel Size = (0.000010000000000,-0.000010000000000) Metadata: AREA_OR_POINT=Area Image Structure Metadata: COMPRESSION=LZW INTERLEAVE=PIXEL Corner Coordinates: Upper Left (-122.5094759, 37.7691417) (122d30'34.11"W, 37d46' 8.91"N) Lower Left (-122.5094759, 37.7663317) (122d30'34.11"W, 37d45'58.79"N) Upper Right (-122.4986259, 37.7691417) (122d29'55.05"W, 37d46' 8.91"N) Lower Right (-122.4986259, 37.7663317) (122d29'55.05"W, 37d45'58.79"N) Center (-122.5040509, 37.7677367) (122d30'14.58"W, 37d46' 3.85"N) Band 1 Block=1085x32 Type=Byte, ColorInterp=Red Mask Flags: PER_DATASET ALPHA Band 2 Block=1085x32 Type=Byte, ColorInterp=Green Mask Flags: PER_DATASET ALPHA Band 3 Block=1085x32 Type=Byte, ColorInterp=Blue Mask Flags: PER_DATASET ALPHA Band 4 Block=1085x32 Type=Byte, ColorInterp=Alpha

If I fetch the bounds of this image from Google Map I get this ground truth image https://www.dropbox.com/s/mrb3d1ho33mw9bw/truth.tif. The two images don't quite line up.

Is it possible to dewarp my image so that when overlaid on the Google Maps image they line up correctly?

1 Answer 1


If I load your mymap.tif into QGIS with the Openlayers plugin, it lines up good with Google and Bing aerial image. Openstreetmap background is a bit shifted, but I don't know how accurate that is.

Your truth.tif does not have bounds information, that's why it does not align. They both have the same pixel size, but you can not know the resolution without the bounds in degrees or any other units.

After georeferencing it manually, both images come up at the right place, but at different sizes:

enter image description here

Converting truth.tif to WGS84, I get this extent reported by gdalinfo:

Upper Left  (-122.5099500,  37.7696580) (122d30'35.82"W, 37d46'10.77"N)
Lower Left  (-122.5099500,  37.7652832) (122d30'35.82"W, 37d45'55.02"N)
Upper Right (-122.4975252,  37.7696580) (122d29'51.09"W, 37d46'10.77"N)
Lower Right (-122.4975252,  37.7652832) (122d29'51.09"W, 37d45'55.02"N)
Center      (-122.5037376,  37.7674706) (122d30'13.46"W, 37d46' 2.89"N)

I don't know how you managed to grab the picture from Google Map, but obviously the bounds were not preserved. A reason might be that they do not share the same projection.

  • I build truth.tif using the bounds of mymap.tif. That's why I want to dewarp the pixels in mymap.tif so that the bounds are correct, rather than change the bounds and project so that the pixels are correct. Not sure if that makes sense. The tfw file for both images is: 1.000000000000453e-05 0.0 0.0 -9.999999999988073e-06 -122.5094708521403 37.76913673030363 it's just the pixels in mymap aren't quite correct. May 14, 2014 at 20:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.