:tocdepth: 3 :py:mod:`gws.gis.crs` ===================== .. py:module:: gws.gis.crs **Source code:** :source:`gws.gis.crs` Package Contents ---------------- .. py:function:: best_axis(crs: gws.Crs, protocol: gws.OwsProtocol = None, protocol_version: str = None, crs_format: gws.CrsFormat = None, inverted_crs: Optional[list[gws.Crs]] = None) -> gws.Axis Return the 'best guess' axis under given circumstances. :param crs: target CRS :param protocol: OWS protocol (WMS, WFS...) :param protocol_version: protocol version :param crs_format: the format the target_crs was obtained from :param inverted_crs: user-provided list of CRSes known to have an inverted (YX) axis :returns: An axis .. py:function:: best_bounds(crs: gws.Crs, supported_bounds: list[gws.Bounds]) -> gws.Bounds Return the best one from the list of supported bounds. :param crs: target CRS :param supported_bounds: Bounds list :returns: A Bounds object .. py:function:: best_match(crs: gws.Crs, supported_crs: list[gws.Crs]) -> gws.Crs Return a crs from the list that most closely matches the given crs. :param crs: target CRS :param supported_crs: CRS list :returns: A CRS object .. py:exception:: Error Bases: :py:obj:`gws.Error` GWS error. .. py:function:: get(crs_name: gws.CrsName) -> Optional[gws.Crs] Returns the CRS for a given CRS-code or SRID. .. py:class:: Object(**kwargs) Bases: :py:obj:`gws.Crs` Coordinate reference system. .. py:method:: axis_for_format(fmt) Get the axis depending on the string format. We adhere to the GeoServer convention here: https://docs.geoserver.org/latest/en/user/services/wfs/axis_order.html .. py:method:: to_geojson() Return a geojson representation of the CRS (as per GJ2008). :returns: A GeoJson dict. .. rubric:: References https://geojson.org/geojson-spec#named-crs .. py:method:: to_string(fmt=None) Return a string representation of the CRS. :param fmt: Format to use. :returns: A string. .. py:method:: transform_extent(ext, crs_to) Transform an Extent from this CRS to another. :param extent: Extent. :param crs_to: Target CRS. :returns: A transformed Extent. .. py:method:: transformer(crs_to) Create a transformer function to another CRS. :param crs_to: Target CRS. :returns: A function. .. py:function:: parse(crs_name: gws.CrsName) -> tuple[gws.CrsFormat, Optional[gws.Crs]] Parses a CRS to a tuple of CRS-format and the CRS itself. .. py:function:: require(crs_name: gws.CrsName) -> gws.Crs Raises an error if no correct CRS is given. .. py:data:: WEBMERCATOR .. py:data:: WEBMERCATOR_RADIUS :value: 6378137 .. py:data:: WEBMERCATOR_SQUARE .. py:data:: WGS84