2

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.

enter image description here

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"]]

5
  • Please include gdalinfo report and screenshot of input dtm.tif.
    – user2856
    Sep 16 '20 at 11:20
  • Try some other resampling than "nearest" that is the default.
    – user30184
    Sep 16 '20 at 11:24
  • I have tried with different resampling methods - still the same problem.
    – heljor
    Sep 16 '20 at 12:39
  • Small sample of data and exact parameters would be appreciated.
    – user30184
    Sep 16 '20 at 12:42
  • What's the input coordinate reference system? Or just edit the question with the gdalinfo report please.
    – mkennedy
    Sep 16 '20 at 17:06
0

I have noticed a very similar issue when reprojecting both LiDAR and 10 meter DEM data with ArcGIS Project Raster Tool. Visible below in a slope raster. I suspect it is a side-effect of the fact that projecting a raster is not as clean an operation as projecting a vector. Interestingly this did effect my slope calculation for this watershed by from 11.6% original to 12.9% after projection. The jaggedness seems to have translated to a steeper mean slope calculation.

Original GCS (NAD1983) Original GCS (NAD1983)

New PCS(NAD1983 Stateplane) New PCS(NAD1983 Stateplane)

0
0

Try setting the error threshold (-et) option to something lower than the default (like here).

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.