Rasterization: itk::ERROR GDALImageIO : Dimensions are not defined

Configuration setup

My system: Ubuntu 20.04.4 LTS
Version of the OTB: 8.0.1
I installed the OTB with: the binaries, the Debian package management, the SuperBuild, other?—> Ubuntu 18.04 and Ubuntu 20.04 section

Description of my issue

Hi,
I wanted to convert my shape file(.shp) into .tif file. So, I tried to rasterize my shape( polygons). I tried to use the “otbcli_Rasterization -in my_downloaded_shape_file.shp -out rasterImage.tif -spx 1. -spy 1.”
in terminal but this error occured:
(FATAL) Rasterization: itk::ERROR: GDALImageIO(0x1d7e360): Dimensions are not defined.

The full terminal massage is this:
./otbcli_Rasterization -in ~/Desktop/polygon.shp -out resulted.tif -spx 1.5 -spy 1.5
2022-07-30 17:30:27 (INFO) Rasterization: Default RAM limit for OTB is 256 MB
2022-07-30 17:30:27 (INFO) Rasterization: GDAL maximum cache size is 391 MB
2022-07-30 17:30:27 (INFO) Rasterization: OTB will use at most 4 threads
2022-07-30 17:30:28 (INFO) Rasterization: Input dataset extent is (37.9838, 23.7275) (37.9858, 23.7295)
2022-07-30 17:30:28 (INFO) Rasterization: Input dataset projection reference system is: GEOGCS[“WGS 84”,DATUM[“WGS_1984”,SPHEROID[“WGS 84”,6378137,298.257223563,AUTHORITY[“EPSG”,“7030”]],AUTHORITY[“EPSG”,“6326”]],PRIMEM[“Greenwich”,0,AUTHORITY[“EPSG”,“8901”]],UNIT[“degree”,0.0174532925199433,AUTHORITY[“EPSG”,“9122”]],AXIS[“Latitude”,NORTH],AXIS[“Longitude”,EAST],AUTHORITY[“EPSG”,“4326”]]
2022-07-30 17:30:28 (INFO) Rasterization: Output projection reference system is: GEOGCS[“WGS 84”,DATUM[“WGS_1984”,SPHEROID[“WGS 84”,6378137,298.257223563,AUTHORITY[“EPSG”,“7030”]],AUTHORITY[“EPSG”,“6326”]],PRIMEM[“Greenwich”,0,AUTHORITY[“EPSG”,“8901”]],UNIT[“degree”,0.0174532925199433,AUTHORITY[“EPSG”,“9122”]],AXIS[“Latitude”,NORTH],AXIS[“Longitude”,EAST],AUTHORITY[“EPSG”,“4326”]]
2022-07-30 17:30:28 (INFO) Rasterization: Output origin: [37.9848, 23.7285]
2022-07-30 17:30:28 (INFO) Rasterization: Output size: [0, 0]
2022-07-30 17:30:28 (INFO) Rasterization: Output spacing: [1.5, 1.5]
2022-07-30 17:30:28 (INFO): File resulted.tif will be written in 1073741824 blocks of 0x0 pixels
Writing resulted.tif…: 0% [ ]ERROR 1: Invalid dataset dimensions : 0 x 0
ERROR 10: Pointer ‘hDS’ is NULL in ‘GDALSetProjection’.

ERROR 10: Pointer ‘hDS’ is NULL in ‘GDALGetRasterBand’.

ERROR 10: Pointer ‘hBand’ is NULL in ‘GDALFillRaster’.

ERROR 10: Pointer ‘hDS’ is NULL in ‘GDALSetGeoTransform’.

2022-07-30 17:30:28 (FATAL) Rasterization: itk::ERROR: GDALImageIO(0x1d7e360): Dimensions are not defined.

Please provide me any command to see the logs, since I am new to Orfeo. Accordingly, I do not know how to check the logs, that is why I appreciate any help
The best

Also this a sample shape file I could not run using orfeo rasterization:
shape_file.zip (1.1 KB)

Dear @tom_gm,

Thank you for using OTB.

First, to activate the logs, you can set the environment variable OTB_LOGGER_LEVEL to “DEBUG”. (more explanations in the doc)

As for your problem, it appears the value you chose for the spacing is to big. You should try:

./otbcli_Rasterization -in ~/Desktop/polygon.shp -out resulted.tif -spx 0.00001 -spy 0.00001

As your polygon is very small, a small spacing is required to obtain an image larger that 0x0 pixel.

Sincerely.
Julien :slight_smile:

You could also use a different projection system:

otbcli_Rasterization -in my_downloaded_shape_file.shp -out rasterImage.tif -spx 1. -spy 1. -epsg 32631

Dear @julienosman nosman,
Thanks for your help and consideration.
Regards