I'm trying to form a mosaic from two overlapping images of an old tithe map. I've used the georeferencer plugin using one of the images as canvas to generate a modified version of the other. I then used Raster>Miscellaneous>Merge. This generates the following commandline:

gdal_merge.py "/home/ian/Maps/Stubbin/1801 map Stubbin prt 1.JPG" "/home/ian/Maps/Stubbin/1801 map Stubbin prt 2_modified.jpg"

This gives an error:

ERROR 1: Attempt to create 2768x-1659 dataset is illegal,sizes must be larger than zero.

This seems to be related to the fact that image metadata for the original images shows the layer extents as 0.0, -1651.0 : 2339.0, 0.0 and other digital camera images also have -ve extents.

How do I work round this?

Platform is QGIS 1.8.0 on Debian Squeeze 64-bit.

1 Answer 1


To give your images positive coordinates, try georeferencing one image first with approximate real-world coordinates (make a points layer with known coordinates and then overlay the image); then, georeference the second with the edges of the first.

Assuming that the tithe map comes from the same map (approximately the same projection / scale?), you would want to make sure that the first image is not distorted - use a linear transformation with only two points on the first image.

  • Thanks, @Simbamangu, I'm getting there. I built a points file to set three of the corners to what they should be, eg. top left, which was 0,0 becomes 0, 1651 & bottom left which was 0,-1651 becomes 0,0 & applied that as a linear transform. I then georeferenced the other image as before. This looked OK when displayed as layers with a spline transform but has a wedge-shaped gap when I generate the merge. So I'll go back & try your suggestion of georeferencing for the edges only. Commented Oct 2, 2012 at 13:54
  • I tried another merge on the pair of images which gave be the black wedge above & this time ticked the No data box & the generated image is now OK. How do I update the title to say solved? Commented Oct 2, 2012 at 14:06
  • Hi @IanGoddard welcome to GIS.se, and glad that worked! Interesting to know that the nodata box helps with the black margins. There's a little 'check box' near the upper left of my solution here which you can tick - see this link for an explanation of how this (and other) sites work.
    – Simbamangu
    Commented Oct 2, 2012 at 14:35
  • Thanks @Simbamangu. It didn't, in the end, get me to where I wanted. When I then try to overlay onto a scanned OS map however many or few GCPs I provide it puts it down about half a mile S of where it should be. I think I'm going to have several problems with this project & ISTM that this particular one was somewhere in the middle. I'll start a new question at the beginning & see how much else falls into place Commented Oct 3, 2012 at 16:26

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.