[gdal-dev] Adding datasets to VRT at runtime

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] Adding datasets to VRT at runtime

mikeucfl
Currently I have a workflow which uses GDALBuildVRT (in C++) to create a dataset with multiple geotiffs. I'm trying now to figure out if after this VRT dataset was created, is there a way to add an additional dataset without having to call GDALBuildVRT again?

The main use case for this is I'm that loading geotiffs based on a paging system, and I'd like to be able to efficiently handle adding these new datasets. Any suggestions for where to look or maybe a different method is appreciated too.

Thanks,
Mike

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Adding datasets to VRT at runtime

Even Rouault-2
On vendredi 20 mars 2020 17:18:33 CET Mike wrote:
> Currently I have a workflow which uses GDALBuildVRT (in C++) to create a
> dataset with multiple geotiffs. I'm trying now to figure out if after this
> VRT dataset was created, is there a way to add an additional dataset
> without having to call GDALBuildVRT again?
>
> The main use case for this is I'm that loading geotiffs based on a paging
> system, and I'd like to be able to efficiently handle adding these new
> datasets. Any suggestions for where to look or maybe a different method is
> appreciated too.

Mie,

https://gdal.org/drivers/raster/vrt.html#creation-of-vrt-datasets gives an
example on how to add a new source with
oBand->SetMetadataItem( "source_0", szFilterSourceXML, "vrt_sources" );
You'd need to adapt the XML to use a SimpleSource or ComplexSource.

Otherwise a VRT is just a XML file, so you can also use your favorite XML
editing library
(or GDAL's minixml : https://gdal.org/doxygen/cpl__minixml_8h.html ) to edit
it as you wish.

Even


--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev