Advertisement
Guest User

Untitled

a guest
Apr 27th, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. import os
  2. import arcpy
  3.  
  4. from os.path import join
  5.  
  6. # User entries on ArcGIS
  7. out_cover = "C:Usersusercoverage"
  8. in_lines = "C:Usersuserlines.shp"
  9. in_points = "C:Usersuserpoints.shp"
  10.  
  11. # Unsplit the lines
  12. fusionned_lines = join(arcpy.env.scratchGDB, "fusionned_lines")
  13. arcpy.UnsplitLine_management(in_lines, fusionned_lines)
  14.  
  15. # Copy the feature
  16. points = join(arcpy.env.scratchGDB, "points")
  17. arcpy.CopyFeatures_management(in_points, points)
  18.  
  19. # List the feature classes to put in the coverage.
  20. points_and_lines = [points, fusionned_lines]
  21.  
  22. # Create the coverage directory if needed.
  23. if not arcpy.Exists(out_cover):
  24. os.makedirs(out_cover)
  25.  
  26. # Convert the feature class list into a coverage.
  27. arcpy.FeatureclassToCoverage_conversion(points_and_lines, out_cover)
  28.  
  29. # The Delete_management of fusionned_lines and points is comparlsary, otherwise
  30. # it is impossible to delete the scratch workspace.
  31. arcpy.Delete_management(fusionned_lines)
  32. arcpy.Delete_management(points)
  33. # This delete does not work like I want :
  34. arcpy.Delete_management(arcpy.env.scratchGDB)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement