diff --git a/fct/profiles/TalwegElevationProfile.py b/fct/profiles/TalwegElevationProfile.py index b036d70..ff07b02 100644 --- a/fct/profiles/TalwegElevationProfile.py +++ b/fct/profiles/TalwegElevationProfile.py @@ -15,15 +15,15 @@ from shapely.geometry import LineString, asShape import xarray as xr -from ..cli import starcall -from ..tileio import as_window -from ..config import ( +from fct.cli import starcall +from fct.tileio import as_window +from fct.config import ( DatasetParameter, LiteralParameter ) -from ..corridor.ValleyBottomFeatures import MASK_VALLEY_BOTTOM -from ..metadata import set_metadata -# from ..plotting.PlotCorridor import ( +from fct.corridor.ValleyBottomFeatures import MASK_VALLEY_BOTTOM +from fct.metadata import set_metadata +# from fct.plotting.PlotCorridor import ( # SetupPlot, # SetupMeasureAxis, # FinalizePlot @@ -152,7 +152,7 @@ def arguments(): with fiona.open(talweg_shapefile) as fs: for feature in fs: - axis = feature['properties']['AXIS'] + axis = int(feature['properties']['AXIS']) talweg = np.asarray(feature['geometry']['coordinates']) yield ( @@ -187,7 +187,7 @@ def TalwegElevation(params: Parameters, processes: int = 6, **kwargs) -> xr.Data with click.progressbar(fs) as iterator: for feature in iterator: - axis = feature['properties']['AXIS'] + axis = int(feature['properties']['AXIS']) talweg = np.asarray(feature['geometry']['coordinates']) axis_values = extract_talweg_data(axis, talweg, params) values.append(axis_values) diff --git a/fct/profiles/ValleyBottomElevationProfile.py b/fct/profiles/ValleyBottomElevationProfile.py index 0888f56..b14565c 100644 --- a/fct/profiles/ValleyBottomElevationProfile.py +++ b/fct/profiles/ValleyBottomElevationProfile.py @@ -10,8 +10,8 @@ from shapely.geometry import LineString import xarray as xr -from ..config import config, DatasetParameter -from .TalwegElevationProfile import ( +from fct.config import config, DatasetParameter +from fct.profiles.TalwegElevationProfile import ( Parameters as RefaxisParameters, TalwegElevation as RefaxisElevation ) diff --git a/tutorials/03-metrics/03-metrics.py b/tutorials/03-metrics/03-metrics.py index e9d1bbf..bbd4275 100644 --- a/tutorials/03-metrics/03-metrics.py +++ b/tutorials/03-metrics/03-metrics.py @@ -56,6 +56,7 @@ params = ValleyBottomHeight.Parameters() params.talweg = dict(key='metrics_refaxis_points', tiled=False, subdir='NETWORK/METRICS') params.measure = 'medialaxis_measure' +params.nearest = 'medialaxis_nearest' river_profile = ValleyBottomHeight.ValleyBottomHeight(swath_bounds=swath_bounds, params=params, processes=p) river_profile.to_netcdf(f'{config.workdir}/NETWORK/METRICS/HEIGHT_FLOODPLAIN.nc')