Package pygeodesy :: Module booleans :: Class BooleanGH |
[frames] | no frames]

# Class BooleanGH

      object --+
               |
    named._Named --+
                   |
      _CompositeBase --+
                       |
            _CompositeGH --+
                           |
              object --+   |
                       |   |
            _BooleanBase --+
                           |
                          BooleanGH

Composite class providing boolean operations between two composites using the Greiner-Hormann algorithm and Correia's implementation, modified and extended.

The supported operations between (composite) polygon A and B are:

- C = A - B or A -= B, difference A less B
- C = B - A or B -= A, difference B less B
- C = A & B or A &= B, intersection of A and B
- C = A + B or A += B, sum of A and B clips
- C = A | B or A |= B, union of A and B
- A == B or A != B, equivalent A and B clips
- A.isequalTo(B, eps), equivalent within tolerance

Note: To handle degenerate cases like `point-edge` and `point-point` intersections, use class BooleanFHP.

See Also: Methods `__eq__` and `isequalTo`, function clipGH4 and class BooleanFHP.

Instance Methods
__init__(self, lls, raiser=True, xtend=False, eps=2.220446049250313e-16, **name) New BooleanFHP operand for boolean operation. |
__isub__(self, other) In-place difference: `this -= other`. |
__rsub__(self, other) Reverse difference: `other - this` |
__sub__(self, other) Difference: `this - other`. |
Inherited from `_CompositeBase`: `__contains__`, `__eq__`, `__iter__`, `__len__`, `__ne__`, `__repr__`, `__str__`, `clipids`, `isequalTo`, `toLatLon` Inherited from `named._Named`: `__imatmul__`, `__matmul__`, `__rmatmul__`, `attrs`, `classof`, `copy`, `dup`, `methodname`, `rename`, `renamed`, `toRepr`, `toStr`, `toStr2` Inherited from `_BooleanBase`: `__add__`, `__and__`, `__iadd__`, `__iand__`, `__ior__`, `__or__`, `__radd__`, `__rand__`, `__ror__` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties
Inherited from `_CompositeGH`: `xtend` Inherited from `_CompositeBase`: `eps`, `raiser` Inherited from `named._Named`: `classname`, `classnaming`, `iteration`, `name`, `named`, `named2`, `named3`, `named4`, `sizeof` Inherited from `object`: `__class__`

Method Details

### __init__ (self, lls, raiser=True, xtend=False, eps=2.220446049250313e-16, **name) (Constructor) |
New BooleanFHP operand for boolean operation. Arguments: `lls` - The polygon points and clips (iterable of LatLonGHs, ClipGH4Tuples or other `LatLon`s). `raiser` - If `True`, throw ClipError exceptions (`bool`). `xtend` - If `True`, extend edges of degenerate cases, an attempt to handle the latter (`bool`). `esp` - Tolerance for eliminating null edges (`degrees`, same units as the `lls` coordinates). `name` - Optional `name=NN` (`str`). Overrides: object.__init__