On jeudi 1 d├ęcembre 2016 11:45:43 CET Rahkonen Jukka (MML) wrote:
> Hi,
> 
> Let's say that I have these raster maps with 2048 m and 1024 m pixel sizes
> http://kartat.kapsi.fi/files/taustakarttasarja_jhs180/taustakartta_8m/2048m/
> etrs89/png/Taustakartta_8milj.png
> http://kartat.kapsi.fi/files/taustakarttasarja_jhs180/taustakartta_8m/2048m
> /etrs89/png/Taustakartta_8milj.pgw
> 
> http://kartat.kapsi.fi/files/taustakarttasarja_jhs180/taustakartta_4m/1024m/
> etrs89/png/Taustakartta_4milj.png
> http://kartat.kapsi.fi/files/taustakarttasarja_jhs180/taustakartta_4m/1024m
> /etrs89/png/Taustakartta_4milj.pgw
> 
> Converting the 8milj.png into GeoPackage raster table is easy
> 
> gdal_translate -of gpkg -a_srs epsg:3067 Taustakartta_8milj.png
> overview.gpkg
> 
> Image goes to zoom level 2 as reported by gdalinfo:
> Metadata:
>   IDENTIFIER=overview
>   ZOOM_LEVEL=2
> 
> But now the hard part: I would like to append the second image 4milj.png to
> the same layer "overview" as ZOOM_LEVEL=3 because that  map is designed for
> that resolution. Is it possible to do that by using some parameters of the
> driver http://www.gdal.org/drv_geopackage_raster.html or with some clever
> trick?

The following works:

gdal_translate Taustakartta_4milj.png test.gpkg -of gpkg  -a_srs epsg:3067 
-expand rgba
gdal_translate Taustakartta_8milj.png Taustakartta_8milj_rgba.tif -expand rgba
gdalwarp Taustakartta_8milj_rgba.tif test.gpkg -doo ZOOM_LEVEL=2

Expension to RGBA wouldn't be strictly needed in theory since your 2 rasters 
have the same palette,
but in practice you have to do it.

Even


-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to