I have had no luck creating rasters that are clipped from larger ones using gdal_translate. If I just do a simple conversion (no clipping) to .tif there is no problem However if I use -projwin and specify a smaller region I get a useless raster with naNs.
What is even more frustrating is that some raster files do work ok, especially if they are rgb. The raster files I have to clip/convert are single band Float32 grayscale.
I am running QGIS on my Windows 10PC with QGIS v2.18.13 and GDAL/OGR 2.2.2
Here is the actual command:
gdal_translate -projwin 711541.57665 20664.3625 712593.227737 20044.0065217 -of GTiff "D:/Composite Project/testin.tif" "D:/Composite Project/cliptest.tif"
Likewise the info on this particular input file is below. BTW - this problem is not confined to just this file but a large collection of grayscale tif, cub and img files I have:
Driver: GTiff/GeoTIFF
Files: D:/Dropbox/Composite Project/testin.tif
D:/Dropbox/Composite Project/testin.tif.aux.xml
Size is 10032, 55134
Coordinate System is:
PROJCS["EQUIRECTANGULAR MOON",
GEOGCS["GCS_MOON",
DATUM["D_MOON",
SPHEROID["MOON_localRadius",1737400,0]],
PRIMEM["Reference_Meridian",0],
UNIT["degree",0.0174532925199433]],
PROJECTION["Equirectangular"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",23],
PARAMETER["standard_parallel_1",0.7],
PARAMETER["false_easting",0],
PARAMETER["false_northing",0],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]]]
Origin = (13140.399999999999636,27728.479999999999563)
Pixel Size = (0.520000000000000,-0.520000000000000)
Metadata:
AREA_OR_POINT=Area
DATA_SET_ID="LRO-L-LROC-5-RDR-V1.0"
INSTRUMENT_ID="LROC"
INSTRUMENT_NAME="LUNAR RECONNAISSANCE ORBITER CAMERA"
PRODUCER_INSTITUTION_NAME="ARIZONA STATE UNIVERSITY"
PRODUCT_CREATION_TIME=2013-05-30T01:32:18
PRODUCT_ID="NAC_ROI_APOLLO11LOA_E004N0235"
PRODUCT_TYPE="RDR"
TARGET_NAME=MOON
Image Structure Metadata:
INTERLEAVE=BAND
Corner Coordinates:
Upper Left ( 13140.400, 27728.480) ( 23d26' 0.15"E, 0d54'51.94"N)
Lower Left ( 13140.400, -941.200) ( 23d26' 0.15"E, 0d 1'51.74"S)
Upper Right ( 18357.040, 27728.480) ( 23d36'19.52"E, 0d54'51.94"N)
Lower Right ( 18357.040, -941.200) ( 23d36'19.52"E, 0d 1'51.74"S)
Center ( 15748.720, 13393.640) ( 23d31' 9.83"E, 0d26'30.10"N)
Band 1 Block=10032x1 Type=Float32, ColorInterp=Gray
Min=-0.004 Max=0.048
Minimum=-0.004, Maximum=0.048, Mean=0.004, StdDev=0.003
NoData Value=-3.40282265508890445e+38
Metadata:
STATISTICS_MAXIMUM=0.047876562923193
STATISTICS_MEAN=0.0043105538663359
STATISTICS_MINIMUM=-0.0035738591104746
STATISTICS_STDDEV=0.0025277971613299