# Reprojection of RADOLAN bin data to UTM tif

**URL:** <https://openradar.discourse.group/t/reprojection-of-radolan-bin-data-to-utm-tif/486>\
**Category:** Python\
**Tags:** wradlib\
**Created:** [July 10, 2024, 10:15am UTC](https://openradar.discourse.group/t/reprojection-of-radolan-bin-data-to-utm-tif/486 "2024-07-10T10:15:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tschneider](https://avatars.discourse-cdn.com/v4/letter/t/9d8465/32.png) [@tschneider](https://openradar.discourse.group/u/tschneider)\
**Post date:** [July 10, 2024, 10:15am UTC](https://openradar.discourse.group/t/reprojection-of-radolan-bin-data-to-utm-tif/486/1 "2024-07-10T10:15:21Z")

</div>

I am trying to convert RADKLIM binary data from [Index of /climate\_environment/CDC/grids\_germany/5\_minutes/radolan/reproc/2017\_002/bin/](https://opendata.dwd.de/climate_environment/CDC/grids_germany/5_minutes/radolan/reproc/2017_002/bin/) to a Geotif with EPSG 25832. Here is the relevant snippet from my script:

```auto
import os, warnings
import wradlib as wrl
from osgeo import osr, gdal
import numpy as np
warnings.filterwarnings('ignore')

# os.environ["WRADLIB_DATA"] = "C:/Temp/"

proj_stereo = wrl.georef.create_osr("dwd-radolan") # osr spatial reference
proj_utm = osr.SpatialReference()
proj_utm.ImportFromEPSG(25832) # osr spatial reference

binfile = 'raa01-yw2017.002_10000-2301012310-dwd---bin'
outf = 'test.tif'

xy_stereo = wrl.georef.get_radolan_grid(1100,900)
data_raw, attrs = wrl.io.read_radolan_composite(binfile, missing=0.0)
data, xy_stereo = wrl.georef.set_raster_origin(data_raw, xy_stereo, 'upper')
ds = wrl.georef.create_raster_dataset(data, xy_stereo, crs=proj_stereo)
ds_out = wrl.georef.reproject_raster_dataset(
   ds, spacing=1000, resample=0, projection_target=proj_utm)

wrl.io.write_raster_dataset(outf, ds_out, 'GTiff')
os.remove(binfile)

```

I am getting this error:

```auto
 File c:\utils\radklim_tmp\03_convert_radklim_tiff_test.py:31
    ds_out = wrl.georef.reproject_raster_dataset(

  File C:\utils\miniconda\Lib\site-packages\wradlib\georef\raster.py:556 in reproject_raster_dataset
    dst_ds = mem_drv.Create("", cols, rows, 1, gdal.GDT_Float32)

  File C:\utils\miniconda\Lib\site-packages\osgeo\gdal.py:3742 in Create
    return _gdal.Driver_Create(self, *args, **kwargs)

RuntimeError: Attempt to create 0x1 dataset is illegal,sizes must be larger than zero.

```

Any ideas where my code is lacking?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/openradar/original/1X/84aac64abe11876d062574c7db94022e4112646a.svg) [@system](https://openradar.discourse.group/u/system)\
**Post date:** [July 24, 2024, 1:53pm UTC](https://openradar.discourse.group/t/reprojection-of-radolan-bin-data-to-utm-tif/486/2 "2024-07-24T13:53:33Z")

</div>



---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/openradar/original/1X/84aac64abe11876d062574c7db94022e4112646a.svg) [@system](https://openradar.discourse.group/u/system)\
**Post date:** [July 26, 2024, 2:32pm UTC](https://openradar.discourse.group/t/reprojection-of-radolan-bin-data-to-utm-tif/486/3 "2024-07-26T14:32:11Z")

</div>



---

<div class="post-metadata">

**Author:** ![tschneider](https://avatars.discourse-cdn.com/v4/letter/t/9d8465/32.png) [@tschneider](https://openradar.discourse.group/u/tschneider)\
**Post date:** [July 26, 2024, 2:39pm UTC](https://openradar.discourse.group/t/reprojection-of-radolan-bin-data-to-utm-tif/486/4 "2024-07-26T14:39:26Z")

</div>

In the meantime, i tried different options for wrl.georef.reproject\_raster\_dataset. If i use the size parameter instead of the spacing parameter, nad it works. However, i am confused, if i use

```auto
ds_out = wrl.georef.reproject_raster_dataset(ds, size=(1100, 900), projection_target=proj_utm)

```

the resulting cells do not look quadratic at all in qgis, if i use

```auto
ds_out = wrl.georef.reproject_raster_dataset(ds, size=(900, 1100), projection_target=proj_utm)

```

instead, the cells look more quadratic. Also: The resulting raster still shows as stereo projection in qgis, even though a thought i converted to EPSG 25832. Any ideas or explanation that might help me?
