TransWikia.com

Converting ENVI file to TIFF using ArcPy

Geographic Information Systems Asked by hanen balti on July 17, 2021

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:

  1. Rename flat_binary raster file by adding “.dat”
  2. Keep the pair of files in the same directory
  3. Then, I wrote this code
import arcpy
ndvi_file="G:datatestMYD13A2_A2006201_MED_1km.dat"
ndvi_tiff_file="G:datatestdata_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?

One Answer

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)

Answered by Curtis Price on July 17, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP