Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. from shapely import geometry,wkt
  2. line = geometry.LineString([(13.51039642756912, 52.598912814414675), (13.525173800277184, 52.60620240344557)])
  3. poly = geometry.Polygon ([(13.52072838433517, 52.61735554606274), (13.52233276805985, 52.59511541819082), (13.51312087418833, 52.59394589806786),( 13.51526963068252, 52.60338701649216),( 13.51836560008325 ,52.6009395669487), (13.52072838433517, 52.61735554606274)])
  4.  
  5. ips = line.intersection(poly.boundary)
  6. for i in ips:
  7. print i.touches(poly.boundary) # should touch but it doesnt!!!!
  8.  
  9. >>>False
  10.  
  11. EPS = 1e-15
  12. for i in ips:
  13. print i.distance(poly) < EPS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement