Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import arcpy
- from os.path import join
- # User entries on ArcGIS
- out_cover = "C:Usersusercoverage"
- in_lines = "C:Usersuserlines.shp"
- in_points = "C:Usersuserpoints.shp"
- # Unsplit the lines
- fusionned_lines = join(arcpy.env.scratchGDB, "fusionned_lines")
- arcpy.UnsplitLine_management(in_lines, fusionned_lines)
- # Copy the feature
- points = join(arcpy.env.scratchGDB, "points")
- arcpy.CopyFeatures_management(in_points, points)
- # List the feature classes to put in the coverage.
- points_and_lines = [points, fusionned_lines]
- # Create the coverage directory if needed.
- if not arcpy.Exists(out_cover):
- os.makedirs(out_cover)
- # Convert the feature class list into a coverage.
- arcpy.FeatureclassToCoverage_conversion(points_and_lines, out_cover)
- # The Delete_management of fusionned_lines and points is comparlsary, otherwise
- # it is impossible to delete the scratch workspace.
- arcpy.Delete_management(fusionned_lines)
- arcpy.Delete_management(points)
- # This delete does not work like I want :
- arcpy.Delete_management(arcpy.env.scratchGDB)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement