Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prerelease wuekis sprint #76

Merged
merged 21 commits into from
Mar 25, 2021
Merged

Prerelease wuekis sprint #76

merged 21 commits into from
Mar 25, 2021

Conversation

MichaelLangbein
Copy link
Collaborator

@MichaelLangbein MichaelLangbein commented Mar 24, 2021

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: 73

What is the new behavior?

This is a PR to merge in our latest developments during the WUEKIS sprint.
As such, against usual procedure, this PR actually bundles two changes:

  • update to WmsService, including the functionality getLayerFromCapabilities and getTimeDimensionFromLayer that were already developed earlier.
  • update to owc-json and map-ol to read WFS-layers from files and display them in ol-maps.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Is it part of one/more packages and which?

@@ -953,7 +996,7 @@ export class MapOlService {
}

if (l.bbox) {
layeroptions.extent = transformExtent(l.bbox, WGS84, this.map.getView().getProjection().getCode());
layeroptions.extent = transformExtent(l.bbox.slice(0, 4) as [number, number, number, number], WGS84, this.map.getView().getProjection().getCode());
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to slice all bboxes? I think GeoJSON can handle 3D bboxes https://tools.ietf.org/html/rfc7946#section-5

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You'd think so, right?
But when I include map-ol in a ukis-project (as we currently do in WUEKIS) and try to serve the app, I get

ERROR in projects/map-ol/src/lib/map-ol.service.ts:706:45 - error TS2345: Argument of type 'TGeoExtent' is not assignable to parameter of type 'Extent'.
  Type '[number, number, number, number, number, number]' is not assignable to type '[number, number, number, number]'.
    Types of property 'length' are incompatible.
      Type '6' is not assignable to type '4'.

706       layeroptions.extent = transformExtent(l.bbox, WGS84, this.map.getView().getProjection().getCode());

Copy link
Member

Choose a reason for hiding this comment

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

I never had this error but your right, ol extent only accepts for numbers.

@boeckMt
Copy link
Member

boeckMt commented Mar 25, 2021

Can you please add @angular/core to the devDependencies of utils-ogc because it is used in the tests.

@boeckMt
Copy link
Member

boeckMt commented Mar 25, 2021

I also recognised that we get a build error https://github.com/dlr-eoc/ukis-frontend-libraries/actions/runs/683627826
and @dlr-eoc/owc-control is not build, but I don't can find the reason now.

Building entry point '@dlr-eoc/owc-control'
------------------------------------------------------------------------------
Compiling TypeScript sources through ngc
ERROR: dist/services-ogc/lib/owc/owc-json.service.d.ts:70:88 - error TS2307: Cannot find module '../../../../../dist/services-layers/dlr-eoc-services-layers' or its corresponding type declarations.

70     getTimeDimensions(dimensions: IEocOwsResource['properties']['dimensions']): import("../../../../../dist/services-layers/dlr-eoc-services-layers").ILayerTimeDimension;
                                                                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

An unhandled exception occurred: dist/services-ogc/lib/owc/owc-json.service.d.ts:70:88 - error TS2307: Cannot find module '../../../../../dist/services-layers/dlr-eoc-services-layers' or its corresponding type declarations.

70     getTimeDimensions(dimensions: IEocOwsResource['properties']['dimensions']): import("../../../../../dist/services-layers/dlr-eoc-services-layers").ILayerTimeDimension;
                                                                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

See "C:\Users\boec_mt\AppData\Local\Temp\ng-L5lsrK\angular-errors.log" for further details.

@boeckMt boeckMt mentioned this pull request Mar 25, 2021
14 tasks
@MichaelLangbein
Copy link
Collaborator Author

I also recognised that we get a build error https://github.com/dlr-eoc/ukis-frontend-libraries/actions/runs/683627826
and @dlr-eoc/owc-control is not build, but I don't can find the reason now.

Building entry point '@dlr-eoc/owc-control'
------------------------------------------------------------------------------
Compiling TypeScript sources through ngc
ERROR: dist/services-ogc/lib/owc/owc-json.service.d.ts:70:88 - error TS2307: Cannot find module '../../../../../dist/services-layers/dlr-eoc-services-layers' or its corresponding type declarations.

70     getTimeDimensions(dimensions: IEocOwsResource['properties']['dimensions']): import("../../../../../dist/services-layers/dlr-eoc-services-layers").ILayerTimeDimension;
                                                                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

An unhandled exception occurred: dist/services-ogc/lib/owc/owc-json.service.d.ts:70:88 - error TS2307: Cannot find module '../../../../../dist/services-layers/dlr-eoc-services-layers' or its corresponding type declarations.

70     getTimeDimensions(dimensions: IEocOwsResource['properties']['dimensions']): import("../../../../../dist/services-layers/dlr-eoc-services-layers").ILayerTimeDimension;
                                                                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

See "C:\Users\boec_mt\AppData\Local\Temp\ng-L5lsrK\angular-errors.log" for further details.

Oh, that's really interesting!
Turns out adding a type annotation to owc-json.service.getTimeDimensions fixes this error. Cannot quite tell why, however.

@boeckMt
Copy link
Member

boeckMt commented Mar 25, 2021

I also recognised that we get a build error https://github.com/dlr-eoc/ukis-frontend-libraries/actions/runs/683627826
and @dlr-eoc/owc-control is not build, but I don't can find the reason now.

Building entry point '@dlr-eoc/owc-control'
------------------------------------------------------------------------------
Compiling TypeScript sources through ngc
ERROR: dist/services-ogc/lib/owc/owc-json.service.d.ts:70:88 - error TS2307: Cannot find module '../../../../../dist/services-layers/dlr-eoc-services-layers' or its corresponding type declarations.

70     getTimeDimensions(dimensions: IEocOwsResource['properties']['dimensions']): import("../../../../../dist/services-layers/dlr-eoc-services-layers").ILayerTimeDimension;
                                                                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

An unhandled exception occurred: dist/services-ogc/lib/owc/owc-json.service.d.ts:70:88 - error TS2307: Cannot find module '../../../../../dist/services-layers/dlr-eoc-services-layers' or its corresponding type declarations.

70     getTimeDimensions(dimensions: IEocOwsResource['properties']['dimensions']): import("../../../../../dist/services-layers/dlr-eoc-services-layers").ILayerTimeDimension;
                                                                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

See "C:\Users\boec_mt\AppData\Local\Temp\ng-L5lsrK\angular-errors.log" for further details.

Oh, that's really interesting!
Turns out adding a type annotation to owc-json.service.getTimeDimensions fixes this error. Cannot quite tell why, however.

That is really strange, I thought more it is a wrong Import or missing configuration on ng-package.json

@MichaelLangbein
Copy link
Collaborator Author

I also recognised that we get a build error https://github.com/dlr-eoc/ukis-frontend-libraries/actions/runs/683627826
and @dlr-eoc/owc-control is not build, but I don't can find the reason now.

Building entry point '@dlr-eoc/owc-control'
------------------------------------------------------------------------------
Compiling TypeScript sources through ngc
ERROR: dist/services-ogc/lib/owc/owc-json.service.d.ts:70:88 - error TS2307: Cannot find module '../../../../../dist/services-layers/dlr-eoc-services-layers' or its corresponding type declarations.

70     getTimeDimensions(dimensions: IEocOwsResource['properties']['dimensions']): import("../../../../../dist/services-layers/dlr-eoc-services-layers").ILayerTimeDimension;
                                                                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

An unhandled exception occurred: dist/services-ogc/lib/owc/owc-json.service.d.ts:70:88 - error TS2307: Cannot find module '../../../../../dist/services-layers/dlr-eoc-services-layers' or its corresponding type declarations.

70     getTimeDimensions(dimensions: IEocOwsResource['properties']['dimensions']): import("../../../../../dist/services-layers/dlr-eoc-services-layers").ILayerTimeDimension;
                                                                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

See "C:\Users\boec_mt\AppData\Local\Temp\ng-L5lsrK\angular-errors.log" for further details.

Oh, that's really interesting!
Turns out adding a type annotation to owc-json.service.getTimeDimensions fixes this error. Cannot quite tell why, however.

That is really strange, I thought more it is a wrong Import or missing configuration on ng-package.json

Me too. scripts/library/index.js --check does not report an error, though, and vscode's typechecker doesn't, either.
Just as a side-note: I'm not really sure if we even still need that project owc-control. It doesn't do much besides facilitating a download for owc-files, and for downloading files by now we have dedicated functionality in utils-browser/download.ts, so there is very little of actual value left in this project. Maybe at some point we could remove it (but that is really not for this PR - more like a feature-request for a later version)

@boeckMt
Copy link
Member

boeckMt commented Mar 25, 2021

That is really strange, I thought more it is a wrong Import or missing configuration on ng-package.json

Me too. scripts/library/index.js --check does not report an error, though, and vscode's typechecker doesn't, either.
Just as a side-note: I'm not really sure if we even still need that project owc-control. It doesn't do much besides facilitating a > download for owc-files, and for downloading files by now we have dedicated functionality in utils-browser/download.ts, so there > is very little of actual value left in this project. Maybe at some point we could remove it (but that is really not for this PR - more > like a feature-request for a later version)

Yes I also checked this, and don't found type errors in the code...
Maybe we can try typescrips type-only-imports-and-export at some time for this?

Yes, if it is only a button which triggers the download and creates the layers, then we can remove it e.g. in v8.0.0.

@boeckMt boeckMt merged commit 49c552d into master Mar 25, 2021
@boeckMt boeckMt deleted the prereleaseWuekisSprint branch March 25, 2021 14:18
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.

2 participants