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

# Class BooleanGH

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

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

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

- C = A | B or A |= B, union of A and B
- C = A & B or A &= B, intersection of A and B
- C = A - B or A -= B, difference A less B
- C = B - A or B -= A, difference B less A

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

See Also: Function clipGH4 and class BooleanFHP.

Instance Methods
__init__(self, lls, raiser=False, xtend=False, **name_kind_eps) New BooleanGH. |
__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__`, `__iter__`, `__len__`, `__repr__`, `__str__`, `clipids` Inherited from `named._Named`: `__imatmul__`, `__matmul__`, `__rmatmul__`, `attrs`, `classof`, `copy`, `dup`, `methodname`, `rename`, `toRepr`, `toStr`, `toStr2` Inherited from `_BooleanBase`: `__and__`, `__iand__`, `__ior__`, `__or__`, `__rand__`, `__ror__` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties
Inherited from `named._Named`: `classname`, `classnaming`, `iteration`, `name`, `named`, `named2`, `named3`, `named4` Inherited from `object`: `__class__`

Method Details

### __init__ (self, lls, raiser=False, xtend=False, **name_kind_eps) (Constructor) |
New BooleanGH. Arguments: `lls` - The polygon points (iterable of 2 or more `LatLon`s, LatLonGHs or ClipGH4Tuples). `name` - Optional name (`str`). `raiser` - If `True` throw `ClipError` exceptions for errors or degenerate cases. `xtend` - If `True` handle degenerate cases. `name_kind_eps` - Optional `name=NN` (`str`) and/or optional `kind='corners'` of `lls` points (`str`) and `eps=EPS` tolerance for duplicate removal (`float`). Overrides: object.__init__