utils.CoordinateTransformer.polygon_from_local_coords#
- CoordinateTransformer.polygon_from_local_coords(polygon: Polygon) Polygon#
Transform polygon from local coordinates to geographic coordinates.
- Parameters:
polygon – Shapely polygon.
- Returns:
x – Shapely polygon in geographic coordinates.
Examples
>>> from seismostats.utils import CoordinateTransformer >>> from shapely.geometry import Polygon
>>> ref_easting = 2642690 >>> ref_northing = 1205590 >>> ct = CoordinateTransformer(2056, ref_easting, ref_northing) >>> polygon = Polygon([(0, 0), (0, 111000), (111000, 111000)]) >>> external_polygon = ct.polygon_from_local_coords(polygon) >>> x, y = external_polygon.exterior.xy >>> x array('d', [7.999928695956813, 8.010557432492037, 9.497252799712923, 7.999928695956813]) >>> y array('d', [46.99999566074669, 47.99827972304315, 47.98154598785103, 46.99999566074669])