1

UPDATE # 01 : Links to related past questions:

Mirrored Contours from DEM in QGIS

gdal_translate creates images that are mirrored

This question has been asked before, but I can't fix my personal issue, perhaps because the coordinate-less TIFF I'm using to produce my contour is one made up of bits of DEMs.

How can I have the contour appear exactly on top of my landmass?

GDAL command:
gdalinfo -mm -stats D:/H09.tiff
GDAL command output:
Driver: GTiff/GeoTIFF 
Files: D:/H09.tiff 
Size is 2244, 3564 
Metadata: 
TIFFTAG_DATETIME=2022:04:01 09:57:47 
TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch) 
TIFFTAG_XRESOLUTION=96 
TIFFTAG_YRESOLUTION=96 
Image Structure Metadata: 
COMPRESSION=DEFLATE 
INTERLEAVE=PIXEL 
PREDICTOR=2 
Corner Coordinates: 
Upper Left ( 0.0, 0.0) 
Lower Left ( 0.0, 3564.0) 
Upper Right ( 2244.0, 0.0) 
Lower Right ( 2244.0, 3564.0) 
Center ( 1122.0, 1782.0) 
Band 1 Block=2244x1 Type=UInt16, ColorInterp=Gray 
Computed Min/Max=0.000,36355.000 
Minimum=0.000, Maximum=36355.000, Mean=3509.658, StdDev=6167.460 
Mask Flags: PER_DATASET ALPHA 
Metadata: 
STATISTICS_MAXIMUM=36355 
STATISTICS_MEAN=3509.6577052462 
STATISTICS_MINIMUM=0 
STATISTICS_STDDEV=6167.4600463843 
STATISTICS_VALID_PERCENT=100 
Band 2 Block=2244x1 Type=UInt16, ColorInterp=Alpha 
Computed Min/Max=0.000,65535.000 
Minimum=0.000, Maximum=65535.000, Mean=21887.963, StdDev=30885.667 
Metadata: 
STATISTICS_MAXIMUM=65535 
STATISTICS_MEAN=21887.962675002 
STATISTICS_MINIMUM=0 
STATISTICS_STDDEV=30885.666560733 
STATISTICS_VALID_PERCENT=100
Process completed successfully
Execution completed in 0.34 seconds

enter image description here

3
  • 1
    Please provide links to any questions that have asked this before.
    – PolyGeo
    Commented Apr 1, 2022 at 17:27
  • 1
    How are you making the contours? Is there a reason not to apply a projection to the tiff?
    – Ian Turton
    Commented Apr 1, 2022 at 17:27
  • Thank you for your comments. (01) I updated my question to add links to older similar questions. (02) Contour workflow: Processing Toolbox > Contour Polygons. Then, select the correct "Input layer" (which correspons to the DEM-like landmass seen in the picture above); Input a number for "Interval between contour lines"; click on "Run". Commented Apr 2, 2022 at 16:29

1 Answer 1

1

You seem to have a DEM that is not georeferenced and then GDAL is using the default values:

  • origin at (0 0) - this is at the top left corner
  • pixel size (1 1) - coordinates are increased by one unit for each pixel to the right and towards the bottom from the top left corner

This leads sometimes into issues because in georeferenced data the Y coordinate is usually increasing from bottom to top - from the South towards the North.

I would try a workaround by creating a world file (.tfw) into the same directory where you have the image "H09.tiff". Name the world file as "H09.tfw" or "H09.wld". Both should work. Write these six lines into the world file:

1
0
0
-1
0
0
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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