Pk19000 - 1 year ago 160

Python Question

I need to calculate the amount of two oval intersects in a python program.

I know in shaply there is a function that return true if two object has intersects. As like as this:

`from shapely.geometry import Polygon`

p1=Polygon([(0,0),(1,1),(1,0)])

p2=Polygon([(0,1),(1,0),(1,1)])

print p1.intersects(p2)

is there any library or function That help me?

Thanks.

Recommended for you: Get network issues from **WhatsUp Gold**. **Not end users.**

Answer Source

Is this what you are looking for? (the polygon that results from the intersection)

```
x = p1.intersection(p2)
x.area
```

Find more information in the documentation here

Recommended from our users: **Dynamic Network Monitoring from WhatsUp Gold from IPSwitch**. ** Free Download**