Opened 17 years ago
Closed 8 years ago
#1234 closed enhancement (wontfix)
Proposal: add Get[XY]Start() methods to GDALRasterBlock
Reported by: | Owned by: | warmerdam | |
---|---|---|---|
Priority: | highest | Milestone: | |
Component: | default | Version: | unspecified |
Severity: | minor | Keywords: | |
Cc: | Mateusz Łoskot |
Description (last modified by )
I'm developing an application that operates on rasters at the block level and it would be very convenient if each GDALRasterBlock could return its starting pixel. This information can obviously be calculated and stored apart from the block (as I'm currently doing), but it would be nice if each block took care of this itself. If no one objects, I'd appreciate changes similar to the following.
--- gdal_priv.h 2006-05-24 17:25:33.000000000 -0500 +++ gdal_priv.h 2006-07-11 20:31:37.000000000 -0500 @@ -355,6 +355,9 @@ int nXSize; int nYSize; + + int nXStart; + int nYStart; void *pData; @@ -382,6 +385,8 @@ int GetYOff() { return nYOff; } int GetXSize() { return nXSize; } int GetYSize() { return nYSize; } + int GetXStart() { return nXStart; } + int GetYStart() { return nYStart; } int GetDirty() { return bDirty; } int GetLockCount() { return nLockCount; } --- gdalrasterblock.cpp 2006-02-07 13:07:08.000000000 -0600 +++ gdalrasterblock.cpp 2006-07-11 20:32:35.000000000 -0500 @@ -262,6 +262,9 @@ nXOff = nXOffIn; nYOff = nYOffIn; + + nXStart = nXOff * nXSize; + nYStart = nYOff * nYSize; } /************************************************************************/
D.
Change History (2)
comment:1 by , 13 years ago
Cc: | added |
---|---|
Description: | modified (diff) |
comment:2 by , 8 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
If this idea is considered for inclusion at all, I think there is no need to cache the block pixel offset value. I'd also suggest to rename the proposed functions to follow naming convention of GetXOff and GetYOff but indicating pixel level offset: