[gdal-dev] Raster from temporary tiles

Even Rouault even.rouault at spatialys.com
Tue Jul 19 23:20:51 PDT 2016


Le mercredi 20 juillet 2016 08:08:07, Matthias Kuhn a écrit :
> Hi Even
> 
> On 20/07/16 08:04, Even Rouault wrote:
> > Hi Matthias,
> > 
> > The GPKG driver is a full-blown raster driver with similar capabilites to
> > the GeoTIFF one. That is you can use GDALCreate() to initialize an empty
> > raster and then write arbitrary portions of it with GDALRasterIO(, ...,
> > GF_Write, ...).
> > You can also initialize empty overviews with GDALBuildOverviews( ...,
> > "NONE", ... ) and write arbitrary raster content in them with
> > GDALRasterIO() on the overview bands.
> > 
> > Even
> 
> Thanks, good to know it's possible!
> Is that available in
> 
>   * command line tools
For creation of an empty raster, I can't think of an existing easy way.
For creation of empty overviews, yes with
"gdaladdo -r NONE your.gpkg 2 4 ...."
For update of an existing raster, with "gdalwarp in.tif out.gpkg"
For update of overviews, likely with
"gdalwarp in.tif out.gpkg -doo ZOOM_LEVEL=2" (caution the zoom level is in the 
GPKG meaning, and not with the GDAL convention. ie ZOOM_LEVEL=0 is the less 
detailed overview level)

>   * the python API
Sure. The Python API wraps alls those basic calls
driver_obj.Create()
band_obj.WriteRaster()
gdal.BuildOverviews()

The driver tests might be a useful resource:
https://svn.osgeo.org/gdal/trunk/autotest/gdrivers/gpkg.py

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list