RasterGridFilter
Posted: Sat Mar 18, 2017 9:18 am
Hello, i have question about libs/qCC_io/RasterGridFilter.cpp
line 165:
Why (rasterX - 1) and (rasterY - 1)?
From http://gdal.org/gdal_datamodel.html :
Note that the pixel/line coordinates in the above are from (0.0,0.0) at the top left corner of the top left pixel to (width_in_pixels,height_in_pixels) at the bottom right corner of the bottom right pixel. The pixel/line location of the center of the top left pixel would therefore be (0.5,0.5).
For example, if i have raster image, which have only one pixel(height = 1, width = 1), then B=C=D=A - it seems incorrect.
line 165:
Code: Select all
CCVector3d B = origin + Pshift; //origin is 'top left'
CCVector3d C = B;
C.x += (rasterX - 1) * adfGeoTransform[1];
C.y += (rasterX - 1) * adfGeoTransform[4];
CCVector3d D = C;
D.x += (rasterY - 1) * adfGeoTransform[2];
D.y += (rasterY - 1) * adfGeoTransform[5];
CCVector3d A = B;
A.x += (rasterY - 1) * adfGeoTransform[2];
A.y += (rasterY - 1) * adfGeoTransform[5];
From http://gdal.org/gdal_datamodel.html :
Note that the pixel/line coordinates in the above are from (0.0,0.0) at the top left corner of the top left pixel to (width_in_pixels,height_in_pixels) at the bottom right corner of the bottom right pixel. The pixel/line location of the center of the top left pixel would therefore be (0.5,0.5).
For example, if i have raster image, which have only one pixel(height = 1, width = 1), then B=C=D=A - it seems incorrect.