ValidROICollectionGeoJSON#

class movement.validators.files.ValidROICollectionGeoJSON(file)[source]#

Bases: object

Class for validating GeoJSON FeatureCollection files.

The validator ensures that the file:

  • is well-formed JSON.

  • conforms to the RoI Collection GeoJSON schema, which checks that the file contains a GeoJSON FeatureCollection containing movement-compatible regions of interest (as produced by save_rois()).

Additionally, it performs a custom validation step to ensure that each Feature’s roi_type property is consistent with its geometry type (e.g. “PolygonOfInterest” must have geometry type “Polygon”).

file#

Path to the GeoJSON file.

data#

Parsed JSON data from the file.

Raises:
  • ValueError – If the file is not valid JSON or does not match the expected schema.

  • TypeError – If roi_type property does not match the actual geometry type.

See also

movement.roi.save_rois

Save a collection of RoIs to a GeoJSON file.

movement.roi.load_rois

Load a collection of RoIs from a GeoJSON file.