I’m trying to re-project a tif-file using gdal warp:
fn = "\dtm.tif"
out = "\dtm_25832.tif"
gdal.Warp(out, fn, dstSRS="EPSG:25832")
The output file is re-projected, but it creates artifacts in the output file.
Is there a way to avoid creating artifacts?
Artifacts are more visible on hillshade-dem.
from osgeo import gdal
import os
fn = 'DEM.tif'
# open dataset
rds = gdal.Open(fn)
ds = gdal.Open(fn)
ds.GetMetadata()
{'AREA_OR_POINT': 'Area',
'TIFFTAG_RESOLUTIONUNIT': '2 (pixels/inch)',
'TIFFTAG_XRESOLUTION': '72',
'TIFFTAG_YRESOLUTION': '72'}
rds.GetDescription()
'C:\\Python\\Test\\DEM.tif'
img_width,img_height=rds.RasterXSize,rds.RasterYSize
img_width,img_height
(15010, 30010)
ds.GetGeoTransform()
(-39575.0, 1.0, 0.0, 6726005.0, 0.0, -1.0)
ds.GetProjection()
PROJCS["ETRS89 / UTM zone 33N",GEOGCS["ETRS89",DATUM["European_Terrestrial_Reference_System_1989",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","6258"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4258"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","25833"]]
gdalinfo
report and screenshot of input dtm.tif.