[gdal-dev] JPIPKAK dataset usage
Garrett Potts
potts at cfl.rr.com
Sun Oct 16 21:38:30 EDT 2011
Hello All:
I am trying to use the jpipkak data set driver for testing JPIP calls to a JPIP server and I think I am having troubles trying to figure out the proper call to GDALRasterIo for the proper load of the requested region of interest. I have tried 2 ways, using the block IO and also trying to use the GDALRasterIO call. I am simply trying to use an application to sequence over the blocks at a given R-Level and write to a file. Seems what I think the RLevel rect should be in the call is not what the JPIP driver expects:
Here are a pseudo step of what I am doing in our own image loader and all the open fluff has been removed and the dataset has been verified to get the image dimensions, pixel type, … etc properly from the JPIP stream:
1) grab resolution band:
if res level is 0 or full res then init:
aBand = GDALGetRasterBand( theDataset, aGdalBandIndex );
if overviewIndex is > 0
aBand = GDALGetOverview( aBand, overviewIndex );
2) grab blocksize:
int xSize=0, ySize=0;
GDALGetBlockSize(aBand,
&xSize,
&ySize);
3) now iterate over resolution level by the block sizes and grab the data. I have tried this with GDALReadBlock and GDALRasterIO.
The driver gets data but it is in the wrong resolution which means I am not calling these with the proper request. I have traced the code but something doesn't quite make sense to me. It appears the R-Level is computed based on the input request versus the output width height buffer ratio. I think everything would get cleared up if I could see some example calls using above methods in when using the JPIPKAK dataset driver.
Thank you in advance for any help
Take care
Garrett
More information about the gdal-dev
mailing list