Shortcuts

mmocr.utils.poly_union

mmocr.utils.poly_union(poly_a, poly_b, invalid_ret=None, return_poly=False)[source]

Calculate the union area between two polygons.

Parameters
  • poly_a (Polygon) – Polygon a.

  • poly_b (Polygon) – Polygon b.

  • invalid_ret (float or int, optional) – The return value when the invalid polygon exists. If it is not specified, the function allows the computation to proceed with invalid polygons by cleaning the their self-touching or self-crossing parts. Defaults to False.

  • return_poly (bool) – Whether to return the polygon of the union. Defaults to False.

Returns

Returns a tuple (area, Optional[poly_obj]), where the area is the union between two polygons and poly_obj is the Polygon or MultiPolygon object of the union of the inputs. The type of object depends on whether they intersect or not. Set as None if the input is invalid. poly_obj will be returned only if return_poly is True.

Return type

tuple

Read the Docs v: dev-1.x
Versions
latest
stable
v1.0.1
v1.0.0
0.x
v0.6.3
v0.6.2
v0.6.1
v0.6.0
v0.5.0
v0.4.1
v0.4.0
v0.3.0
v0.2.1
v0.2.0
v0.1.0
dev-1.x
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.