feat: ndvi from stac#11
Conversation
adc243b to
a3db010
Compare
|
Habe ich einen gedanklichen Fehler, oder wäre die Config nicht [geoengine]
base_url = "https://geoengine.biois.app.geoengine.io/api"? Der Fehler ist
|
nö ist richtig. bei mir funktioniert es aber auch |
|
Vielleicht kannst du meinen User noch mal aus der DB löschen? Irgendwas muss ja falsch sein. |
| */ | ||
|
|
||
| import { PointGeoJsonInput } from '../models/PointGeoJsonInput'; | ||
| import { HttpFile } from '../http/http'; |
There was a problem hiding this comment.
Kann man den Bot davon abbringen im generierten Code missing imports zu suchen?
There was a problem hiding this comment.
geht glaube ich mit ner codeql.yml https://docs.github.com/en/code-security/reference/code-scanning/workflow-configuration-options
8a85906 to
46ae1af
Compare
|
|
||
| readonly processId: Signal<string | undefined>; | ||
|
|
||
| private readonly mockInputs: NDVIProcessOutputs = { |
There was a problem hiding this comment.
das ist ein Placeholder. s.u. warum das nicht mehr leer sein darf.
| processId: this.processId(), | ||
| }), | ||
| defaultValue: {}, | ||
| defaultValue: this.mockInputs, |
There was a problem hiding this comment.
Wieso kann das nicht erst einmal leer sein?
There was a problem hiding this comment.
bisher war alles optional. jetzt gibt es die input-Outputs (der Punkt für den NDVI berechnet werden soll) immer. daher ist ein leeres Objekt jetzt kein gültiges Result mehr.
| // Transform Results (with InlineOrRefData wrappers) to NDVIProcessOutputs | ||
| const outputs: NDVIProcessOutputs = { | ||
| ndvi: null, | ||
| kNdvi: null, | ||
| inputs: this.mockInputs.inputs, | ||
| }; | ||
|
|
||
| // Extract values from InlineOrRefData wrappers | ||
| if ('ndvi' in result) { | ||
| // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment | ||
| const ndviData = result['ndvi']; | ||
| outputs.ndvi = typeof ndviData === 'number' ? ndviData : null; | ||
| } | ||
| if ('kNdvi' in result) { | ||
| // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment | ||
| const kNdviData = result['kNdvi']; | ||
| outputs.kNdvi = typeof kNdviData === 'number' ? kNdviData : null; | ||
| } | ||
| if ('inputs' in result) { | ||
| // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment | ||
| const inputsData = result['inputs']; | ||
| // Extract the value from QualifiedInputValue wrapper | ||
| if (this.isQualifiedInputValue(inputsData) && inputsData.value) { | ||
| outputs.inputs = inputsData.value as typeof outputs.inputs; | ||
| } | ||
| } else { | ||
| throw new Error('Expected "inputs" in result but it was missing'); | ||
| } |
There was a problem hiding this comment.
wieso muss man das auf einmal so komisch auspacken?
There was a problem hiding this comment.
wenn man das result einfach so rausgeben versucht kommt dieser Fehler
✘ [ERROR] TS2322: Type 'ResourceRef<NDVIProcessOutputs | { [key: string]: any; }>' is not assignable to type 'ResourceRef<NDVIProcessOutputs>'.
Type 'NDVIProcessOutputs | { [key: string]: any; }' is not assignable to type 'NDVIProcessOutputs'.
Property ''inputs'' is missing in type '{ [key: string]: any; }' but required in type 'NDVIProcessOutputs'. [plugin angular-compiler]
src/app/result/result.component.ts:68:11:
68 │ readonly result: ResourceRef<NDVIProcessOutputs> = resource({
╵ ~~~~~~
''inputs'' is declared here.
../api-client/typescript/dist/models/NDVIProcessOutputs.d.ts:5:4:
5 │ 'inputs': NDVIProcessInputs;
╵ ~~~~~~~~
das Problem ist irgendwie dass dieses result hier:
const result = await api.results(params.processId);
so definiert ist:
export type Results = HttpFile | {
[key: string]: InlineOrRefData;
};
und da fehlt dann halt der Input-Output
warum ist das eigentlich nicht typisiert? Wir haben doch alles OpenAPi spezifiziert? Kannst du mir da helfen?
There was a problem hiding this comment.
habe hier noch mal versucht das etwas cleaner zu gestalten: cd116ed
| private isQualifiedInputValue(data: InlineOrRefData): data is QualifiedInputValue { | ||
| return typeof data === 'object' && data !== null && 'value' in data; | ||
| } |
There was a problem hiding this comment.
Was genau ist qualified?
There was a problem hiding this comment.
das ist von OGC API Processes. Der Input im Output ist ja ein Objekt:
BioIS/backend/src/processes/ndvi.rs
Line 87 in 46ae1af
ExecuteResults ist ein Feld entweder ein InputValueNoObject wenn es kein Object ist oder wenn es ein Object ist dann QualifiedInputValue? Vielleicht missverstehe ich das aber auch. Korrigier mich gerne.
No description provided.