ExtendedGeoDataFrame

ExtendedGeoDataFrame(
    validation_schema=None,
    geotype=None,
    layer_name='',
    required_columns=None,
    logger=logging,
    *args,
    **kwargs,
)

A GeoPandas GeoDataFrame with extended properties and methods.

Methods

Name Description
copy Make a copy of this ExtendedGeoDataFrame object’s indices and data.
delete_all Empty the dataframe
set_data Set data to the ExtendedGeoDataFrame.
snap_to_branch Snap the geometries to the branch.

copy

ExtendedGeoDataFrame.copy(deep=True)

Make a copy of this ExtendedGeoDataFrame object’s indices and data.

This method overrides the default copy method to properly handle the custom constructor parameters required by ExtendedGeoDataFrame.

Parameters

Name Type Description Default
deep bool Make a deep copy, including a copy of the data and the indices. With deep=False neither the indices nor the data are copied. True

Returns

Name Type Description
ExtendedGeoDataFrame Copy of ExtendedGeoDataFrame.

delete_all

ExtendedGeoDataFrame.delete_all()

Empty the dataframe

set_data

ExtendedGeoDataFrame.set_data(
    gdf,
    layer='',
    index_col=None,
    check_columns=True,
    check_geotype=True,
    extra_attributes={},
)

Set data to the ExtendedGeoDataFrame.

Parameters

Name Type Description Default
gdf GeoDataFrame GeoDataFrame with a HyDAMO object-layer required
index_col str Column to be used as index. The default is None. None
check_columns bool Check if all required columns are present in the GeoDataFrame. The default is True. True
check_geotype bool Check if the geometry is of the required type. The default is True. True

Returns

Name Type Description
None.

snap_to_branch

ExtendedGeoDataFrame.snap_to_branch(branches, snap_method, maxdist=5)

Snap the geometries to the branch.

Parameters

Name Type Description Default
branches GeoDataFrame GeoDataFrame with branches required
snap_method str Options for snapping required
maxdist float The maximal distance for snapping. The default is 5. 5

Returns

Name Type Description
None.