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

Fixes #2524: CSW catalog not recognizing WMS 1.3.0 layers #2525

Merged
merged 1 commit into from
Jan 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions web/client/utils/CatalogUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ const converters = {
const URI = isArray(dc.URI) ? dc.URI : (dc.URI && [dc.URI] || []);
let thumb = head([].filter.call(URI, (uri) => {return uri.name === "thumbnail"; }) );
thumbURL = thumb ? thumb.value : null;
wms = head([].filter.call(URI, (uri) => { return uri.protocol === "OGC:WMS-1.1.1-http-get-map"; }));
wms = head([].filter.call(URI, (uri) => { return uri.protocol && uri.protocol.match(/^OGC:WMS-(.*)-http-get-map/g); }));
}
// look in references objects
if (!wms && dc && dc.references && dc.references.length) {
let refs = Array.isArray(dc.references) ? dc.references : [dc.references];
wms = head([].filter.call( refs, (ref) => { return ref.scheme === "OGC:WMS-1.1.1-http-get-map" || ref.scheme === "OGC:WMS"; }));
wms = head([].filter.call(refs, (ref) => { return ref.scheme && (ref.scheme.match(/^OGC:WMS-(.*)-http-get-map/g) || ref.scheme === "OGC:WMS"); }));
if (wms) {
let urlObj = urlUtil.parse(wms.value, true);
let layerName = urlObj.query && urlObj.query.layers;
Expand Down
18 changes: 18 additions & 0 deletions web/client/utils/__tests__/CatalogUtils-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,24 @@ describe('Test the CatalogUtils', () => {
expect(records.length).toBe(1);
});

it('csw with DC URI and WMS 1.3.0', () => {
const records = CatalogUtils.getCatalogRecords('csw', {
records: [{
dc: {
URI: [{
name: "thumbnail",
value: "http://thumb"
}, {
name: "wms",
protocol: "OGC:WMS-1.3.0-http-get-map",
value: "http://geoserver"
}]
}
}]
}, {});
expect(records.length).toBe(1);
});

it('csw with DC references', () => {
const records = CatalogUtils.getCatalogRecords('csw', {
records: [{
Expand Down