1

I'm trying to crop some old georeferenced cartography in order to have a continuous map (every map has its blank borders that overlaps).
Usign raster->extract->clipper and setting no value to -32768 as the original maps, I got the same message:

for band 1, destination nodata value has been clamped to 0, the original value being out of range.

the problem is all the blacks in the map are translated to nodata. If I set no data value to something greater than 255, it clamps to 255 and all the whites are hidden. Is there a way to fix that?
the commandline is like that:

gdalwarp -dstnodata -32768 -q -cutline "borders.shp" -crop_to_cutline -of GTiff "source.tif" "destination.tif"
0

Solved by simply checking "create output aplha band".
The reason of the message is because gdalwarp uses the byte type by default, so only 8bits are allowed for every pixel (values from 0 to 255).
you can use the -ot Int16 option to extend the ranges, but it will increase the size of the raster and shift the colors (I suppose it's because of the resampling).
EDIT: -ot and -wt change the data type in GDAL Warp. -of specifies the filetype

-1

Maybe you are trying to process raster with bit-depth = 8bits.

Simply, add filetype: -ot Float32 for example, and won't clamp.

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.