cars.core.roi_tools
This module contains tools for ROI
Module Contents
Functions
Generate ROI polygon from roi inputs |
|
|
Resample input polygon to given resolution. |
|
Transform Geojson dict to Shapely polygon |
|
Parse ROI file argument and generate bounding box |
|
Convert bounds to polygon |
- cars.core.roi_tools.generate_roi_poly_from_inputs(roi)[source]
Generate ROI polygon from roi inputs
- Parameters
roi (str Or GeoJson Dict) – roi file path or Geojson
:return polygon, polygon epsg :rtype: Tuple(Shapely Polygon, int)
- cars.core.roi_tools.resample_polygon(roi_poly, roi_epsg, resolution=100)[source]
Resample input polygon to given resolution. No interpolation is applied.
- Parameters
roi_poly (Shapely Polygon or MultiPolygon) – input polygon or multipolygon
roi_epsg (int) – roi epsg
resolution (float) – resolution in meter to resample to
- Returns
resampled polygon
- Return type
Shapely Polygon or MultiPolygon
- cars.core.roi_tools.geojson_to_shapely(geojson_dict: dict)[source]
Transform Geojson dict to Shapely polygon
- Parameters
geojson_dict (dict) – geojson
- Returns
shapely polygon
- Return type
Shapely Polygon