gpf_entrepot_toolbelt.utils.geometry_utils module¶
Helper to manipulate WKT
- gpf_entrepot_toolbelt.utils.geometry_utils.get_wkt_srs(wkt: str) str | None ¶
Return the SRS of a WKT geometry
- Paramètres:
wkt (str) – WKT geometry
- Renvoie:
EPSG srs value
- Type renvoyé:
str
- gpf_entrepot_toolbelt.utils.geometry_utils.is_valid_wkt(wkt_string: str) bool ¶
- Paramètres:
wkt_string (str) – geométrie au format wkt
- Renvoie:
bool, true si le wkt est valide
- gpf_entrepot_toolbelt.utils.geometry_utils.simplify_extent(extent: BaseGeometry, tolerance: float = 0.0001, threshold: int | None = None, buffer_distance: float = 8.99e-06, max_iterations: int = 10) BaseGeometry ¶
- Paramètres:
extent (BaseGeometry) – geométrie à simplifier
tolerance (int) – tolerance pour la simplification de douglas/peucker
threshold (int | None) – nombre de points maximum pour la géométrie produite
buffer_distance (float) – paramètre de la fermeture morphologique (default 0.00000899 ≃ 1m en WGS84)
max_iterations (float) – nombre maximum d’itération avant arrêt du processus
- Renvoie:
BaseGeometry, géométrie simplifiée
- gpf_entrepot_toolbelt.utils.geometry_utils.transform_coords_to_4326(coords: list[float], source_srs: str) list[float] | None ¶
Convert coordinate pairs to 4326
- Paramètres:
coords (list[float]) – coordinate list, by pair (x, y)
source_srs (str) – source SRS
- Renvoie:
the converted coordinates list
- Type renvoyé:
list[float]