My input is this file
which gives me an output file through the code:
inputraster=gdal.Open('input_file.tif'),gdal.GA_ReadOnly)
optt=gdal.TranslateOptions(format='PCRaster',bandList=[1],outputSRS='EPSG:4326',outputType=gdalconst.GDT_Int32,metadataOptions='VS_SCALAR')
gdal.Translate('output_file.map',inputraster,options=optt)
which has other extent and other resolution.
So, why I get this?
Best Answer
Your input file has different height and width for pixels
The comment in a the source code https://github.com/OSGeo/gdal/blob/master/frmts/pcraster/pcrasterdataset.cpp says that PCRaster does not support that.
What you did should probably give an error but PCRaster is rather exotic format and probably not thoroughly tested.
You have a few options, maybe the easiest is to convert the source data to have square pixels with gdalwarp
and then
Now both files have same values