[gdal-dev] VRT creation from Python, adding existing geotiff as bands
Rémi Cura
remi.cura at gmail.com
Mon Feb 16 05:13:02 PST 2015
Hey dear list,
this is my first post here,
so sorry if I'm asking something obvious.
(I noticed the 2 previous mail thread regarding python and VRT).
I wrote python functions to convert a numpy structured array to several
gdal rasters.
A numpy structured array is a 2D pixel array, but each pixel has in fact
several values of possibly different type (like band).
For instance a pixel dtype can be [float32,uint16,Float64].
I want to convert this array to raster(s).
First I tried to create one raster with several bands,
but GeoTiff cannot handle bands with different pixel type (or I didn't find
how).
I concluded that I must create several rasters, and put them all as bands
in a VRT.
So far I have been able to create several geoTiff raster of various type
corresponding to the numpy structured array.
Now, I don't know how to create from python the VRT that unites all this
rasters.
When I try to write in a VRT raster band I get errors.
I am well aware that I could create the XML directly from python, but it
feels like a pretty bad architecture idea.
Anybody knows how to do this /and/or has comments about this task?
Many Thanks,
Rémi-C
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20150216/5d973e95/attachment.html>
More information about the gdal-dev
mailing list