I'm attempting to do what is generally a straightforward raster calculation when I do this in QGIS, but am trying to do this with gdal_calc.py in terminal. The output is close, but produces banding and inconsistencies in parts of the output raster. I'm wondering if there is anything I'm overlooking. Code to calculate the image is below:

gdal_calc.py -A <input>  --outfile = <output> --calc="(A/nanmax(A)) * 65535" --NoDataValue=0

Output elevation raster of clipped area. Raster shows some banding and inconsistent values in areas of the raster

  • You should precise what format your input is. – J.R Sep 19 at 14:58
  • Thank you. Could you explain further or point me to the documentation I would need to complete your suggestion? – sreiny Sep 19 at 15:16
  • Use gdalinfo <dataset_name> to describe the dataset. – vinh Sep 20 at 12:27
  • Also, it is always a good idea to increase the memory available to gdal, see here trac.osgeo.org/gdal/wiki/ConfigOptions – vinh Sep 20 at 12:29
  • Driver: GTiff/GeoTIFF Files: maryland.tiff Size is 15978, 6520 Coordinate System is: GEOGCS["NAD83", DATUM["North_American_Datum_1983", SPHEROID["GRS 1980",6378137,298.2572221010042, AUTHORITY["EPSG","7019"]], TOWGS84[0,0,0,0,0,0,0], AUTHORITY["EPSG","6269"]], PRIMEM["Greenwich",0], UNIT["degree",0.0174532925199433], Pixel Size = (0.000277777777896,-0.000277777777896) AREA_OR_POINT=Area Image Structure Metadata: INTERLEAVE=BAND Band 1 Block=15978x1 Type=Float32, ColorInterp=Gray NoData Value=-9999 – sreiny Sep 21 at 13:16

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.