Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. import arcpy
  2. from arcpy import env
  3. env.workspace = "C:/Data"
  4. inRaster = ("test.img")
  5. outASCII = "c:/output/test3.asc"
  6. arcpy.RasterToASCII_conversion(inRaster, outASCII)
  7.  
  8. import os
  9. dir_name = ...
  10. for filename in os.listdir(dir_name):
  11. if not filename.endswith(".img"): continue
  12. full_path = os.path.join(dir_name, filename)
  13. outASCII = '%s.asc' % (full_path,)
  14. arcpy.RasterToASCII_conversion(full_path, outASCII)
  15.  
  16. import arcpy
  17. arcpy.env.workspace = 'c:/data'
  18.  
  19. listOfImgs = arcpy.ListRasters('*.img')
  20. for imageFile in listOfImgs:
  21. outASCII = '%s.asc' % (imageFile,)
  22. arcpy.RasterToASCII_conversion(imageFile, outASCII)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement