I'm using gdal.warp
to merge some files (see this former question of mine). I'm trying to use a dictionary instead of a long string to configure the options. However I'm having funny results with rasters of huge dimensions (25760x9427) instead of what I get when I use "string options" (4000x2001). However the call to gdal.warp
does not raise any warning or error message. Still it seems clear that warp
is not understanding some of the options I'm trying to pass to the function call. The problem is that the way options are names are different depending on how you give them, but this seems to be loosely documented. Or at least I could not find the one-to-one mapping between the "command line" options and their "key" counterpart.
My options (I mean those that work) are:
gdal_option = ("-t_srs EPSG:4326 "
f" -tr {res} {res} -te {xmin} {ymax} {xmax} {ymin}"
f" -co compress=LZW -overwrite ")
What I'm trying now is:
gdal_option = {"outputBoundsSRS": "EPSG:4326",
"xRes": res,
"yRes": res,
"outputBounds": [xmin, ymax, xmax, ymin],
"creationOptions": "COMPRESS=LZW",
"options": "-overwrite"}
But it does not work. Any idea what is the name of the options that reproduce the command line string version?
VectorTranslateOptions
e.g gdal.org/python/osgeo.gdal-module.html#VectorTranslateOptions. Remove the"options": "-overwrite"
to see if except-overwrite
, it works