I have ENVI files one ASCII file .hdr and a flat_binary raster file which is a file without an extension I'd like to convert them to TIFF files These are the steps I followed:
- Rename flat_binary raster file by adding ".dat"
- Keep the pair of files in the same directory
- Then, I wrote this code
import arcpy
ndvi_file="G:\\data\\test\\MYD13A2_A2006201_MED_1km.dat"
ndvi_tiff_file="G:\\data\\test\\data_tiff"
arcpy.RasterToOtherFormat_conversion(ndvi_file, ndvi_tiff_file, "TIFF")
But I didn't get the converted File I'm getting this error
Failed to convert: <built-in function input>. ERROR 999999: Error executing function.
Failed to execute (CopyRaster)
Is there anything missing?
1 Answer 1
Can ArcMap read the .dat file (it reads ENVI format without conversion).
Have you tried specifying the .tif extension on the output? The Copy Raster tool requires the .tif extension on the output path.
Also "TIFF" is an incorrect parameter in that spot. try format="TIFF"
(if you need it, honestly, I think the file extension should do the trick). (UPDATE sorry, I didn't see you were using this batch copy tool)
-
Thank you, but for the
format="TIFF"
It is not possible I followed the documentation (desktop.arcgis.com/fr/arcmap/10.3/tools/conversion-toolbox/…) and Adding the extension doesn't workhanen balti– hanen balti2021年04月02日 14:44:28 +00:00Commented Apr 2, 2021 at 14:44 -
I would try Copy Raster first before you try this tool to copy all of them. I'm guessing your ENVI files are not set up in a way that ArcMap can read them. If they were in the proper format, you could access them directly (not much reason to convert). ArcMap reads ENVI directly. desktop.arcgis.com/fr/arcmap/10.3/manage-data/raster-and-images/…Curtis Price– Curtis Price2021年04月02日 15:52:16 +00:00Commented Apr 2, 2021 at 15:52
-
The problem that when I do ADD data with ArcMap I cannot see my data, is there any other alternative ?hanen balti– hanen balti2021年04月03日 07:09:22 +00:00Commented Apr 3, 2021 at 7:09
-
My guess is that the ENVI images are of a data type that ArcGIS does not support, like Double. If you scale the NDVI values to float or byte and use a file extension (.dat or .img) you can probably read the ENVI files.Curtis Price– Curtis Price2021年04月04日 21:20:18 +00:00Commented Apr 4, 2021 at 21:20
-
The problem that if I change the extension of the ENVI file and open it in ArcMap I get 3 bands images with 0..255 values so I think i lose the NDVI valueshanen balti– hanen balti2021年04月05日 10:13:28 +00:00Commented Apr 5, 2021 at 10:13
Explore related questions
See similar questions with these tags.
ndvi_tiff_file
a workspace path or file path? It should be a workspace path.