-
Notifications
You must be signed in to change notification settings - Fork 409
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
#9585: fix zoom to 3d layer to the correct extent in csw catalog #9610
Conversation
- fixing by getting layer extent from tileset json
description: fix test case in CSW-test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
please isolate the behaviour you have edited by removing async await
you can chaining it with a function similar to addCapabilitiesToRecords -
possibly I would like to have a dedicated test for 3dtiles use case
description: write unit test for add recordsfor 3d tile layers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please checkout inline comments,
web/client/api/CSW.js
Outdated
if (!result) return result; | ||
let { records } = result; | ||
if (records?.length) { | ||
let records3D = records.filter(rec=>rec?.dc?.format === THREE_D_TILES); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi, there is a mistake here that could have been fetched from adding proper unit testing
you cannot filter records here and then update them layer on because you can end updating the wrong one:
examples that you must have covered during tests
- you have 4 records, the first one is a THREE_D_TILES
- you have 4 records, the last one is a THREE_D_TILES
- you have 3 records, the middle one is a THREE_D_TILES
in second and third scenario you are going to update the extent to the wrong layer
avoid filtering and return the getCapabilities only if you match the config otherwise you can return a a promise that resolves the original record for those that are not THREE_D_TILES
web/client/api/CSW.js
Outdated
})); | ||
} | ||
return null; | ||
}).then(results=>getBboxFor3DLayersToRecords(results))); // handle getting bbox from capabilities in case of 3D tile layer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
}).then(results=>getBboxFor3DLayersToRecords(results))); // handle getting bbox from capabilities in case of 3D tile layer | |
}).then(results => getBboxFor3DLayersToRecords(results))); // handle getting bbox from capabilities in case of 3D tile layer |
@@ -433,7 +461,7 @@ const Api = { | |||
workspaceSearch: function(url, startPosition, maxRecords, text, workspace) { | |||
return new Promise((resolve) => { | |||
require.ensure(['../utils/ogc/CSW', '../utils/ogc/Filter'], () => { | |||
const {Filter} = require('../utils/ogc/Filter'); | |||
const { Filter } = require('../utils/ogc/Filter'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why have you started to add all of this formatting?
is there a tool you are using or what?
let's avoid introducing custom syntax formation different from what setup with vscode or the eslint rules of this project, so please let me know if you can disable this
web/client/api/__tests__/CSW-test.js
Outdated
|
||
}); | ||
|
||
describe("getLayerReferenceFromDc", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong title?
web/client/api/__tests__/CSW-test.js
Outdated
mockAxios.restore(); | ||
setTimeout(done); | ||
}); | ||
it('test getBboxFor3DLayersToRecords function that handles getting bbox for 3D tile layers from ', (done) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
improve this title, it's too generic, which case are you testing exactly?
4 records the first is 3d_tile or what else?
web/client/api/__tests__/CSW-test.js
Outdated
mockAxios.onGet().reply(()=>{ | ||
return [200, tileSetResponse]; | ||
}); | ||
mockAxios.onGet().reply(()=>{ | ||
return [200, tileSetResponse]; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplication
description: add unit tests for csw that handle 3d tile layers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I approve, but make sure to not send other format syntax change in the future
@ElenaGallo please test it in DEV |
Test passed, @mahmoudadel54 please backport to 2023.02.xx. Thanks |
…sw catalog (geosolutions-it#9610) * geosolutions-it#9585: fix zoom to 3d layer from csw catalog
Backport is done ---> #9649 |
Description
Fix zoom to any 3D layer in CSW Catalog to the correct extent.
I tried to handle bbox in metadata and parse the extent to the correct one but there is a missing point - I think it's related to axis order with different CSW versions and it needs a lot of conditions in code- so I go with the 2nd option fixing by getting layer extent from tileset json.
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x", remove the others)
Issue
#9585
What is the current behavior?
#9585
What is the new behavior?
Breaking change
Does this PR introduce a breaking change? (check one with "x", remove the other)
Other useful information