map2loop.utils.rebuild_sampled_basal_contacts#
- map2loop.utils.rebuild_sampled_basal_contacts(basal_contacts: GeoDataFrame, sampled_contacts: DataFrame) GeoDataFrame #
Rebuilds the basal contacts as linestrings –> sampled_basal_contacts, based on the existing sampled contact points. The rebuild process uses the featureId column in the sampled_contacts DataFrame to find contacts that may be represented as multiline geometries.
- Parameters:
basal_contacts (geopandas.GeoDataFrame) – A GeoDataFrame containing the original basal contacts (based on full contact data).
sampled_contacts (DataFrame) – A DataFrame containing the sampled contact points with columns ‘X’ and ‘Y’ for coordinates, ‘featureId’ for segment number, and ‘ID’.
- Returns:
geopandas.GeoDataFrame – A new GeoDataFrame containing sampled_basal_contacts: unique basal units and their corresponding LineString or MultiLineString geometries, rebuilt from the sampled_contacts.