[gdal-dev] Finding if a source exists in particular block of a VRTRasterBand

ryagz raghavendra at vizexperts.com
Wed Mar 13 21:18:17 PDT 2013


Hi, 

I have created a VRTDataset and added multiple simple sources to its
rasterbands in a function of my application. In another function i have the
instance of this VRTDataset and its VRTRasterbands and, Now i would like to
find for a particular offsets an dimensions if there exists a source in
VRTRasterband. 

I did not find any API functions to do this operations, so thought to  call
functions from the classes and tried the code like bellow: 

GDALRasterBand* preBand = dataSource->GetRasterBand(1); 
VRTSourcedRasterBand* Vrtband =
dynamic_cast<VRTSourcedRasterBand*>(preBand); 
int hasValidSource = 0; 
for(int srcIndex = 0; srcIndex < Vrtband->nSources; srcIndex++) 
{ 
VRTSimpleSource* simpleSource =
static_cast<VRTSimpleSource*>(Vrtband->papoSources[srcIndex]); 
hasValidSource = simpleSource->GetSrcDstWindow(xoff, yoff, read_size[0],
read_size[1],	          read_size[0], read_size[1],	  &nReqXOff, &nReqYOff,
&nReqXSize, &nReqYSize,	  &nOutXOff, &nOutYOff, &nOutXSize, &nOutYSize ); 
} 

To do this operation, the problem i am facing is VRTSimpleSource class is
not exported and so the function GetSrcDstWindow() is throwing a linker
errors. 

Is there any way to solve this issue? 
Or Is there any API function which does this operation? 

Thanks, 
Ryagz 



--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Finding-if-a-source-exists-in-particular-block-of-a-VRTRasterBand-tp5040251.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.


More information about the gdal-dev mailing list