zensvi.metadata.BaseMetadata¶
- class zensvi.metadata.BaseMetadata(path_input: str | pathlib.Path, log_path: str | pathlib.Path | None = None)¶
Base class to compute metadata for a street-view dataset.
Subclasses provide the input by overriding
_load_dataframe()and_normalize_columns()so thatself.dfexposes the normalized schema the compute methods expect:"id", "lat", "lon", "captured_at"(milliseconds since the Unix epoch),"compass_angle", "creator_id", "sequence_id", "organization_id", "is_pano".- Parameters:
path_input (Union[str, Path]) – path to the input CSV file.
- compute_metadata(unit: str = 'image', grid_resolution: int = 7, coverage_buffer: int = 50, indicator_list: str = 'all', path_output: str | pathlib.Path | None = None, max_distance: int = 50) pandas.DataFrame¶
Compute metadata for the dataset.
- Parameters:
unit (str) – The unit of analysis. Defaults to “image”.
grid_resolution (int) – The resolution of the H3 grid. Defaults to 7.
indicator_list (str) – List of indicators to compute metadata for. Use space- separated string of indicators or “all”. Options for image-level metadata: “year”, “month”, “day”, “hour”, “day_of_week”, “relative_angle”, “h3_id”, “speed_kmh”. Options for grid-level metadata: “coverage”, “count”, “days_elapsed”, “most_recent_date”, “oldest_date”, “number_of_years”, “number_of_months”, “number_of_days”, “number_of_hours”, “number_of_days_of_week”, “number_of_daytime”, “number_of_nighttime”, “number_of_spring”, “number_of_summer”, “number_of_autumn”, “number_of_winter”, “average_compass_angle”, “average_relative_angle”, “average_is_pano”, “number_of_users”, “number_of_sequences”, “number_of_organizations”, “average_speed_kmh”. Defaults to “all”.
path_output (Union[str, Path]) – Path to save the output metadata. Defaults to None.
max_distance (int) – The maximum distance to search for the nearest street segment. Defaults to 50.
- Returns:
A DataFrame containing the computed metadata.
- Return type:
pd.DataFrame