saferoad.saferoad module
- class saferoad.saferoad.PsData(filepath: str, latitude: str, longitude: str, unit: Literal['m', 'cm', 'mm'] = 'm', crs_code: str = 'EPSG:4326', name: str = 'pspoint')[source]
Bases:
objectClass for storing point source data information.
- Parameters:
filepath (str) – Path to the point source data file.
latitude (str) – Field name of the latitude field in the data file.
longitude (str) – Field name of the longitude field in the data file.
unit (Literal["m", "cm", "mm"]) – Unit of measurement for the coordinates. Options are “m”, “cm”, or “mm”. Default is “m”.
crs_code (str) – Coordinate Reference System code. Default is “EPSG:4326”.
name (str) – Name identifier for the point source data. Default is “pspoint”.
- crs_code: str = 'EPSG:4326'
- filepath: str
- latitude: str
- longitude: str
- name: str = 'pspoint'
- unit: Literal['m', 'cm', 'mm'] = 'm'
- class saferoad.saferoad.Road(filepath: str, crs_code: str = 'EPSG:4326', name: str = 'road')[source]
Bases:
objectClass for storing road data information.
- Parameters:
filepath (str) – Path to the road data file.
crs_code (str) – Coordinate Reference System code. Default is “EPSG:4326”.
name (str) – Name identifier for the road data. Default is “road”.
- crs_code: str = 'EPSG:4326'
- filepath: str
- name: str = 'road'
- class saferoad.saferoad.SafeRoad(road: Road, ps_data: PsData, computational_crs: str)[source]
Bases:
objectA class to perform road deformation analysis using MT-InSAR data.
- Parameters:
- generate_rectangles(road_width: float, segment_length: float)[source]
Generate road segments and patches.
This involves: 1. Splitting the road into segments of equal length. 2. Generating rectangles along the road segments with a specified width. 2. Rotating the generated rectangles int the same direction along the road.
- Parameters:
road_width – A float representing the width of the road segments in meters.
segment_length – A float representing the length of each road segment in meters.
- generate_report(output_name: str)[source]
Generate a PDF report containing maps and time series plots.
- Parameters:
output_name (str) – A string representing the name of the output PDF file endswith .pdf extension.
- preprocess(attribute: str | None = None)[source]
Preprocess the road and MT-InSAR data.
This includes transforming the data to the computational CRS, dissolving road features, and building geometries for the MT-InSAR points. 1. Transform the road and MT-InSAR data to the computational CRS. 2. Dissolve road features based on the provided attribute if given, otherwise merge all features. 3. Build geometries for the MT-InSAR points from the latitude and longitude columns. 4. Transform the MT-InSAR data to the computational CRS.
- Parameters:
attribute (str, optional) – An optional string representing the attribute to dissolve road features. If None, all features will be merged. Default is None.