I am using satellite data and by default it has a nodata value of 0 for each band.
This is fine except for when I'm making NDVIs where 0 is a real value we need to include and I don't want it to be classified as nodata.
I want to make sure all the bands/tifs I am working with have the same nodata value. So how do I convert a nodata value of 0 to something else, like -10000.
I was thinking of using arcpy's reclassify tool on my bands changing 0 to -10000 (before I make NDVIs) and then copying the raster with the copyraster tool using the setting for nodata as -10000.
This seems inefficient. Is there a tool that does this better? I'm open to open source libraries or arcpy
but this is a huge help!
– Emtomp Feb 26 '20 at 20:10I'm not sure why it is doing this.
– Emtomp Mar 02 '20 at 14:18uint16is an unsigned 16-bit integer. This means that your raster can only take values between 0 and 65,535. Try changing the NoData value to a positive value between that range, or change the raster data type to support negative values. – Marcelo Villa Mar 02 '20 at 14:23gdal_translateto create a copy of the raster, specifying a new data type. Here is an example: https://gis.stackexchange.com/a/241448/86131.gdal_translatecan be called from a Python script, either as a command line utility or usinggdal.Translate(). I suggest you try this and should you have any trouble, create a new question and link it here so I can help you. – Marcelo Villa Mar 02 '20 at 14:59