gws.gis.gml.parser

GML geometry parsers.

Source code: gws.gis.gml.parser

Module Contents

exception gws.gis.gml.parser.Error

Bases: gws.Error

GWS error.

gws.gis.gml.parser.parse_envelope(el: gws.XmlElement, default_crs: gws.Crs = None, always_xy: bool = False) gws.Bounds

Parse a gml:Box/gml:Envelope element

Parameters:
  • el – A xml-Element.

  • default_crs – A Crs object.

  • always_xy – If True, coordinates are assumed to be in the XY (lon/lat) order.

Returns:

A Bounds object.

gws.gis.gml.parser.is_geometry_element(el: gws.XmlElement) bool

Checks if the current element is a valid geometry type.

Parameters:

el – A GML element.

Returns:

True if the element is a geometry type.

gws.gis.gml.parser.parse_shape(el: gws.XmlElement, default_crs: gws.Crs = None, always_xy: bool = False) gws.Shape

Convert a GML geometry element to a Shape.

Parameters:
  • el – A GML element.

  • default_crs – A Crs object.

  • always_xy – If True, coordinates are assumed to be in the XY (lon/lat) order.

Returns:

A GWS shape object.

gws.gis.gml.parser.parse_geometry(el: gws.XmlElement) dict

Convert a GML geometry element to a geometry dict.

Parameters:

el – A GML element.

Returns:

The GML geometry as a geometry dict.