environmentaltools.common.kmz
- environmentaltools.common.kmz(file_name: str, joint: bool = False)[source]
Read KMZ or KML files and extract elevation contour data.
Parses KMZ (zipped) or KML files to extract coordinate and elevation data from placemarks, with support for multiple elevation detection methods.
- Parameters:
file_name (str) – Path to KMZ or KML file.
joint (bool) – If True, combines all contours into single DataFrame. If False, returns separate lists for each contour. Defaults to False.
- Returns:
- If joint=True, returns DataFrame with columns [x, y, z].
If joint=False, returns tuple of lists (x, y, z) where each element corresponds to a separate contour line.
- Return type:
pd.DataFrame or tuple
- Raises:
SystemExit – If KML parsing fails or file structure is invalid.