diff --git a/clip_RequiredData.py b/clip_RequiredData.py index 75d4b20915d1ce6d09375adf3d0adff6ae922329..cbb5a93925704da93e629c4e1b4d58998fa07fde 100644 --- a/clip_RequiredData.py +++ b/clip_RequiredData.py @@ -35,6 +35,13 @@ shp_foldername = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/GEO shp_watersheds = gpd.read_file(shp_watersheds_path) +## TOPO + +# BDAlti 25m +BDAlti_map_path = 'C:/Users/laura.lindeperg/Documents/DonneesLaura/BDAlti_25m/France_BDAlti_25m.tif' +BDAlti_map = rxr.open_rasterio(BDAlti_map_path).squeeze() + + ## GEOMORPHO # BDTopage @@ -168,6 +175,18 @@ code_for_test = watershed_code.loc[0:3] # code_for_test = ['J4742020'] + +for i in code_for_test: +# for i in watershed_code: + + ## Get shp + shp_contour_i = gpd.read_file(shp_foldername+i+'.shp') + + + raster_BDAlti = BDAlti_map.rio.clip(shp_contour_i.geometry.apply(mapping), shp_contour_i.crs) + raster_BDAlti.rio.to_raster('C:/Users/laura.lindeperg/Documents/DonneesLaura/Watersheds/TOPO/BDAlti_25m/'+i+'_BDAlti.tif') + + ## Soil hydraulic properties # for i in code_for_test: