[GRASS-user] Need help applying gdalwarp

I found Markus N's 'gdal tips and tricks' web page and tried applying it to
warp a DEM so north is up rather than tilted to the right.

The script:

-----
#!/usr/bin/bash

# set region to the map to be warped
g.region rast=45123h5_clatsop

# The file format is ENVI or Ehdr, not a GTiff so use r.gdal.out
r.out.gdal in=45123h5_clatsop out=45123h5_clatsop.tif for=GTiff --o

# raster map reprojection (warping)
gdalwarp -rb 45123h5_clatsop.tif test1.tif
-----

r.out.gdal appears to work but did not like the 'elev' color scale;

r.out.gdal in=45123h5_clatsop out=45123h5_clatsop.tif for=GTiff --o
Checking GDAL data type and nodata value...
  100%
Using GDAL data type <Float32>
Input raster map contains cells with NULL-value (no-data). The value -nan
will be used to represent no-data values in the input map. You can specify
a nodata value with the nodata option.
Exporting raster data to GTiff format...
ERROR 6: SetColorTable() only supported for Byte or UInt16 bands in TIFF format.
  100%
r.out.gdal complete. File <45123h5_clatsop.tif> created.

The gdalwarp test1.tif output looks the same as the input .tif. It's still
slightly skewed clockwise.

Since I've not before had a need to use gdalwarp I'm totally inexperienced
with the tool. How should the script be modified to produce a northup.tif
output that can be imported back to grass with r.in.gdal?

TIA,

Rich

Rich Shepard <rshepard@appl-ecosys.com> schrieb am Di., 24. Sep. 2019, 20:47:

I found Markus N’s ‘gdal tips and tricks’ web page and tried applying it to warp a DEM so north is up rather than tilted to the right.

Please note that rotation should only be performed in case (!) the data have been stored with the respective rotation metadata in the file (gdalinfo will tell), otherwise not.

(see also answer by Markus M)

Just to avoid confusion

Best
markusN

On Tue, 24 Sep 2019, Markus Neteler wrote:

Please note that rotation should only be performed in case (!) the data
have been stored with the respective rotation metadata in the file
(gdalinfo will tell), otherwise not.

(see also answer by Markus M)

Just to avoid confusion

Markus,

Thanks for explaining.

This is the most problamatic experience I've had with the Oregon LiDAR DEMs.
I've used smaller areas in three other projects and every map in every quad
imported and re-projected with no issues.

The first couple of times the clatsop map overlaid the other two. That's
what started me down this path. Starting again with a fresh download of the
entire quad .zip file it works.

Best regards,

Rich