[gdal-dev] gdal_create: input file option

Even Rouault even.rouault at spatialys.com
Wed Dec 2 02:04:17 PST 2020


On mardi 1 décembre 2020 13:23:58 CET Rahkonen Jukka (MML) wrote:
> Hi,
> 
> Every now and then people would like to rasterize vectors into raster that
> matches exactly with some existing raster. There are a few possible ways
> for creating an empty copy from a raster with GDAL tools
> https://gis.stackexchange.com/questions/220753/how-do-i-create-blank-geotif
> f-with-same-spatial-properties-as-existing-geotiff . The gdal_merge way with
> -createonly does the job and is fast, but who remembers that gdal_merge
> exists and can be used for such purpose? How about to add an option like
> "-if" (input file) into gdal_create program, with the same effect? Options
> -outsize, -a_srs, -a_ullr would have no effect if used together with input
> template file. Options -of, -bands, -ot, -a_nodata, -co could override if
> given. Not sure about metadata, but probably it is never worth copying from
> the template file.

I've mostly followed your suggestion in
https://github.com/OSGeo/gdal/pull/3255

Not sure if it will be useful, but to avoid too many exceptions, -outsize, -a-
srs, -a_ullr can actually override the settings of the input file

Even

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


More information about the gdal-dev mailing list