draw

Draw geometries as SVG elements

svgis.draw.geometry(geom, bbox=None, precision=None, **kwargs)

Draw a geometry. Will return either a single geometry or a group.

Parameters:
  • geom (object) – A GeoJSON-like geometry object. Coordinates must be 2-dimensional.
  • bbox (tuple) – An optional bounding minimum bounding box
  • precision (int) – Rounding precision, must be 0 or greater (default: no rounding).
  • kwargs (object) – keyword args to be passed onto the created elements (e.g. class, id, style).
Returns:

str (unicode in Python 2) representation of SVG element(s) of the given geometry.

svgis.draw.group(geometries, **kwargs)

Add a list of geometries to a group.

Parameters:geometries (Sequence) – GeoJSON-like geometry dicts.
Returns:str (unicode in Python 2) representation of the SVG group
svgis.draw.lines(geom, **kwargs)

Draw a LineString or MultiLineString geometry.

Parameters:geom (object) – A GeoJSON-like LineString or MultiLineString geometry object.
Returns:str (unicode in Python 2) representation of the SVG group or polyline element(s).
svgis.draw.points(geom, **kwargs)

Draw a Point or MultiPoint geometry

Parameters:geom (object) – A GeoJSON-like Point or MultiPoint geometry object.
Returns:str (unicode in Python 2) representation of the SVG group, or circle element
svgis.draw.polygons(geom, **kwargs)

Draw polygon(s) in a feature. transform is a function to operate on coords. Draws first ring clockwise, and subsequent ones counter-clockwise.

Parameters:geom (object) – A GeoJSON-like Polygon or MultiPolygon geometry object.
Returns:str (unicode in Python 2) representation of the SVG group, path or polygon element.