windkit.snap_to_layer
- windkit.snap_to_layer(gdf, tolerance=0.1)[source]
Snaps the geometries in a GeoDataFrame to each other within a specified tolerance.
This function iterates over each geometry in the GeoDataFrame. For each geometry, it finds all other geometries that intersect it. It then snaps the geometry to each of the intersecting geometries within the specified tolerance.
- Parameters:
gdf (gpd.GeoDataFrame) – The GeoDataFrame containing the geometries to snap. The GeoDataFrame should contain a ‘geometry’ column with polygons.
tolerance (float, optional) – The tolerance within which to snap geometries, by default 10. This is the maximum distance that points can be moved in order to snap them to another geometry.
- Returns:
The GeoDataFrame with the snapped geometries.
- Return type:
GeoDataFrame