Topics

In-memory multi dataset object

Guy Doulberg
 

Hi
I wonder if I can create in-memory multi-dataset dataset, something like `gdalbuildvrt` but in memory

The use case I have in mind, is that I have a list of urls some of them construct the same band and some construct different band and I want to treat them as a single dataset

Theoretically, I an produce such dataset by calling gdalbuildvrt with those urls and them open the vrt created.  Is there another way of doing that?

If no, in environment that has only rasterio installed not gdal, how can I use  gdalbuildvrt?

Thanks Guy

Sean Gillies
 

Hi Guy,

Rasterio doesn't have first-class support for VRTs. I'm not rushing to do it because there are some VRT features that I frankly think are nuts, like embedding Python code.

However, we can use Python's XML libraries to generate XML texts and Rasterio will happily open the XML as a dataset. See the example at https://github.com/mapbox/rasterio/blob/master/tests/test_vrt.py#L9-L11. I'm doing this internally to implement Rasterio's boundless raster reads.


On Thu, Sep 13, 2018 at 7:02 AM Guy Doulberg <guyd@...> wrote:
Hi
I wonder if I can create in-memory multi-dataset dataset, something like `gdalbuildvrt` but in memory

The use case I have in mind, is that I have a list of urls some of them construct the same band and some construct different band and I want to treat them as a single dataset

Theoretically, I an produce such dataset by calling gdalbuildvrt with those urls and them open the vrt created.  Is there another way of doing that?

If no, in environment that has only rasterio installed not gdal, how can I use  gdalbuildvrt?

Thanks Guy



--
Sean Gillies

Guy Doulberg
 

Thanks, 

בתאריך יום ה׳, 13 בספט׳ 2018, 18:59, מאת Sean Gillies ‏<sean.gillies@...>:

Hi Guy,

Rasterio doesn't have first-class support for VRTs. I'm not rushing to do it because there are some VRT features that I frankly think are nuts, like embedding Python code.

However, we can use Python's XML libraries to generate XML texts and Rasterio will happily open the XML as a dataset. See the example at https://github.com/mapbox/rasterio/blob/master/tests/test_vrt.py#L9-L11. I'm doing this internally to implement Rasterio's boundless raster reads.


On Thu, Sep 13, 2018 at 7:02 AM Guy Doulberg <guyd@...> wrote:
Hi
I wonder if I can create in-memory multi-dataset dataset, something like `gdalbuildvrt` but in memory

The use case I have in mind, is that I have a list of urls some of them construct the same band and some construct different band and I want to treat them as a single dataset

Theoretically, I an produce such dataset by calling gdalbuildvrt with those urls and them open the vrt created.  Is there another way of doing that?

If no, in environment that has only rasterio installed not gdal, how can I use  gdalbuildvrt?

Thanks Guy


--
Sean Gillies