Advertisement
Guest User

Untitled

a guest
Oct 21st, 2014
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #get the polygon
  2. sC = arcpy.SearchCursor(polygon)
  3. for row in sC:
  4. polygonshape = row.Shape
  5. del sC
  6.  
  7. #creation of the polyline(s):
  8.  
  9. feature_info = [[[p1.x, p1.y], [x, y]], [[p2.x, p2.y], [x, y]], [[p3.x, p3.y], [x, y]]]
  10. features = []
  11. for feature in feature_info:
  12. array = arcpy.Array()
  13. for point in feature:
  14. P = arcpy.Point()
  15. P.X = point[0]
  16. P.Y = point[1]
  17. array.add(P)
  18. features.append(arcpy.Polyline(array))
  19.  
  20. #the actual check:
  21. for item in features:
  22. in_poly = polygonshape.contains(item) #this is always false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement