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

Backend: Add an endpoint that verifies Hajk layers against their respective service #1227

Closed
jacobwod opened this issue Oct 31, 2022 · 4 comments
Assignees
Labels
module:backend MapService stuff
Milestone

Comments

@jacobwod
Copy link
Member

As a Hajk setup grows, it can easily consist of thousands of Hajk layers (layers defined in layers.json). Over time, it because impossible to keep track of each layer individually.

The respective service (WMS, WFS, etc) can move the layer to another workspace, rename it or just become unavailable. All these situations will lead to Hajk Client having problem when loading maps with layers that do not exist where they are expected.

To ensure a high quality of services provided by Hajk, Backend could be extended with an endpoint that checks each layer's existence. The exact implementation will vary, but the main idea is to:

  1. loop each of the defined layers
  2. group them together depending on source
  3. ask each source for a list of available layers (usually GetCapabilities)
  4. compare the response from source with what we have in layers.json
  5. mark diff layers as missing and return with the response
@jacobwod jacobwod added the module:backend MapService stuff label Oct 31, 2022
@jacobwod jacobwod added this to the 3.x milestone Oct 31, 2022
@jacobwod jacobwod self-assigned this Oct 31, 2022
@jacobwod
Copy link
Member Author

I've committed a first implementation.

I've already found some cases where we run into trouble. In this screenshot there are two layers (id 0 and 1) that have different names. But inside those layers there are more layers where names are seemingly duplicates (e.g. 2019 and 2020).

I'm writing this as a note to check it out further and see how we can distinguish between them. Simple recursive algorithm can't be enough as the two 2019/2020 sublayers are different, despite having the same name.

image

@jacobwod
Copy link
Member Author

jacobwod commented Nov 1, 2022

Initial progress, with some promising results already.

image

@Hallbergs
Copy link
Member

Very nice! ;)

@jacobwod jacobwod modified the milestones: 3.x, 3.11 Nov 17, 2022
@jacobwod
Copy link
Member Author

There's a slight misfortune here: this feature requires Node 18, but updating to it might not be feasible in some situations (see #1245). Nonetheless, this feature is complete and done.

@jacobwod jacobwod closed this as completed Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module:backend MapService stuff
Projects
None yet
Development

No branches or pull requests

2 participants