Monday, 6 March 2017

Where is this raster offset being introduced in the QGIS processing toolbox?


I'm using the (awesome!) processing toolbox in QGIS 2.0 to reclassify some NoData values in a raster from -9999 to 0, but at some point in the process there's an offset of about 0.2 degrees being introduced to the output layer.


I'm using the "Reclassify (Simple)" tool (I believe it's part of SAGA), with some pretty basic parameters:


reclassify parameters


. . . and where the input raster was situated correctly in comparison to this hex grid:



input raster


. . . the output raster is bumped southeast by two hex cells, or about 0.2 degrees:


enter image description here


The input origin is -180, 83.623 . . . but the output origin is -179.05,83.05. Normally I would assume this is the result of a faulty WGS84 conversion, but the input, output and project are all EPSG:4326.


Where is this origin offset coming from, and is it worth filing a SAGA ticket or is it just something I overlooked?


Update The process log indicates a transformation is performed on the input origin:


Transformation x' = -179.999989 + x * 0.100000 + y * 0.000000
Transformation y' = 83.623125 + x * 0.000000 + y * -0.100000

and then a few lines later the new parameters show up, now incorrect:



Grid system: 0.1; 3600x 1735y; -179.949989x -89.826875y

Answer



Your offset is 1/2 a pixel (0.1 degrees).


Longitude:


-179.999989 - -179.949989 = 0.05


Latitude is less obvious because one grid is referenced from top left, the other from bottom left:


83.623125 - (1735 * 0.1) - -89.826875 = 0.05


I'm guessing this relates to the RasterPixelIsPoint or RasterPixelIsArea problem:


http://www.remotesensing.org/geotiff/faq.html#PixelIsPoint


Are you using gdal 1.7 or 1.8?



No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...