0

I am am trying to merge raster files from the Sentinel 2 Constellation (after some processing) with rioxarray for the UTM Zones 32 and 33. It's looking good, execpt when an larger area for example the City of Berlin(Germany) in included in Scences in UTM32 (EPSG:32632) and UTM33(EPSG:32633). Before merging the images I project them to UTM33. After the mergeing Everything is getting to look unsharp, like having the street twice, but with a quite a distance away.

I am merging those with the given code:

def merge_min_intensity(folder: Path, save_file_name: Path, epsg_code: int) -> xarray.DataArray:
    rasters: List[xarray.DataArray] = []
    for file in folder.iterdir():
        if str(file).endswith(".tif"):
            raster = rxa.open_rasterio(file)
            if int(raster.rio.crs.data['init'].split(":")[1]) != epsg_code:
                raster = raster.rio.reproject(epsg_code)
            rasters.append(raster)

    ret_raster = merge_arrays(rasters, method="min")

    ret_raster.rio.to_raster(save_file_name)
    return ret_raster

What might be the reason for this?

  • Comment: please be aware I used the method '''min'''. I checked with the TCL band. The doubled features was about 60 m appart. – tetje Nov 5 '20 at 12:22
  • 2
    With UTM zones the maximum distortion will occur at the edges of the zone, you may need to pick another projection – Ian Turton Nov 5 '20 at 13:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.