[gdal-dev] gdal_merge / negative size

Ghislain Picard ghislain.picard at lgge.obs.ujf-grenoble.fr
Mon Nov 1 15:04:21 EDT 2010


Hi All,

I have an image having y-coordinate increasing in the downward direction.
To display the image, the pixel size is -1000 on the y-axis (see ENVI 
header file below). This works perfectly except in gdal_merge when use 
to clip the raster (using QGis GdalTools(s plugin for instance).

For instance:

gdal_merge.py -ul_lr
95926.7879548 490702.415307 2036599.49812 -1014610.25721


fails because the output image size calculated by gdal_merge is negative.
Inverting the  y-coordinates like this:

gdal_merge.py -ul_lr
95926.7879548 -1014610.25721 2036599.49812 490702.415307


works but it is counter-intuitive as the lower-right point should have a 
smaller y-coordinate than the upper-left point.
It seems the size calculated by gdal_merge does not account for the sign 
of the pixel size.

Ghislain




ENVI
description = {
   File Imported into ENVI.}
samples = 5601
lines   = 5601
bands   = 1
header offset = 0
file type = ENVI Standard
data type = 4
interleave = bsq
sensor type = Unknown
byte order = 0
no data = 0
wavelength units = Unknown
map info = {Polar Stereographic, 1, 1, -2800500, -2800500, 1000, 
-1000,WGS-84}
projection info = {31, 6378137, 6356752.314245179, -71, 0, 0, 0,WGS-84, 
Polar Stereographic}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20101101/e3d2852f/attachment.html


More information about the gdal-dev mailing list