Turns out I didnt need to do any of that.
GdalRasterLayer supports many different raster formats. One that I was unfamiliar with until recently was its own virtual dataset format. This is basically an xml file that, among other things, can pull together several raster files and treat them as a single dataset. You can build one of these very easily by doing something like:
gdalbuildvrt rasterIndex.vrt *.tifNow, because vrt files are just another format supported by gdal, you can load them straight in using the GdalRasterLayer like so:
GdalRasterLayer layer = new GdalRasterLayer("MyRasterIndex", "rasterIndex.vrt");And because the GdalRasterLayer is pretty smart at what it does, it will only read the pixels that it needs, meaning it's pretty efficient in terms of its speed and memory usage.
No comments:
Post a Comment