import arcgisscripting, string, os, sys gp = arcgisscripting.create(9.3) gp.Workspace = r"U:\GIS\Temp" ascList = gp.ListRasters("*.asc", "*") for ascFile in ascList: dsc = gp.Describe(ascFile) # Gets the Description about the ascii file ascIn = dsc.CatalogPath # Gets the Full Catalog Path of the ascii file ascOut = ascIn[:-4] + ".img" # Removes the .asc extension and adds .img gp.ASCIIToRaster_conversion(ascIn, ascOut, "FLOAT")
ArcGIS doesn't see .asc files as files, they are recognized as raster datasets. arcpy.ListRasters() would have worked in this case.
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.