Open coroa opened 5 years ago
Mean river flow datasets usually report the upstream area as a quasi third coordinate, as explained for the EFAS dataset:
In EFAS, river discharge is calculated in each hydrological model grid box. However, not all grid boxes correspond to a river segments, and because of the relatively coarse resolution of the EFAS gridded domain, the modelled river network in EFAS might be associated with slightly different latitude-longitude than in the real world. It is hence essential that when extracting river discharge data, the user also checks the upstream area of the grid box of interest. Please look at the EFAS upstream area section on the left.
So the algorithm for locating the correct grid cell should be:
hydrobasins = gpd.read_file(".../hybas_eu_lev01-12_v1c/hybas_eu_lev12_v1c.shp")
upstream_area = gpd.sjoin(plants, hydrobasins[['UP_AREA', 'geometry']], how='left', op='within').UP_AREA