[gdal-dev] Warping into gpkg PseudoTMS_GlobalMercator fails
Even Rouault
even.rouault at spatialys.com
Wed Sep 19 01:06:07 PDT 2018
On mercredi 19 septembre 2018 07:55:51 CEST Rahkonen Jukka (MML) wrote:
> Even Rouault wrote
>
> > On mercredi 19 septembre 2018 05:06:59 CEST Rahkonen Jukka (MML) wrote:
> >> 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.
>
> I believe that you meant "sets-up gdal_translate with an appropriate
> resolution value"
No I really meant that gdal_translate / CreateCopy() with
tiling_scheme=PseudoTMS_GlobalMercator internally uses the same warp API as gdalwarp.
See:
https://github.com/OSGeo/gdal/blob/master/gdal/ogr/ogrsf_frmts/gpkg/ogrgeopackagedatasource.cpp#L4610
(lines above actually determine the target extent and resolution)
> because the previous gdalwarp command is totally unaware
> about what will happen next:
> >
> gdalwarp -of gtiff -t_srs epsg:3857 sfdem.tif 3857.tif
Yes, gdalwarp itself is completely unaware of the constraints of
tiling_scheme=PseudoTMS_GlobalMercator, this is why if you want to use it directly,
it is tricky. The CreateCopy() way can take care of setting it up
appropriately
--
Spatialys - Geospatial professional services
http://www.spatialys.com
More information about the gdal-dev
mailing list