import arcpy arcpy.ImportFromE00_conversion("M:/Documents/Programming2/Prac1/build.e00", "M:/Documents/Programming2/Prac2/", "build2")
scenarioFolder = sys.argv[1] # Remove already created coverages if they exist # using shutil since arcpy delete doesn't remove info folder if os.path.exists(scenarioFolder + "\\trcov"): shutil.rmtree(scenarioFolder + "\\trcov", ignore_errors=True) if os.path.exists(scenarioFolder + "\\hwycov"): shutil.rmtree(scenarioFolder + "\\hwycov", ignore_errors=True) if os.path.exists(scenarioFolder + "\\info"): shutil.rmtree(scenarioFolder + "\\info", ignore_errors=True) # Move to scenario folder env.workspace = scenarioFolder # Create hwy and transit coverages from e00 files arcpy.ImportFromE00_conversion("\\input\\trcov.e00", scenarioFolder, "trcov") arcpy.ImportFromE00_conversion("\\input\\hwycov.e00", scenarioFolder, "hwycov") # Remove already created shape files if they exist if arcpy.Exists("tap.shp"): arcpy.Delete_management("tap.shp") if arcpy.Exists("stop.shp"): arcpy.Delete_management("stop.shp") if arcpy.Exists("route.shp"): arcpy.Delete_management("route.shp") if arcpy.Exists("trlink.shp"): arcpy.Delete_management("trlink.shp") if arcpy.Exists("hwylink.shp"): arcpy.Delete_management("hwylink.shp") # Create necessary shape files from hwy and transit coverages
os.getcwd() # # e00 to coverage... # # loop e00s in workspace, convert to coverage, and put into custom folders for each for f in arcpy.ListFiles('*.E00'): print f # take just name, without the extension sp = f.split('.')[0] print sp # make new directory os.mkdir("%s\coverage_%s" % (ws, sp)) # convert to coverage and put in new directory arcpy.ImportFromE00_conversion(f, ("%s\coverage_%s" % (ws, sp)), sp) print 'Converted %s' % f # # rename coverage and add to data frame # # set working data frame and current MXD mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd, "*")[0] # loop through coverage and add to data frame for d in arcpy.ListFiles('coverage*'): print "%s\%s" % (ws, d) arcpy.env.workspace = "%s\%s" % (ws, d) for dataset in arcpy.ListDatasets():
import arcpy #Convert build.e00 to a coverage file. arcpy.ImportFromE00_conversion("M:/Python_Advanced/L2/build.e00", "M:/Python_Advanced/L2/", "build2")
def extract(e00, dest, fn): print(r'extracting {} to {}\{}'.format(e00, dest, fn)) import arcpy arcpy.ImportFromE00_conversion(e00, dest, fn)
import arcpy import os arcpy.env.overwriteOutput = True arcpy.env.workspace = ws = "" out = "output" for cov in arcpy.ListFiles("data/arc/*.e00"): arcpy.ImportFromE00_conversion(cov, ws, cov.split(".")[0]) if not ".e00" in cov and cov != "info": arcpy.env.workspace = os.path.join(ws, cov) for fc in arcpy.ListFeatureClasses("*polygon"): shp = os.path.join(out, "%s.shp" % cov) arcpy.FeatureClassToFeatureClass_conversion(fc, out)
import arcpy from arcpy import env env.workspace = "E:/StatisticsCanada/AgrCensus2001" arcpy.ImportFromE00_conversion("gcar000b03a_e.e00", "E:/StatisticsCanada/AgrCensus2001", "gcar000b03a_e")
import arcpy arcpy.ImportFromE00_conversion( "C:/Users/University/Dropbox/University/Advanced_programming/practicals/prac1_modelBuilder/data/build.e00", "C:/Users/University/Dropbox/University/Advanced_programming/practicals/prac1_modelBuilder/data", "build2")