[Gdal-dev] Block size consistency (and SetColorInterpretation()
in GTiff)
Ozy Sjahputera
sjahputerao at missouri.edu
Wed Feb 7 13:43:04 EST 2007
Yes, big bummer on the performance drop after replacing WriteBlock and
ReadBlock with RasterIO. But I cannot afford having "incorrect" data
that will screw up my colleagues further down in the pipeline. So, we
may have to do parallel processing stuff for this.
Frank Warmerdam wrote:
> Ozy Sjahputera wrote:
>> You are probably right. I am just trying to rule out any possible
>> source of image "shift" that I am seeing.
>>
>> Using RasterIO instead of block write/read seems to increase my
>> computation time by 40-50%. If I find the source of error to be
>> something else unrelated to block size, I will go back to using
>> blockWrite/Read. Still looking now.
>
> Ozy,
>
> Whew, that is substantial overhead. I'm surprised, and somewhat
> disappointed.
>
>> Frank, one more thing, when I use "Create()" from "GTiff" driver, I
>> cannot assign the band name in the new image using :
>> dstBand->SetColorInterpretation(srcBand->GetColorInterpretation());
>> I always get : ERROR 6: SetColorInterpretation() not supported for
>> this dataset. However, the first band in the new image seems to have
>> "gray" as the band name, while others are "undefined" due to the
>> error above.
>>
>> But I can do SetColorInterpretation() above if I use "Create()" from
>> "MEM" driver.
>> Is this a limitation of GTiff driver in GDAL now? Is there a way I
>> can assign the band name after using "Create()" from GTiff driver?
>
> There is a distinct concept of band names (descriptions). But here
> you just seem interested in photometric intepretation.
>
> The GeoTIFF driver has very limited support for setting the photometric
> interpretation of bands after the file has been created. I think the
> only aspect of this that actually does something is if you set an
> extra band to be alpha, it records that in the TIFF file.
>
> If you would like a 3 or more band file to have a TIFF level photometric
> interpretation of RGB you can set it using the PHOTOMETRIC=RGB creation
> option at Create() time.
>
> This is an example of a situation where Create() then modify doesn't
> work well due to lots of stuff getting locked down at the point the
> create is completed.
>
> Best regards,
More information about the Gdal-dev
mailing list