save_rois#

movement.roi.save_rois(rois, file)[source]#

Save a collection of regions of interest (RoIs) to a GeoJSON file.

The RoIs are saved as a GeoJSON FeatureCollection, with each RoI represented as a Feature containing its geometry and properties (name and RoI type).

Parameters:

See also

load_rois

Load a collection of RoIs from a GeoJSON file.

Return type:

None

Examples

Create a polygon and a line, then save them to a GeoJSON file:

>>> from movement.roi import LineOfInterest, PolygonOfInterest, save_rois
>>> square = PolygonOfInterest(
...     [(0, 0), (1, 0), (1, 1), (0, 1)], name="square"
... )
>>> diagonal = LineOfInterest([(0, 0), (1, 1)], name="diagonal")
>>> save_rois([square, diagonal], "/path/to/rois.geojson")

Examples using save_rois#

Compute distances and angles to regions of interest

Compute distances and angles to regions of interest