'''**************************************************************************** Name: ASCII3D_to_Feature_Class Example Description: This script demonstrates how to use the ASCII3D_to_Feature_Class tool to create a point feature class from a set of text files in the specified workspace. ****************************************************************************''' # Import system modules` import arcpy, os from arcpy import env import exceptions, sys, traceback try: #prjFile = os.path.join(arcpy.GetInstallInfo()["InstallDir"], # "M:/GIS/ArcGIS 10 Coordinate System Files and Projections/ArcGIS 10 Coordinate System Files and Projections/Coordinate Systems/Projected Coordinate Systems/National Grids/Australia/GDA 1994 MGA Zone 55.prj") #CS = arcpy.SpatialReference(prjFile) # Obtain a license for the ArcGIS 3D Analyst extension arcpy.CheckOutExtension("3D") # Set environment settings env.workspace = "M:/GIS/data" # Set Local Variables inFormat = "XYZ" # Name of the output file outFC = "90MileBeachPts_from_ASCII.shp" # Geometry of the output feature class outType = "MULTIPOINT" zFactor = 1 # Coordinate system of the output feature class CS = "GDA 1994 MGA Zone 55.prj" fileSuffix = "mga55.xyz" decSep = "DECIMAL_POINT" # Specifies the decimal delimeter # Create list of ASCII files txtList = arcpy.ListFiles("*" + fileSuffix) # Verify the presence of TINs in the list if len(txtList) > 0: # Execute ASCII3D_to_Feature_Class arcpy.ASCII3DToFeatureClass_3d(txtList, inFormat, outFC, outType, zFactor,CS, 2.0, fileSuffix, decSep) except arcpy.ExecuteError: print arcpy.GetMessages() except: # Get the traceback object tb = sys.exc_info()[2] tbinfo = traceback.format_tb(tb)[0] # Concatenate error information into message string pymsg = 'PYTHON ERRORS:\nTraceback info:\n{0}\nError Info:\n{1}'\ .format(tbinfo, str(sys.exc_info()[1])) msgs = 'ArcPy ERRORS:\n {0}\n'.format(arcpy.GetMessages(2)) # Return python error messages for script tool or Python Window arcpy.AddError(pymsg) arcpy.AddError(msgs)
'''**************************************************************************** Name: ASCII3D_to_Feature_Class Example Description: This script demonstrates how to use the ASCII3D_to_Feature_Class tool to create a point feature class from a set of text files in the specified workspace. ****************************************************************************''' # Import system modules` import arcpy, os from arcpy import env import exceptions, sys, traceback try: prjFile = os.path.join(arcpy.GetInstallInfo()["InstallDir"], "M:/GIS/ArcGIS 10 Coordinate System Files and Projections/ArcGIS 10 Coordinate System Files and Projections/Coordinate Systems/Projected Coordinate Systems/National Grids/Australia/GDA 1994 MGA Zone 55.prj") CS = arcpy.SpatialReference(prjFile) # Obtain a license for the ArcGIS 3D Analyst extension arcpy.CheckOutExtension("3D") # Set environment settings env.workspace = "M:/GIS/LidarProd/XYZToFeature/Missing Lidar from DSE 21022013/elevation/cep2007-08_srw-90mb/regular_surface/dem_ground/xyz_ascii" # Set Local Variables inFormat = "XYZ" # Name of the output file outFC = "90MileBeachPts_from_ASCII.shp" # Geometry of the output feature class outType = "MULTIPOINT" zFactor = 1 # Coordinate system of the output feature class #CS = "Geographic Coordinate Systems/GDA 1994 MGA Zone 55.prj" fileSuffix = "mga55.xyz" decSep = "DECIMAL_POINT" # Specifies the decimal delimeter # Create list of ASCII files txtList = arcpy.ListFiles("*" + fileSuffix) # Verify the presence of TINs in the list if len(txtList) > 0: # Execute ASCII3D_to_Feature_Class arcpy.ASCII3DToFeatureClass_3d(txtList, inFormat, outFC, outType, zFactor, CS, fileSuffix, decSep) except arcpy.ExecuteError: print arcpy.GetMessages() except: # Get the traceback object tb = sys.exc_info()[2] tbinfo = traceback.format_tb(tb)[0] # Concatenate error information into message string pymsg = 'PYTHON ERRORS:\nTraceback info:\n{0}\nError Info:\n{1}'\ .format(tbinfo, str(sys.exc_info()[1])) msgs = 'ArcPy ERRORS:\n {0}\n'.format(arcpy.GetMessages(2)) # Return python error messages for script tool or Python Window arcpy.AddError(pymsg) arcpy.AddError(msgs)
'''**************************************************************************** Name: ASCII3D_to_Feature_Class Example Description: This script demonstrates how to use the ASCII3D_to_Feature_Class tool to create a point feature class from a set of text files in the specified workspace. ****************************************************************************''' # Import system modules` import arcpy from arcpy import env import exceptions, sys, traceback try: # Obtain a license for the ArcGIS 3D Analyst extension arcpy.CheckOutExtension("3D") # Set environment settings env.workspace = "M:/GIS/LidarProd/XYZToFeature/Missing Lidar from DSE 21022013/elevation/cep2007-08_srw-90mb/regular_surface/dem_ground/xyz_ascii" # Set Local Variables inFormat = "XYZ" # Name of the output file outFC = "90MileBeachPts_from_ASCII.shp" # Geometry of the output feature class outType = "MULTIPOINT" zFactor = 1 # Coordinate system of the output feature class CS = "Geographic Coordinate Systems/GDA 1994 MGA Zone 55.prj" fileSuffix = "mga55.xyz" decSep = "DECIMAL_POINT" # Specifies the decimal delimeter # Create list of ASCII files txtList = arcpy.ListFiles("*" + fileSuffix) # Verify the presence of TINs in the list if len(txtList) > 0: # Execute ASCII3D_to_Feature_Class arcpy.ASCII3DToFeatureClass_3d(txtList, inFormat, outFC, outType, zFactor, CS, fileSuffix, decSep) except arcpy.ExecuteError: print arcpy.GetMessages() except: # Get the traceback object tb = sys.exc_info()[2] tbinfo = traceback.format_tb(tb)[0] # Concatenate error information into message string pymsg = 'PYTHON ERRORS:\nTraceback info:\n{0}\nError Info:\n{1}'\ .format(tbinfo, str(sys.exc_info()[1])) msgs = 'ArcPy ERRORS:\n {0}\n'.format(arcpy.GetMessages(2)) # Return python error messages for script tool or Python Window arcpy.AddError(pymsg) arcpy.AddError(msgs)
CS = "Geographic Coordinate Systems/GDA 1994 MGA Zone 55"
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.