The coordinate system transformation object.
| 350 | |
| 351 | |
| 352 | class CoordTransform(GDALBase): |
| 353 | "The coordinate system transformation object." |
| 354 | |
| 355 | destructor = capi.destroy_ct |
| 356 | |
| 357 | def __init__(self, source, target): |
| 358 | "Initialize on a source and target SpatialReference objects." |
| 359 | if not isinstance(source, SpatialReference) or not isinstance( |
| 360 | target, SpatialReference |
| 361 | ): |
| 362 | raise TypeError("source and target must be of type SpatialReference") |
| 363 | self.ptr = capi.new_ct(source._ptr, target._ptr) |
| 364 | self._srs1_name = source.name |
| 365 | self._srs2_name = target.name |
| 366 | |
| 367 | def __str__(self): |
| 368 | return 'Transform from "%s" to "%s"' % (self._srs1_name, self._srs2_name) |
no outgoing calls