[gdal-dev] Adding subdataset into GeoPackage raster with -a_srs requires also RASTER_TABLE

Even Rouault even.rouault at spatialys.com
Tue Aug 7 03:42:39 PDT 2018


Hi Jukka,

> 
> I was doing some tests with GeoPackage rasters and found that if I define
> -a_srs then also -co RASTER_TABLE is required which feels unnecessary.
> Steps to reproduce:
> 
> Create initial gpkg
> gdal_translate -of GPKG global_mosaic_0.png raster.gpkg -a_srs epsg:4326
> 
> Try to add a subdataset and assign srs for that too
> gdal_translate -of GPKG global_mosaic_1.png raster.gpkg -a_srs epsg:4326 -co
> APPEND_SUBDATASET=YES 0ERROR 1: RASTER_TABLE must be set to a non empty
> value
> 
> Append subdataset without -a_srs succeeds even if I do not give the name for
> the raster table.

I just fixed it in master.

> 
> I know that the corner coordinates which are reported from the whole
> GeoPackage which contains several subdatasets are meaningless, but I still
> wonder why it reports just range 0-512 which does not fit with any of my
> raster tables nor with the pixel space used by the tiles. Is it a hardcoded
> value?

Yes, this is the intialization value in the GDALDataset class. This hasn't 
changed since the first version of the GDALDataset class 20 years ago :-)
I'm not sure why this is not zero. Could probably be changed. That's an easy 
exercice if someone wants to try and observe if that breaks things in the test 
suite (hopefully not). And then we could make gdalinfo to stop reporting 
corner coordinates in that case.

Even

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


More information about the gdal-dev mailing list