[gdal-dev] Appending to an existing GeoPackage raster table
Mark Johnson
mj10777 at googlemail.com
Sat Oct 7 21:20:28 PDT 2017
>> I'm trying to find a way to append data to an existing geopackage raster
layer using GDAL.
My information on GeoPackages may be outdated, since the specification has
changed many times since I read it last.
But as far as I remember, the main goal was that a GeoPackage is a
complete/finished collection of data ready for deployment.
Even though it may be internally a Database, it should not be treated as
such.
So the word 'append' is inappropriate in this concept.
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.
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.
>> violates constraint: tile_column cannot be < 0'
>> violates constraint: tile_row cannot be < 0'
These errors imply that this is the case: the new tiles are out of bounds.
>> At this stage, the only thing I can think of is to create a bunch of
tables
and merge them in some manual SQL
Creating a new raster coverage, with new extent/bounds and sources should
be the idea.
On the fly I would say using a virtual file would be the best approach
- source 1: original GeoPackage
- source 2: the wms source
(Creating a GeoPackage of the wms source with the desired extent and use
that as 'source 2' might be a good idea)
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.
This should create the tiles correctly, merging the 2 sources together and
numbering the tiles correctly based on the given extent.
Theoretically this should work.
Mark Johnson, Berlin Germany
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20171008/f065df75/attachment.html>
More information about the gdal-dev
mailing list