Skip to content

feat: ndvi from stac#11

Open
michaelmattig wants to merge 11 commits intomainfrom
ndvi-stac
Open

feat: ndvi from stac#11
michaelmattig wants to merge 11 commits intomainfrom
ndvi-stac

Conversation

@michaelmattig
Copy link
Copy Markdown
Contributor

No description provided.

@michaelmattig michaelmattig changed the title ndvi from stac feat: ndvi from stac Mar 20, 2026
@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Mar 20, 2026

Coverage Status

coverage: 80.578% (+0.7%) from 79.899% — ndvi-stac into main

@ChristianBeilschmidt
Copy link
Copy Markdown
Member

ChristianBeilschmidt commented Mar 20, 2026

Habe ich einen gedanklichen Fehler, oder wäre die Config nicht

[geoengine]
base_url = "https://geoengine.biois.app.geoengine.io/api"

?

Der Fehler ist

2026-03-20T16:16:45.406573Z ERROR ogcapi_services::error: Generic error: Failed to perform OIDC login

Caused by:
error in response: status code 400 Bad Request

2026-03-20T16:16:45.406993Z ERROR tower_http::trace::on_failure: response failed, classification: Status code: 500 Internal Server Error, latency: 48 ms
at /home/beilschmidt/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tower-http-0.6.8/src/trace/on_failure.rs:93
in tower_http::trace::make_span::request with method: POST, uri: /auth/accessTokenLogin?redirectUri=http%3A%2F%2Flocalhost%3A4200%2Fapp%2Fsignin, version: HTTP/1.1

@michaelmattig
Copy link
Copy Markdown
Contributor Author

Habe ich einen gedanklichen Fehler, oder wäre die Config nicht

[geoengine]
base_url = "https://geoengine.biois.app.geoengine.io/api"

?

Der Fehler ist

2026-03-20T16:16:45.406573Z ERROR ogcapi_services::error: Generic error: Failed to perform OIDC login

Caused by:
error in response: status code 400 Bad Request

2026-03-20T16:16:45.406993Z ERROR tower_http::trace::on_failure: response failed, classification: Status code: 500 Internal Server Error, latency: 48 ms
at /home/beilschmidt/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tower-http-0.6.8/src/trace/on_failure.rs:93
in tower_http::trace::make_span::request with method: POST, uri: /auth/accessTokenLogin?redirectUri=http%3A%2F%2Flocalhost%3A4200%2Fapp%2Fsignin, version: HTTP/1.1

nö ist richtig. bei mir funktioniert es aber auch

@ChristianBeilschmidt
Copy link
Copy Markdown
Member

Vielleicht kannst du meinen User noch mal aus der DB löschen? Irgendwas muss ja falsch sein.

Comment thread backend/src/util.rs
Comment thread backend/src/util.rs
Comment thread backend/src/util.rs
Comment thread backend/src/processes/ndvi.rs
Comment thread backend/src/processes/ndvi.rs
Comment thread backend/Cargo.toml Outdated
*/

import { PointGeoJsonInput } from '../models/PointGeoJsonInput';
import { HttpFile } from '../http/http';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kann man den Bot davon abbringen im generierten Code missing imports zu suchen?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread api-client/typescript/models/HabitatDistanceProcessOutputs.ts Dismissed
Comment thread api-client/typescript/models/HabitatDistanceProcessParams.ts Dismissed
Comment thread api-client/typescript/types/ObjectParamAPI.ts Dismissed
Comment thread api-client/typescript/types/PromiseAPI.ts Dismissed
Comment thread api-client/typescript/types/ObservableAPI.ts Dismissed
Comment thread backend/src/processes/ndvi.rs Outdated

readonly processId: Signal<string | undefined>;

private readonly mockInputs: NDVIProcessOutputs = {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wieso mock?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

das ist ein Placeholder. s.u. warum das nicht mehr leer sein darf.

processId: this.processId(),
}),
defaultValue: {},
defaultValue: this.mockInputs,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wieso kann das nicht erst einmal leer sein?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +83 to +110
// 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');
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wieso muss man das auf einmal so komisch auspacken?

Copy link
Copy Markdown
Contributor Author

@michaelmattig michaelmattig Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

habe hier noch mal versucht das etwas cleaner zu gestalten: cd116ed

Comment on lines +139 to +141
private isQualifiedInputValue(data: InlineOrRefData): data is QualifiedInputValue {
return typeof data === 'object' && data !== null && 'value' in data;
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was genau ist qualified?

Copy link
Copy Markdown
Contributor Author

@michaelmattig michaelmattig Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

das ist von OGC API Processes. Der Input im Output ist ja ein Objekt:

data: InlineOrRefData::QualifiedInputValue(QualifiedInputValue {
. Und in den OGC 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants