[gdal-dev] Example about how to save Tiled Gridded Coverage Data into GeoPackage

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] Example about how to save Tiled Gridded Coverage Data into GeoPackage

jratike80

Hi,

 

Are there any examples available about how to convert some DEM data into GeoPackage according to the Tiled Gridded Coverage Data extension that GDAL 2.3 supports?

 

-Jukka Rahkonen-


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Example about how to save Tiled Gridded Coverage Data into GeoPackage

Even Rouault-2

On mardi 15 mai 2018 07:58:27 CEST Rahkonen Jukka (MML) wrote:

> Hi,

>

> Are there any examples available about how to convert some DEM data into

> GeoPackage according to the Tiled Gridded Coverage Data extension that GDAL

> 2.3 supports?

 

Jukka,

 

Just gdal_translate from a single-band raster with data type Int16, UInt16 or Float32 (or use -ot to force one of those types)

 

Even

 

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Example about how to save Tiled Gridded Coverage Data into GeoPackage

jratike80
Even Rouault wrote:

> On mardi 15 mai 2018 07:58:27 CEST Rahkonen Jukka (MML) wrote:
>> Hi,
>>
>> Are there any examples available about how to convert some DEM data into
>> GeoPackage according to the Tiled Gridded Coverage Data extension that GDAL
>> 2.3 supports?
 
> Jukka,
 
> Just gdal_translate from a single-band raster with data type Int16, UInt16 or Float32 (or use -ot to force one of those types)
 
Thanks, works well with 32 bit floating point tiffs as source and the gpkg DEM opens fine with QGIS 3. I know I can add several DEM tiffs by combining them into one datasource with VRT but is there any way to add data into an existing raster table? I understand that a general solution would be tricky because new data might require to increase the tile matrix, and within the existing matrix a well working system should be able to combine and merge partial tiles. But is it possible to add data into raster table at all, for example by inserting and overwriting tiles in Web Mercator grid?

-Jukka-
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Example about how to save Tiled Gridded Coverage Data into GeoPackage

Even Rouault-2

 

> Thanks, works well with 32 bit floating point tiffs as source and the gpkg

> DEM opens fine with QGIS 3. I know I can add several DEM tiffs by combining

> them into one datasource with VRT but is there any way to add data into an

> existing raster table? I understand that a general solution would be tricky

> because new data might require to increase the tile matrix, and within the

> existing matrix a well working system should be able to combine and merge

> partial tiles. But is it possible to add data into raster table at all, for

> example by inserting and overwriting tiles in Web Mercator grid?

 

Jukka,

 

Extending the limits of an existing tile matrix would require some work (renumbering the existing tiles, recomputing overviews, etc...)

 

But if you use a global tiling system like Web Mercator, you can do it, but it is admitedly a bit tricky.

 

gdalwarp new_data.tif existing.gpkg \

-doo MINX=... -doo MINY=... -doo MAXX=... -doo MAXY=....

 

While in theory you could use the exterme value of the Web Mercator projection (+/- 20037508.34) for those minx, etc values, this would take hours/days to process given how gdalwarp works.

So you will have to compute a more restricted bounding box from the existing data in the raster table and the new data you want to add.

 

And finally you need to adjust the gpkg_contents min_x, min_y, max_x and max_y bounds to the new bounding box with something like

 

ogrinfo existing.gpkg -sql "UPDATE gpkg_contents WHERE table_name = 'foo' SET min_x = ..., min_y = ..., max_x = ...., max_y = ...."

 

Even

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev