[fdo-internals] Raster Resampling within FDO GDAL

Trevor Wekel trevor_wekel at otxsystems.com
Tue Apr 10 22:15:21 EDT 2012


Hello,

I have been implementing raster resampling within the FDO GDAL Provider using GDAL warp.  One of the hiccups I encountered has to do with the raster data model.  Resampling effectively combines blocks of adjacent pixels into a single resultant pixel.  As such, using a full color data model is virtually a requirement.  As you can imagine, pixel blending with a 256 color palette does not work very well.

The full color requirement has an impact on the provider.  Basically, the provider has to know up front whether or not it is resampling so that it can adjust the data model visible over the FDO API to be 24bit RGB or 32bit RGBA.  FDO client applications can query the data model at any point so changing the data model within FdoRfpBandRaster::GetStreamReader() doesn't really work.  It really needs to be changed up front.


With this in mind, I believe I have a solution for specifying raster resampling within the GDAL Provider.  Simply add an optional "ResamplingMethod" tag to the class definition as part of the existing "Location" and add an optional "ResamplingMethod" connection string property.  The schema would look something like this:

<RasterDefinition name="images">
<Location name="C:\Data\imagery">
  <ResamplingMethod>Bilinear</ResamplingMethod>
  <Feature name="FEATURE1">
  </Feature>
  <Feature name="FEATURE2">
  </Feature>
</Location>

And the connection string would similar to this:

"DefaultRasterFileLocation=C:\Data\Imagery\test.tif;ResamplingMethod=Bilinear"


Does this seem like a reasonable approach?

Unfortunately, due to the schema changes I suspect this will have to be an FDO 3.8 enhancement.  Mind you, the "ResamplingMethod" is optional so it would not affect existing users...

Comments and suggestions are welcome.

Regards,
Trevor







More information about the fdo-internals mailing list