Hi, By the way, the same error message "ERROR 1: Size and resolution are missing" can be triggered by setting an existing non-COG GeoTIFF file to be read-only in the file system.
-Jukka Rahkonen- ________________________________________ Lähettäjä: gdal-dev <[email protected]> käyttäjän Rahkonen Jukka via gdal-dev <[email protected]> puolesta Lähetetty: Maanantai 6. lokakuuta 2025 13.01 Vastaanottaja: Andrey VI <[email protected]> Kopio: [email protected] <[email protected]> Aihe: Re: [gdal-dev] gdal_rasterize ERROR 1: Size and resolution are missing Hi, I have seen people using GDAL commands which do not make sense, that happens for everybody, but obviously not this time. I can see two issues: - The error message does not tell what is the real issue - The real issue is documented in https://gdal.org/en/stable/drivers/raster/cog.html#update, but I am not sure how to set the IGNORE_COG_LAYOUT_BREAK open option with gdal_rasterize. -Jukka Rahkonen- ________________________________________ Lähettäjä: Andrey VI <[email protected]> Lähetetty: Maanantai 6. lokakuuta 2025 12.18 Vastaanottaja: Rahkonen Jukka <[email protected]> Kopio: [email protected] <[email protected]> Aihe: Re: [gdal-dev] gdal_rasterize ERROR 1: Size and resolution are missing Of course in my example the file exists. Otherwise this command would not make sense without -ts or -ts options.I figured out what the problem was. Existed raster was created with COG layout. And in this case gdal_rasterize error (Size and resolution are missing) is very confusing. Monday, October 6, 2025 11:32 AM +03:00 from Rahkonen Jukka <[email protected]>: Hi,Are you sure that it worked likegdal_rasterize -burn 0 shape.shp hillshade.tifif hillshade.tif file did not exist? It the file exists then the command should still work. Examples 1 and 2 are burning geometries into an existing file. The example 3 writes a new tif and it includes the target size parameter "-ts 1000 1000".The error "Size and resolution are missing" is slightly wrong, it should be "Size OR resolution are missing". You do not need both, and actually user would need to be careful for making them match because they depend on each other.In conclusion, you wrote "This means that to use the gdal_rasterize, you first need to know the raster size or resolution."- If the target image exists all you need to know is the name of the file- If target image does not exists, you really need to know what resolution or image size in pixels you want. GDAL does not guess what resolution might please you.-Jukka Rahkonen-________________________________________Lähettäjä: gdal-dev <[/compose?To=gdal%2ddev%[email protected]][email protected]> käyttäjän Andrey VI via gdal-dev <[/compose?To=gdal%[email protected]][email protected]> puolestaLähetetty: Maanantai 6. lokakuuta 2025 10.59Vastaanottaja: [/compose?To=gdal%[email protected]][email protected] <[/compose?To=gdal%[email protected]][email protected]>Aihe: [gdal-dev] gdal_rasterize ERROR 1: Size and resolution are missingHello. A few years ago a command like this:gdal_rasterize -burn 0 shape.shp hillshade.tifworked.But with the latest GDAL it’s not:gdal_rasterize -burn 0 shape.shp hillshade.tifERROR 1: Size and resolution are missing gdal_rasterize examples section of GDAL documentation includes 2 examples without size and resolution options.This means that to use the gdal_rasterize, you first need to know the raster size or resolution. This is inconvenient. Is this a bug or an intentional change?--Andrey--Andrey VISent from Mail _______________________________________________ gdal-dev mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/gdal-dev _______________________________________________ gdal-dev mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/gdal-dev
