A generalized function for topology operations, takes a GDAL function and the other geometry to perform the operation on.
(self, func, other)
| 488 | |
| 489 | # #### Topology Methods #### |
| 490 | def _topology(self, func, other): |
| 491 | """A generalized function for topology operations, takes a GDAL |
| 492 | function and the other geometry to perform the operation on.""" |
| 493 | if not isinstance(other, OGRGeometry): |
| 494 | raise TypeError( |
| 495 | "Must use another OGRGeometry object for topology operations!" |
| 496 | ) |
| 497 | |
| 498 | # Returning the output of the given function with the other geometry's |
| 499 | # pointer. |
| 500 | return func(self.ptr, other.ptr) |
| 501 | |
| 502 | def intersects(self, other): |
| 503 | "Return True if this geometry intersects with the other." |