
from geogst.core.geometries.shapes.shape import Shape


class GeoShape:
    """Una Shape con un CRS associato. Delega la geometria alla shape avvolta."""

    def __init__(self, shape: Shape, crs: Crs = None):
        self._shape = shape
        self._crs = crs if crs is not None else Crs()

    @property
    def shape(self) -> Shape:
        return self._shape

    @property
    def crs(self) -> Crs:
        return self._crs

    # geometria delegata
    def area(self):
        return self._shape.area()

    def length(self):
        return self._shape.length()

    def bounding_box(self):
        return self._shape.bounding_box()

    def clone(self) -> "GeoShape":
        return GeoShape(self._shape.clone(), self._crs)

    @property
    def dimension(self) -> numbers.Integral:
        return self._shape.dimension