gisserver.geometries module¶
Helper classes to handle geometry data types.
The bounding box can be calculated within Python, or read from a database result.
- class gisserver.geometries.BoundingBox(min_x: float, min_y: float, max_x: float, max_y: float, crs: CRS | None = None)¶
Bases:
objectA bounding box. Due to the overlap between 2 types, this element is used for 2 cases:
The
<ows:WGS84BoundingBox>element forGetCapabilities.The
<gml:Envelope>inside an<gml:boundedBy>single feature.
While both classes have no common base class (and exist in different schema’s), their properties are identical.
The X/Y coordinates can be either latitude or longitude, depending on the CRS.
Note this isn’t using the GDAL/OGR “Envelope” object, as that doesn’t expose the CRS, and requires constant copies to merge geometries.
- classmethod from_geometries(geometries: list[GEOSGeometry], crs: CRS) BoundingBox | None¶
Calculate the extent of a collection of geometries.
- class gisserver.geometries.WGS84BoundingBox(min_x: float, min_y: float, max_x: float, max_y: float)¶
Bases:
BoundingBoxThe
<ows:WGS84BoundingBox>element for theGetCapabilitieselement.This always has coordinates are always in longitude/latitude axis ordering, the CRS is fixed to
urn:ogc:def:crs:OGC:2:84.