:tocdepth: 3 :py:mod:`gws.gis.gml` ===================== .. py:module:: gws.gis.gml .. autoapi-nested-parse:: GML support. GML documentation: https://www.ogc.org/standards/gml **Source code:** :source:`gws.gis.gml` Submodules ---------- .. toctree:: :titlesonly: :maxdepth: 1 parser/index.rst writer/index.rst Package Contents ---------------- .. py:function:: is_geometry_element(el: gws.XmlElement) -> bool Checks if the current element is a valid geometry type. :param el: A GML element. :returns: ``True`` if the element is a geometry type. .. py:function:: parse_envelope(el: gws.XmlElement, default_crs: gws.Crs = None, always_xy: bool = False) -> gws.Bounds Parse a gml:Box/gml:Envelope element :param el: A xml-Element. :param default_crs: A Crs object. :param always_xy: If ``True``, coordinates are assumed to be in the XY (lon/lat) order. :returns: A Bounds object. .. py:function:: parse_geometry(el: gws.XmlElement) -> dict Convert a GML geometry element to a geometry dict. :param el: A GML element. :returns: The GML geometry as a geometry dict. .. py:function:: parse_shape(el: gws.XmlElement, default_crs: gws.Crs = None, always_xy: bool = False) -> gws.Shape Convert a GML geometry element to a Shape. :param el: A GML element. :param default_crs: A Crs object. :param always_xy: If ``True``, coordinates are assumed to be in the XY (lon/lat) order. :returns: A GWS shape object. .. py:function:: shape_to_element(shape: gws.Shape, version: int = 3, coordinate_precision: Optional[int] = None, always_xy: bool = False, with_xmlns: bool = True, with_inline_xmlns: bool = False, namespace: Optional[gws.XmlNamespace] = None, crs_format: Optional[gws.CrsFormat] = None) -> gws.XmlElement Convert a Shape to a GML geometry element. :param shape: A Shape object. :param version: GML version (2 or 3). :param coordinate_precision: The amount of decimal places. :param always_xy: If ``True``, coordinates are assumed to be always in the XY (lon/lat) order. :param with_xmlns: If ``True`` add the "gml" namespace prefix. :param with_inline_xmlns: If ``True`` add inline "xmlns" attributes. :param namespace: Use this namespace (default "gml"). :param crs_format: Crs format to use (default "url" for version 2 and "urn" for version 3). :returns: A GML element.