[gdal-dev] GPKG and antimeridian

Even Rouault even.rouault at spatialys.com
Tue Nov 24 08:36:35 PST 2020


Philippe,

> 1) gdalwarp using *"-co"* options yield to errors, even with -tr and -t_srs
> options
> PROMPT> gdalwarp -overwrite -of GPKG -co TILING_SCHEME=InspireCRS84Quad -co
> ZOOM_LEVEL_STRATEGY=AUTO -tr 0.000056168363154 0.000056168363154 -t_srs
> EPSG:4326 MyImageEast.tif MyImageWest.tif out.gpkg
> Creating output file that is 1901P x 1277L.
> ERROR 6: Could not find an appropriate zoom level of InspireCRS84Quad tiling
> scheme that matches raster pixel size
> ERROR 1: Raster table out not correctly initialized due to missing call to
> SetGeoTransform()

Yes this resolution isn't compatible with a known zoom level of 
InspireCRS84Quad. The resolution at zoom level 0 is 0.703125, so only
0.703125 / 2^n is allowed.

> 2) gdalwarp using *"-doo"* options
> These options are ignored : I obtain exactly the same image with or without
> them.

Yes, TILING_SCHEME is not an open option. The tiling scheme must be dediced at 
creation time, not update time of an existing dataset.

> 3) As you say, gdal_translate automatically does the "right thing". Which is
> quite nice.
> As I mentioned in my 1st message, I created my GPKG in two steps :
> 3.1) create a VRT
> gdalbuildvrt MyImage.vrt MyImageEast.tif MyImageWest.tif
> This image has no data in the intervalle [-179° ; +179°]
> 
> 3.2) Translate it to GPKG
> gdal_translate -of GPKG -co TILING_SCHEME=InspireCRS84Quad -co
> ZOOM_LEVEL_STRATEGY=AUTO MyImage.vrt MyImage.gpkg
> In this translation, GDAL creates non-existant tiles between [-179° ;
> +179°], resulting in a huge image.

You should make sure your .vrt has an alpha band (use the -addalpha option of 
gdalbuildvrt for example). This is the key for the GPKG driver to detect blank 
tiles.

Even

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


More information about the gdal-dev mailing list