[gdal-dev] gdal rasterize vs resize

Rahkonen Jukka jukka.rahkonen at maanmittauslaitos.fi
Sun Nov 16 11:04:00 PST 2025


Hi,

I believe it would not be extremely hard to compute the other size parameter so that the result would have square pixels. As a workaround, if you can guess an about suitable pixel size you can define the resolution with equal x and y size:
gdal vector rasterize --resolution [pixelsize,pixelsize]

The behavior is not new. The traditional gdal_rasterize https://gdal.org/en/stable/programs/gdal_rasterize.html requires also both width and height.

-Jukka Rahkonen-

________________________________________
Lähettäjä: gdal-dev <gdal-dev-bounces at lists.osgeo.org> käyttäjän Scott via gdal-dev <gdal-dev at lists.osgeo.org> puolesta
Lähetetty: Lauantai 15. marraskuuta 2025 21.45
Vastaanottaja: gdal-dev at lists.osgeo.org <gdal-dev at lists.osgeo.org>
Aihe: [gdal-dev] gdal rasterize vs resize


Greetings,

When using gdal raster resize I can use --size 0,800 and it will compute
the width.

However, when using gdal vector rasterize --size 0,800 it throws the error:

ERROR 1: Wrong value for -ts parameter.

Having it compute the missing value is highly desirable!

GDAL v3.12.0

Thanks!
Scott

--
http://www.postholer.com/

_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev




More information about the gdal-dev mailing list