<div dir="ltr">>> <span style="font-size:12.8px">I'm trying to find a way to append data to an existing geopackage raster</span><br style="font-size:12.8px"><span style="font-size:12.8px">layer using GDAL.</span><div><span style="font-size:12.8px">My information on GeoPackages may be outdated, since the specification has changed many times since I read it last.</span></div><div><span style="font-size:12.8px">But as far as I remember, the main goal was that a GeoPackage is a complete/finished collection of data ready for deployment.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Even though it may be internally a Database, it should not be treated as such.</span></div><div><span style="font-size:12.8px">So the word 'append' is inappropriate in this concept.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">If the condition on which the original raster coverage was created no longer applies, then a new raster coverage must be created that fulfill these new conditions.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">In this case you are extending the bounds of the raster coverage, which may work when extending in a East/West direction, but not in a North/West direction (assuming that North/West is 0,0). With mbtiles this would be no problem since the use a world wide tms numbering for the tiles.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">>> </span><span style="font-size:12.8px">violates constraint: tile_column </span><span style="font-size:12.8px">cannot be < 0'</span></div><div><span style="font-size:12.8px">>> </span><span style="font-size:12.8px">violates constraint: tile_row cannot be < 0'</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">These errors imply that this is the case: the new tiles are out of bounds.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">>> </span><span style="font-size:12.8px">At this stage, the only thing I can think of is to create a bunch of tables</span></div><span style="font-size:12.8px">and merge them in some manual SQL</span><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Creating a new raster coverage, with new extent/bounds and sources should be the idea.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">On the fly I would say using a virtual file would be the best approach</span></div><div><span style="font-size:12.8px">- source 1: original GeoPackage</span></div><div><span style="font-size:12.8px">- source 2: the wms source</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">(Creating a GeoPackage of the wms source with the desired extent and use that as 'source 2' might be a good idea)</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Determine the final extent that will be needed for all zoom levels and use gdalwarp (using the bounds parameters) to create a new GeoPackage raster coverage from the virtual file with the new sources.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">This should create the tiles correctly, merging the 2 sources together and numbering the tiles correctly based on the given extent.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Theoretically this should work.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Mark Johnson, Berlin Germany</span></div></div>