refactor: specify burgs fixes

This commit is contained in:
max 2022-08-07 00:31:59 +03:00
parent 7f57c9af65
commit 8c741a559e
6 changed files with 34 additions and 19 deletions

View file

@ -58,10 +58,10 @@ export const mergeLakeData = function (
const lake = lakeData.find(lake => lake.i === feature.i);
if (!lake) return feature;
const {firstCell, height, flux, temp, evaporation} = lake;
const {firstCell, height, flux, temp, evaporation, cells} = lake;
const inlets = lake.inlets?.filter(inlet => rivers.find(river => river.i === inlet));
const outlet = rivers.find(river => river.i === lake.outlet)?.i;
const group = defineLakeGroup({firstCell, height, flux, temp, evaporation, inlets, outlet});
const group = defineLakeGroup({firstCell, height, flux, temp, evaporation, cells, inlets, outlet});
const lakeFeature: IPackFeatureLake = {...feature, flux, temp, evaporation, inlets, outlet, group};
if (!inlets || !inlets.length) delete lakeFeature.inlets;
@ -79,6 +79,7 @@ function defineLakeGroup({
flux,
temp,
evaporation,
cells,
inlets,
outlet
}: {
@ -87,6 +88,7 @@ function defineLakeGroup({
flux: number;
temp: number;
evaporation: number;
cells: number;
inlets?: number[];
outlet?: number;
}): IPackFeatureLake["group"] {