[gdal-dev] Warping into gpkg PseudoTMS_GlobalMercator fails

Even Rouault even.rouault at spatialys.com
Tue Sep 18 23:45:05 PDT 2018


On mercredi 19 septembre 2018 05:06:59 CEST Rahkonen Jukka (MML) wrote:
> Hi,
> 
> I wonder if there is some issue in gdalwarp and how it is using the GPKG
> raster driver with a predefined tiling scheme. Feels like gdalwarp does not
> use any ZOOM_LEVEL_STRATEGY, if not one called "strict".
> 
> gdalwarp -of gpkg -t_srs epsg:3857 -co
> tiling_scheme=PseudoTMS_GlobalMercator -co zoom_level_strategy=lower
> sfdem.tif 3857.gpkg Creating output file that is 640P x 488L.
> ERROR 6: Could not find an appropriate zoom level of
> PseudoTMS_GlobalMercator tiling scheme that matches raster pixel size ERROR
> 1: Raster table 3857 not correctly initialized due to missing call to
> SetGeoTransform()

If you want to use gdalwarp with a predefined tiling scheme, you need to 
specify -tr so that it matches exactly one of the resolution of the tile 
matrix set (or equivalently a combination of -ts + -te that yields such -tr 
value)

> 
> A workaround is to warp  into TIFF and run gdal_translate afterwards
> gdal_translate -of gpkg -co tiling_scheme=PseudoTMS_GlobalMercator 3857.tif
> 3857.gpkg

That's definitely the recomended way. The CreateCopy() method then internally 
kind of sets-up gdalwarp with an appropriate resolution value.

Even

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


More information about the gdal-dev mailing list