Skip to content

Commit

Permalink
fixed vic geoNetwork uuid no codeSpace info issue
Browse files Browse the repository at this point in the history
  • Loading branch information
t83714 committed Nov 4, 2021
1 parent b4fa00f commit 71a1757
Show file tree
Hide file tree
Showing 2 changed files with 371 additions and 30 deletions.
10 changes: 9 additions & 1 deletion src/CswTransformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,19 @@ export default class CswTransformer extends JsonTransformer {
}

private getRawDatasetId(jsonDataset: any): string {
const urnIdentifier = jsonpath.value(
let urnIdentifier = jsonpath.value(
jsonDataset.json,
"$..MD_Identifier[?(@.codeSpace[0].CharacterString[0]._=='urn:uuid')].code.._"
);

if (!urnIdentifier) {
urnIdentifier = jsonpath.value(
jsonDataset.json,
// some provide didn't set <mcc:codeSpace><gco:CharacterString>urn:uuid</gco:CharacterString></mcc:codeSpace>
"$..MD_Identifier[*].code[*].CharacterString[*]._"
);
}

const fileIdentifier = jsonpath.value(
jsonDataset.json,
"$.fileIdentifier[*].CharacterString[*]._"
Expand Down
Loading

0 comments on commit 71a1757

Please sign in to comment.