class documentation

class IShape(Protocol): (source)

Known subclasses: gws.base.shape.Shape

View In Hierarchy

Geo-referenced geometry.

Method area Computes the area of the geometry.
Method bounds Returns a Bounds object that bounds this shape.
Method centroid Returns a centroid as a Point shape.
Method contains Returns True if this shape contains the other.
Method covered_by Returns True if this shape is covered by the other.
Method covers Returns True if this shape covers the other.
Method crosses Returns True if this shape crosses the other.
Method disjoint Returns True if this shape does not intersect with the other.
Method equals Returns True if this shape is equal to the other.
Method intersection Computes an intersection of this shape and other shapes.
Method intersects Returns True if this shape intersects with the other.
Method is_empty Returns True if this shape is empty.
Method is_ring Returns True if this shape is a ring.
Method is_simple Returns True if this shape is 'simple'.
Method is_valid Returns True if this shape is valid.
Method overlaps Returns True if this shape overlaps the other.
Method to_ewkb Returns an EWKB representation of this shape as a binary string.
Method to_ewkb_hex Returns an EWKB representation of this shape as a hex string.
Method to_ewkt Returns an EWKT representation of this shape.
Method to_geojson Returns a GeoJSON representation of this shape.
Method to_multi Converts a singly-geometry shape to a multi-geometry one.
Method to_props Returns a GeoJSON representation of this shape.
Method to_type Converts a geometry to another type.
Method to_wkb Returns a WKB representation of this shape as a binary string.
Method to_wkb_hex Returns a WKB representation of this shape as a hex string.
Method to_wkt Returns a WKT representation of this shape.
Method tolerance_polygon Builds a buffer polygon around the shape.
Method touches Returns True if this shape touches the other.
Method transformed_to Returns this shape transformed to another CRS.
Method union Computes a union of this shape and other shapes.
Method within Returns True if this shape is within the other.
Class Variable crs CRS of this shape.
Class Variable type Geometry type.
Class Variable x X-coordinate for Point geometries, None otherwise.
Class Variable y Y-coordinate for Point geometries, None otherwise.
def area(self) -> float: (source)
overridden in gws.base.shape.Shape

Computes the area of the geometry.

def bounds(self) -> Bounds: (source)
overridden in gws.base.shape.Shape

Returns a Bounds object that bounds this shape.

def centroid(self) -> IShape: (source)
overridden in gws.base.shape.Shape

Returns a centroid as a Point shape.

def contains(self, other: IShape) -> bool: (source)
overridden in gws.base.shape.Shape

Returns True if this shape contains the other.

def covered_by(self, other: IShape) -> bool: (source)
overridden in gws.base.shape.Shape

Returns True if this shape is covered by the other.

def covers(self, other: IShape) -> bool: (source)
overridden in gws.base.shape.Shape

Returns True if this shape covers the other.

def crosses(self, other: IShape) -> bool: (source)
overridden in gws.base.shape.Shape

Returns True if this shape crosses the other.

def disjoint(self, other: IShape) -> bool: (source)
overridden in gws.base.shape.Shape

Returns True if this shape does not intersect with the other.

def equals(self, other: IShape) -> bool: (source)
overridden in gws.base.shape.Shape

Returns True if this shape is equal to the other.

def intersection(self, *others: IShape) -> IShape: (source)
overridden in gws.base.shape.Shape

Computes an intersection of this shape and other shapes.

def intersects(self, other: IShape) -> bool: (source)
overridden in gws.base.shape.Shape

Returns True if this shape intersects with the other.

def is_empty(self) -> bool: (source)
overridden in gws.base.shape.Shape

Returns True if this shape is empty.

def is_ring(self) -> bool: (source)
overridden in gws.base.shape.Shape

Returns True if this shape is a ring.

def is_simple(self) -> bool: (source)
overridden in gws.base.shape.Shape

Returns True if this shape is 'simple'.

def is_valid(self) -> bool: (source)
overridden in gws.base.shape.Shape

Returns True if this shape is valid.

def overlaps(self, other: IShape) -> bool: (source)
overridden in gws.base.shape.Shape

Returns True if this shape overlaps the other.

def to_ewkb(self) -> bytes: (source)
overridden in gws.base.shape.Shape

Returns an EWKB representation of this shape as a binary string.

def to_ewkb_hex(self) -> str: (source)
overridden in gws.base.shape.Shape

Returns an EWKB representation of this shape as a hex string.

def to_ewkt(self) -> str: (source)
overridden in gws.base.shape.Shape

Returns an EWKT representation of this shape.

def to_geojson(self, always_xy=False) -> dict: (source)
overridden in gws.base.shape.Shape

Returns a GeoJSON representation of this shape.

def to_multi(self) -> IShape: (source)
overridden in gws.base.shape.Shape

Converts a singly-geometry shape to a multi-geometry one.

def to_props(self) -> ShapeProps: (source)
overridden in gws.base.shape.Shape

Returns a GeoJSON representation of this shape.

def to_type(self, new_type: GeometryType) -> IShape: (source)
overridden in gws.base.shape.Shape

Converts a geometry to another type.

def to_wkb(self) -> bytes: (source)
overridden in gws.base.shape.Shape

Returns a WKB representation of this shape as a binary string.

def to_wkb_hex(self) -> str: (source)
overridden in gws.base.shape.Shape

Returns a WKB representation of this shape as a hex string.

def to_wkt(self) -> str: (source)
overridden in gws.base.shape.Shape

Returns a WKT representation of this shape.

def tolerance_polygon(self, tolerance, quad_segs=None) -> IShape: (source)
overridden in gws.base.shape.Shape

Builds a buffer polygon around the shape.

def touches(self, other: IShape) -> bool: (source)
overridden in gws.base.shape.Shape

Returns True if this shape touches the other.

def transformed_to(self, crs: ICrs) -> IShape: (source)
overridden in gws.base.shape.Shape

Returns this shape transformed to another CRS.

def union(self, others: list[IShape]) -> IShape: (source)
overridden in gws.base.shape.Shape

Computes a union of this shape and other shapes.

def within(self, other: IShape) -> bool: (source)
overridden in gws.base.shape.Shape

Returns True if this shape is within the other.

overridden in gws.base.shape.Shape

CRS of this shape.

overridden in gws.base.shape.Shape

Geometry type.

x: Optional[float] = (source)
overridden in gws.base.shape.Shape

X-coordinate for Point geometries, None otherwise.

y: Optional[float] = (source)
overridden in gws.base.shape.Shape

Y-coordinate for Point geometries, None otherwise.