geonetwork-ui 2.10.3-dev.4154db07d → 2.11.0-dev.0559cfd9d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/geonetwork-ui.mjs +2983 -2095
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/index.d.ts +408 -180
- package/index.d.ts.map +1 -1
- package/package.json +10 -8
- package/src/libs/api/metadata-converter/src/lib/dcat-ap/dcat-ap.converter.ts +2 -0
- package/src/libs/api/metadata-converter/src/lib/fixtures/generic.records.ts +5 -5
- package/src/libs/api/metadata-converter/src/lib/fixtures/mel.records.dataset+featurecatalog.ts +395 -0
- package/src/libs/api/metadata-converter/src/lib/fixtures/metawal.records.ts +5 -5
- package/src/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts +78 -21
- package/src/libs/api/metadata-converter/src/lib/gn4/types/elasticsearch.model.ts +13 -1
- package/src/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.ts +19 -0
- package/src/libs/api/metadata-converter/src/lib/iso19115-3/iso19115-3.converter.ts +17 -6
- package/src/libs/api/metadata-converter/src/lib/iso19115-3/read-parts.ts +110 -0
- package/src/libs/api/metadata-converter/src/lib/iso19115-3/write-parts.ts +133 -2
- package/src/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.ts +9 -0
- package/src/libs/api/metadata-converter/src/lib/iso19139/read-parts.ts +11 -6
- package/src/libs/api/metadata-converter/src/lib/iso19139/utils/association-type.mapper.ts +12 -0
- package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +2 -2
- package/src/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.ts +157 -38
- package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +45 -50
- package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +54 -20
- package/src/libs/common/domain/src/lib/model/search/aggregation.model.ts +2 -0
- package/src/libs/common/domain/src/lib/model/search/filter.model.ts +24 -2
- package/src/libs/common/domain/src/lib/model/search/sort-by.model.ts +1 -5
- package/src/libs/common/domain/src/lib/repository/records-repository.interface.ts +3 -3
- package/src/libs/common/fixtures/src/lib/records.fixtures.ts +42 -62
- package/src/libs/feature/dataviz/src/lib/chart-view/chart-view.component.ts +3 -2
- package/src/libs/feature/dataviz/src/lib/geo-table-view/geo-table-view.component.ts +2 -1
- package/src/libs/feature/dataviz/src/lib/service/data.service.ts +54 -41
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-associated-records/form-field-associated-records.component.html +33 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-associated-records/form-field-associated-records.component.ts +94 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.html +16 -12
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html +6 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts +6 -0
- package/src/libs/feature/editor/src/lib/fields.config.ts +5 -0
- package/src/libs/feature/map/src/index.ts +0 -2
- package/src/libs/feature/map/src/lib/add-layer-from-file/add-layer-from-file.component.html +1 -0
- package/src/libs/feature/map/src/lib/feature-map.module.ts +1 -8
- package/src/libs/feature/notifications/src/lib/notifications.service.ts +6 -4
- package/src/libs/feature/notify-reuse/src/lib/notify-reuse-form/notify-reuse-form.component.ts +8 -3
- package/src/libs/feature/record/src/lib/state/mdview.actions.ts +4 -8
- package/src/libs/feature/record/src/lib/state/mdview.effects.ts +10 -17
- package/src/libs/feature/record/src/lib/state/mdview.facade.ts +2 -4
- package/src/libs/feature/record/src/lib/state/mdview.reducer.ts +4 -9
- package/src/libs/feature/record/src/lib/state/mdview.selectors.ts +2 -7
- package/src/libs/feature/router/src/lib/default/router.service.ts +1 -1
- package/src/libs/feature/router/src/lib/default/state/query-params.utils.ts +1 -1
- package/src/libs/feature/search/src/index.ts +2 -0
- package/src/libs/feature/search/src/lib/filter-dropdown/filter-dropdown.component.html +18 -4
- package/src/libs/feature/search/src/lib/filter-dropdown/filter-dropdown.component.ts +80 -19
- package/src/libs/feature/search/src/lib/geocoding/geocoding.service.ts +105 -0
- package/src/libs/feature/search/src/lib/location-search/location-search.component.html +18 -0
- package/src/libs/feature/search/src/lib/location-search/location-search.component.ts +114 -0
- package/src/libs/feature/search/src/lib/search-filters-summary-item/search-filters-summary-item.component.ts +19 -8
- package/src/libs/feature/search/src/lib/sort-by/sort-by.component.ts +1 -1
- package/src/libs/feature/search/src/lib/state/reducer.ts +1 -4
- package/src/libs/feature/search/src/lib/utils/service/fields.service.ts +64 -4
- package/src/libs/feature/search/src/lib/utils/service/fields.ts +92 -9
- package/src/libs/ui/dataviz/src/lib/data-table/data-table.component.html +6 -7
- package/src/libs/ui/dataviz/src/lib/data-table/data-table.component.ts +31 -19
- package/src/libs/ui/dataviz/src/lib/data-table/data-table.fixtures.ts +2 -2
- package/src/libs/ui/elements/src/lib/record-feature-catalog/feature-catalog-list/feature-catalog-list.component.html +3 -3
- package/src/libs/ui/elements/src/lib/record-feature-catalog/feature-catalog-list/feature-catalog-list.component.ts +2 -2
- package/src/libs/ui/elements/src/lib/service-capabilities/service-capabilities.component.ts +2 -1
- package/src/libs/ui/inputs/src/index.ts +2 -0
- package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.css +0 -4
- package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.html +12 -3
- package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.ts +11 -3
- package/src/libs/ui/inputs/src/lib/date-adapter.providers.ts +30 -0
- package/src/libs/ui/inputs/src/lib/date-picker/date-picker.component.ts +3 -24
- package/src/libs/ui/inputs/src/lib/date-range-dropdown/date-range-dropdown.component.css +37 -3
- package/src/libs/ui/inputs/src/lib/date-range-dropdown/date-range-dropdown.component.html +135 -16
- package/src/libs/ui/inputs/src/lib/date-range-dropdown/date-range-dropdown.component.ts +166 -29
- package/src/libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.ts +3 -7
- package/src/libs/ui/inputs/src/lib/drag-and-drop-file-input/drag-and-drop-file-input.component.css +1 -0
- package/src/libs/ui/inputs/src/lib/drag-and-drop-file-input/drag-and-drop-file-input.component.html +20 -7
- package/src/libs/ui/inputs/src/lib/drag-and-drop-file-input/drag-and-drop-file-input.component.ts +46 -5
- package/src/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.component.html +7 -4
- package/src/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.component.ts +12 -9
- package/src/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.model.ts +2 -2
- package/src/libs/ui/inputs/src/lib/search-feature-catalog/search-feature-catalog.component.ts +2 -1
- package/src/libs/ui/inputs/src/lib/spatial-extent-dropdown/spatial-extent-dropdown.component.css +0 -0
- package/src/libs/ui/inputs/src/lib/spatial-extent-dropdown/spatial-extent-dropdown.component.html +117 -0
- package/src/libs/ui/inputs/src/lib/spatial-extent-dropdown/spatial-extent-dropdown.component.ts +244 -0
- package/src/libs/ui/layout/src/lib/block-list/block-list.component.css +1 -0
- package/src/libs/util/app-config/src/lib/app-config.ts +37 -0
- package/src/libs/util/app-config/src/lib/fixtures.ts +37 -1
- package/src/libs/util/app-config/src/lib/model.ts +25 -1
- package/src/libs/util/data-fetcher/src/lib/data-fetcher.ts +19 -22
- package/src/libs/util/data-fetcher/src/lib/engine/duckdb.ts +185 -0
- package/src/libs/util/data-fetcher/src/lib/engine/results.ts +63 -0
- package/src/libs/util/data-fetcher/src/lib/{sql-utils.ts → engine/sql-utils.ts} +28 -13
- package/src/libs/util/data-fetcher/src/lib/model.ts +2 -1
- package/src/libs/util/data-fetcher/src/lib/readers/base-file.ts +53 -38
- package/src/libs/util/data-fetcher/src/lib/readers/base.ts +11 -0
- package/src/libs/util/data-fetcher/src/lib/readers/csv.ts +9 -47
- package/src/libs/util/data-fetcher/src/lib/readers/excel.ts +27 -27
- package/src/libs/util/data-fetcher/src/lib/readers/geojson.ts +5 -24
- package/src/libs/util/data-fetcher/src/lib/readers/gml.ts +5 -49
- package/src/libs/util/data-fetcher/src/lib/readers/json.ts +5 -23
- package/src/libs/util/data-fetcher/src/lib/readers/wfs.ts +184 -128
- package/src/libs/util/data-fetcher/src/lib/utils.ts +0 -143
- package/src/libs/util/shared/src/index.ts +1 -0
- package/src/libs/util/shared/src/lib/autofocus.directive.ts +26 -0
- package/src/libs/util/shared/src/lib/gn-ui-version.ts +1 -1
- package/src/libs/util/shared/src/lib/links/link-utils.ts +19 -10
- package/src/libs/util/shared/src/lib/services/date.service.ts +3 -3
- package/src/libs/util/shared/src/lib/utils/file.ts +15 -0
- package/src/libs/util/shared/src/lib/utils/geojson.ts +24 -0
- package/src/libs/util/shared/src/lib/utils/index.ts +1 -0
- package/tailwind.base.css +5 -0
- package/translations/de.json +38 -5
- package/translations/en.json +37 -4
- package/translations/es.json +35 -2
- package/translations/fr.json +42 -9
- package/translations/it.json +36 -3
- package/translations/nl.json +35 -2
- package/translations/pt.json +35 -2
- package/translations/sk.json +36 -3
- package/src/libs/feature/map/src/lib/geocoding/geocoding.component.html +0 -41
- package/src/libs/feature/map/src/lib/geocoding/geocoding.component.ts +0 -112
- package/src/libs/feature/map/src/lib/geocoding.service.ts +0 -57
- package/src/libs/feature/map/src/lib/style/index.ts +0 -2
- package/src/libs/feature/map/src/lib/style/map-style.fixtures.ts +0 -47
- package/src/libs/feature/map/src/lib/style/map-style.service.ts +0 -108
- package/src/libs/util/data-fetcher/src/lib/readers/base-cache.ts +0 -14
- /package/src/libs/feature/{map/src/lib/geocoding/geocoding.component.css → editor/src/lib/components/record-form/form-field/form-field-associated-records/form-field-associated-records.component.css} +0 -0
|
@@ -5,11 +5,13 @@ import {
|
|
|
5
5
|
findNestedElements,
|
|
6
6
|
findParent,
|
|
7
7
|
readAttribute,
|
|
8
|
+
readText,
|
|
8
9
|
XmlElement,
|
|
9
10
|
} from '../xml-utils'
|
|
10
11
|
import {
|
|
11
12
|
ChainableFunction,
|
|
12
13
|
combine,
|
|
14
|
+
fallback,
|
|
13
15
|
filterArray,
|
|
14
16
|
flattenArray,
|
|
15
17
|
getAtIndex,
|
|
@@ -32,6 +34,9 @@ import {
|
|
|
32
34
|
} from '../iso19139/read-parts'
|
|
33
35
|
import {
|
|
34
36
|
AssociatedRecord,
|
|
37
|
+
DatasetFeatureAttribute,
|
|
38
|
+
DatasetFeatureAttributeValue,
|
|
39
|
+
DatasetFeatureType,
|
|
35
40
|
Individual,
|
|
36
41
|
LanguageCode,
|
|
37
42
|
SourceRecord,
|
|
@@ -411,3 +416,108 @@ export function readOtherLanguages(rootEl: XmlElement): LanguageCode[] {
|
|
|
411
416
|
)
|
|
412
417
|
)(rootEl)
|
|
413
418
|
}
|
|
419
|
+
|
|
420
|
+
function extractCharacterStringOrText(): ChainableFunction<XmlElement, string> {
|
|
421
|
+
return fallback(extractCharacterString(), readText())
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
function extractListedValue(): ChainableFunction<
|
|
425
|
+
XmlElement,
|
|
426
|
+
DatasetFeatureAttributeValue
|
|
427
|
+
> {
|
|
428
|
+
return pipe(
|
|
429
|
+
combine(
|
|
430
|
+
pipe(findChildElement('gfc:code', false), extractCharacterString()),
|
|
431
|
+
pipe(findChildElement('gfc:label', false), extractCharacterString()),
|
|
432
|
+
pipe(findChildElement('gfc:definition', false), extractCharacterString())
|
|
433
|
+
),
|
|
434
|
+
map(([code, label, description]) => ({
|
|
435
|
+
value: code ?? '',
|
|
436
|
+
...(label && { label }),
|
|
437
|
+
...(description && { description }),
|
|
438
|
+
}))
|
|
439
|
+
)
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
function extractFeatureAttribute(): ChainableFunction<
|
|
443
|
+
XmlElement,
|
|
444
|
+
DatasetFeatureAttribute
|
|
445
|
+
> {
|
|
446
|
+
return pipe(
|
|
447
|
+
combine(
|
|
448
|
+
pipe(
|
|
449
|
+
findChildElement('gfc:memberName', false),
|
|
450
|
+
extractCharacterStringOrText()
|
|
451
|
+
),
|
|
452
|
+
pipe(
|
|
453
|
+
findChildElement('gfc:designation', false),
|
|
454
|
+
extractCharacterString()
|
|
455
|
+
),
|
|
456
|
+
pipe(findChildElement('gfc:definition', false), extractCharacterString()),
|
|
457
|
+
pipe(findChildElement('gfc:code', false), extractCharacterString()),
|
|
458
|
+
pipe(
|
|
459
|
+
findNestedElement('gfc:valueType', 'gco:TypeName', 'gco:aName'),
|
|
460
|
+
extractCharacterString()
|
|
461
|
+
),
|
|
462
|
+
pipe(
|
|
463
|
+
findNestedElements('gfc:listedValue', 'gfc:FC_ListedValue'),
|
|
464
|
+
mapArray(extractListedValue()),
|
|
465
|
+
filterArray((value) => !!(value.value || value.label))
|
|
466
|
+
)
|
|
467
|
+
),
|
|
468
|
+
map(([name, label, description, code, type, values]) => ({
|
|
469
|
+
name: name ?? '',
|
|
470
|
+
...(label && { label }),
|
|
471
|
+
...(description && { description }),
|
|
472
|
+
...(code && { code }),
|
|
473
|
+
...(type && { type }),
|
|
474
|
+
...(values.length > 0 && { values }),
|
|
475
|
+
}))
|
|
476
|
+
)
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
export function readFeatureTypeDescriptions(
|
|
480
|
+
rootEl: XmlElement
|
|
481
|
+
): Array<DatasetFeatureType> {
|
|
482
|
+
return pipe(
|
|
483
|
+
findNestedElements(
|
|
484
|
+
'mdb:contentInfo',
|
|
485
|
+
'mrc:MD_FeatureCatalogue',
|
|
486
|
+
'mrc:featureCatalogue',
|
|
487
|
+
'gfc:FC_FeatureCatalogue',
|
|
488
|
+
'gfc:featureType',
|
|
489
|
+
'gfc:FC_FeatureType'
|
|
490
|
+
),
|
|
491
|
+
mapArray(
|
|
492
|
+
pipe(
|
|
493
|
+
combine(
|
|
494
|
+
pipe(
|
|
495
|
+
findChildElement('gfc:typeName', false),
|
|
496
|
+
extractCharacterStringOrText()
|
|
497
|
+
),
|
|
498
|
+
pipe(
|
|
499
|
+
findChildElement('gfc:designation', false),
|
|
500
|
+
extractCharacterString()
|
|
501
|
+
),
|
|
502
|
+
pipe(
|
|
503
|
+
findChildElement('gfc:definition', false),
|
|
504
|
+
extractCharacterString()
|
|
505
|
+
),
|
|
506
|
+
pipe(
|
|
507
|
+
findNestedElements(
|
|
508
|
+
'gfc:carrierOfCharacteristics',
|
|
509
|
+
'gfc:FC_FeatureAttribute'
|
|
510
|
+
),
|
|
511
|
+
mapArray(extractFeatureAttribute())
|
|
512
|
+
)
|
|
513
|
+
),
|
|
514
|
+
map(([name, label, description, attributes]) => ({
|
|
515
|
+
name: name ?? '',
|
|
516
|
+
...(label && { label }),
|
|
517
|
+
...(description && { description }),
|
|
518
|
+
attributes,
|
|
519
|
+
}))
|
|
520
|
+
)
|
|
521
|
+
)
|
|
522
|
+
)(rootEl)
|
|
523
|
+
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CatalogRecord,
|
|
3
|
+
DatasetFeatureAttribute,
|
|
4
|
+
DatasetFeatureAttributeValue,
|
|
5
|
+
DatasetFeatureType,
|
|
3
6
|
DatasetRecord,
|
|
4
7
|
Individual,
|
|
5
8
|
LanguageCode,
|
|
@@ -587,7 +590,7 @@ export function writeAssociatedRecords(
|
|
|
587
590
|
removeChildrenByName('mri:associatedResource'),
|
|
588
591
|
appendChildren(
|
|
589
592
|
...record.associatedRecords
|
|
590
|
-
.filter((assoc) => assoc.
|
|
593
|
+
.filter((assoc) => assoc.uniqueIdentifier && assoc.associationType)
|
|
591
594
|
.map((assoc) =>
|
|
592
595
|
pipe(
|
|
593
596
|
createNestedElement(
|
|
@@ -608,7 +611,7 @@ export function writeAssociatedRecords(
|
|
|
608
611
|
),
|
|
609
612
|
pipe(
|
|
610
613
|
createElement('mri:metadataReference'),
|
|
611
|
-
writeAttribute('uuidref', assoc.
|
|
614
|
+
writeAttribute('uuidref', assoc.uniqueIdentifier)
|
|
612
615
|
)
|
|
613
616
|
)
|
|
614
617
|
)
|
|
@@ -616,3 +619,131 @@ export function writeAssociatedRecords(
|
|
|
616
619
|
)
|
|
617
620
|
)(rootEl)
|
|
618
621
|
}
|
|
622
|
+
|
|
623
|
+
function createNilElement(name: string, nilReason: string) {
|
|
624
|
+
return pipe(createElement(name), writeAttribute('gco:nilReason', nilReason))
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
function createFeatureCatalogueShell() {
|
|
628
|
+
return pipe(
|
|
629
|
+
createNestedElement(
|
|
630
|
+
'mdb:contentInfo',
|
|
631
|
+
'mrc:MD_FeatureCatalogue',
|
|
632
|
+
'mrc:featureCatalogue',
|
|
633
|
+
'gfc:FC_FeatureCatalogue'
|
|
634
|
+
),
|
|
635
|
+
// create mandatory elements which are not part of the model yet
|
|
636
|
+
appendChildren(
|
|
637
|
+
createNilElement('cat:name', 'missing'),
|
|
638
|
+
createNilElement('cat:scope', 'missing'),
|
|
639
|
+
createNilElement('cat:versionNumber', 'missing'),
|
|
640
|
+
createNilElement('cat:versionDate', 'missing'),
|
|
641
|
+
createNilElement('gfc:producer', 'missing')
|
|
642
|
+
)
|
|
643
|
+
)
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
function createListedValue(value: DatasetFeatureAttributeValue) {
|
|
647
|
+
return pipe(
|
|
648
|
+
createNestedElement('gfc:listedValue', 'gfc:FC_ListedValue'),
|
|
649
|
+
appendChildren(
|
|
650
|
+
value.label
|
|
651
|
+
? pipe(createElement('gfc:label'), writeCharacterString(value.label))
|
|
652
|
+
: createNilElement('gfc:label', 'missing'),
|
|
653
|
+
value.value
|
|
654
|
+
? pipe(createElement('gfc:code'), writeCharacterString(value.value))
|
|
655
|
+
: null,
|
|
656
|
+
value.description
|
|
657
|
+
? pipe(
|
|
658
|
+
createElement('gfc:definition'),
|
|
659
|
+
writeCharacterString(value.description)
|
|
660
|
+
)
|
|
661
|
+
: null
|
|
662
|
+
)
|
|
663
|
+
)
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
function createFeatureAttribute(attribute: DatasetFeatureAttribute) {
|
|
667
|
+
return pipe(
|
|
668
|
+
createNestedElement(
|
|
669
|
+
'gfc:carrierOfCharacteristics',
|
|
670
|
+
'gfc:FC_FeatureAttribute'
|
|
671
|
+
),
|
|
672
|
+
appendChildren(
|
|
673
|
+
pipe(createElement('gfc:memberName'), setTextContent(attribute.name)),
|
|
674
|
+
attribute.description
|
|
675
|
+
? pipe(
|
|
676
|
+
createElement('gfc:definition'),
|
|
677
|
+
writeCharacterString(attribute.description)
|
|
678
|
+
)
|
|
679
|
+
: null,
|
|
680
|
+
createNilElement('gfc:cardinality', 'missing'),
|
|
681
|
+
attribute.label
|
|
682
|
+
? pipe(
|
|
683
|
+
createElement('gfc:designation'),
|
|
684
|
+
writeCharacterString(attribute.label)
|
|
685
|
+
)
|
|
686
|
+
: null,
|
|
687
|
+
attribute.code
|
|
688
|
+
? pipe(createElement('gfc:code'), writeCharacterString(attribute.code))
|
|
689
|
+
: null,
|
|
690
|
+
attribute.type
|
|
691
|
+
? pipe(
|
|
692
|
+
createNestedElement('gfc:valueType', 'gco:TypeName', 'gco:aName'),
|
|
693
|
+
writeCharacterString(attribute.type)
|
|
694
|
+
)
|
|
695
|
+
: null,
|
|
696
|
+
...(attribute.values ?? [])
|
|
697
|
+
.filter((value) => value.value || value.label)
|
|
698
|
+
.map(createListedValue)
|
|
699
|
+
)
|
|
700
|
+
)
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
function createFeatureType(featureType: DatasetFeatureType) {
|
|
704
|
+
return pipe(
|
|
705
|
+
createNestedElement('gfc:featureType', 'gfc:FC_FeatureType'),
|
|
706
|
+
appendChildren(
|
|
707
|
+
pipe(createElement('gfc:typeName'), setTextContent(featureType.name)),
|
|
708
|
+
featureType.description
|
|
709
|
+
? pipe(
|
|
710
|
+
createElement('gfc:definition'),
|
|
711
|
+
writeCharacterString(featureType.description)
|
|
712
|
+
)
|
|
713
|
+
: null,
|
|
714
|
+
pipe(
|
|
715
|
+
createNestedElement('gfc:isAbstract', 'gco:Boolean'),
|
|
716
|
+
setTextContent('false')
|
|
717
|
+
),
|
|
718
|
+
featureType.label
|
|
719
|
+
? pipe(
|
|
720
|
+
createElement('gfc:designation'),
|
|
721
|
+
writeCharacterString(featureType.label)
|
|
722
|
+
)
|
|
723
|
+
: null,
|
|
724
|
+
...featureType.attributes.map(createFeatureAttribute),
|
|
725
|
+
createNilElement('gfc:featureCatalogue', 'missing')
|
|
726
|
+
)
|
|
727
|
+
)
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
export function writeFeatureTypeDescriptions(
|
|
731
|
+
record: DatasetRecord,
|
|
732
|
+
rootEl: XmlElement
|
|
733
|
+
) {
|
|
734
|
+
const featureTypes = record.featureTypeDescriptions ?? []
|
|
735
|
+
const catalogues = findNestedElements(
|
|
736
|
+
'mdb:contentInfo',
|
|
737
|
+
'mrc:MD_FeatureCatalogue',
|
|
738
|
+
'mrc:featureCatalogue',
|
|
739
|
+
'gfc:FC_FeatureCatalogue'
|
|
740
|
+
)(rootEl)
|
|
741
|
+
catalogues.forEach((catalogue) =>
|
|
742
|
+
removeChildrenByName('gfc:featureType')(catalogue)
|
|
743
|
+
)
|
|
744
|
+
if (!featureTypes.length) return
|
|
745
|
+
|
|
746
|
+
const catalogue =
|
|
747
|
+
catalogues[0] ?? appendChildTree(createFeatureCatalogueShell())(rootEl)
|
|
748
|
+
appendChildren(...featureTypes.map(createFeatureType))(catalogue)
|
|
749
|
+
}
|
|
@@ -118,6 +118,7 @@ export class Iso19139Converter extends BaseConverter<string> {
|
|
|
118
118
|
lineage: readLineage,
|
|
119
119
|
sourceRecords: readSourceRecords,
|
|
120
120
|
associatedRecords: readAssociatedRecords,
|
|
121
|
+
featureTypeDescriptions: () => undefined,
|
|
121
122
|
onlineResources: readOnlineResources,
|
|
122
123
|
temporalExtents: readTemporalExtents,
|
|
123
124
|
spatialExtents: readSpatialExtents,
|
|
@@ -161,6 +162,7 @@ export class Iso19139Converter extends BaseConverter<string> {
|
|
|
161
162
|
lineage: writeLineage,
|
|
162
163
|
sourceRecords: writeSourceRecords,
|
|
163
164
|
associatedRecords: writeAssociatedRecords,
|
|
165
|
+
featureTypeDescriptions: () => undefined,
|
|
164
166
|
onlineResources: writeOnlineResources,
|
|
165
167
|
temporalExtents: writeTemporalExtents,
|
|
166
168
|
spatialExtents: writeSpatialExtents,
|
|
@@ -306,6 +308,10 @@ export class Iso19139Converter extends BaseConverter<string> {
|
|
|
306
308
|
const sourceRecords = this.readers['sourceRecords'](rootEl, tr)
|
|
307
309
|
const associatedRecords = this.readers['associatedRecords'](rootEl, tr)
|
|
308
310
|
const updateFrequency = this.readers['updateFrequency'](rootEl, tr)
|
|
311
|
+
const featureTypeDescriptions = this.readers['featureTypeDescriptions'](
|
|
312
|
+
rootEl,
|
|
313
|
+
tr
|
|
314
|
+
) as DatasetRecord['featureTypeDescriptions']
|
|
309
315
|
|
|
310
316
|
return this.afterRecordRead({
|
|
311
317
|
...this.readBaseRecord(rootEl, tr),
|
|
@@ -317,6 +323,7 @@ export class Iso19139Converter extends BaseConverter<string> {
|
|
|
317
323
|
...(spatialRepresentation && { spatialRepresentation }),
|
|
318
324
|
temporalExtents,
|
|
319
325
|
updateFrequency,
|
|
326
|
+
...(featureTypeDescriptions?.length && { featureTypeDescriptions }),
|
|
320
327
|
translations: tr,
|
|
321
328
|
} as DatasetRecord)
|
|
322
329
|
} else if (kind === 'reuse') {
|
|
@@ -416,6 +423,8 @@ export class Iso19139Converter extends BaseConverter<string> {
|
|
|
416
423
|
|
|
417
424
|
if (record.kind === 'dataset') {
|
|
418
425
|
fieldChanged('status') && this.writers['status'](record, rootEl)
|
|
426
|
+
fieldChanged('featureTypeDescriptions') &&
|
|
427
|
+
this.writers['featureTypeDescriptions'](record, rootEl)
|
|
419
428
|
}
|
|
420
429
|
if (record.kind === 'dataset' || record.kind === 'reuse') {
|
|
421
430
|
fieldChanged('updateFrequency') &&
|
|
@@ -51,6 +51,7 @@ import {
|
|
|
51
51
|
readText,
|
|
52
52
|
XmlElement,
|
|
53
53
|
} from '../xml-utils'
|
|
54
|
+
import { getAssociationTypeFromCode } from './utils/association-type.mapper'
|
|
54
55
|
import { readGeometry } from './utils/geometry'
|
|
55
56
|
import { fullNameToParts } from './utils/individual-name'
|
|
56
57
|
import { getKeywordTypeFromKeywordTypeCode } from './utils/keyword.mapper'
|
|
@@ -68,7 +69,8 @@ export function extractCharacterString(): ChainableFunction<
|
|
|
68
69
|
fallback(
|
|
69
70
|
findChildElement('gco:CharacterString', false),
|
|
70
71
|
findChildElement('gmx:Anchor', false),
|
|
71
|
-
findChildElement('gmx:MimeFileType', false)
|
|
72
|
+
findChildElement('gmx:MimeFileType', false),
|
|
73
|
+
findChildElement('gco:LocalName', false)
|
|
72
74
|
),
|
|
73
75
|
readText()
|
|
74
76
|
)
|
|
@@ -931,19 +933,22 @@ export function readSourceRecords(rootEl: XmlElement): SourceRecord[] {
|
|
|
931
933
|
export function extractAssociatedRecords(
|
|
932
934
|
containerName: string,
|
|
933
935
|
aggregateName: string,
|
|
934
|
-
|
|
936
|
+
readIdentifier: ChainableFunction<XmlElement, string>
|
|
935
937
|
): ChainableFunction<XmlElement, AssociatedRecord[]> {
|
|
936
938
|
return pipe(
|
|
937
939
|
findChildrenElement(containerName, false),
|
|
938
940
|
mapArray((el) => {
|
|
939
941
|
const aggregateEl = findChildElement(aggregateName, false)(el)
|
|
940
|
-
const
|
|
941
|
-
const
|
|
942
|
+
const uniqueIdentifier = readIdentifier(aggregateEl)
|
|
943
|
+
const associationTypeCode = pipe(
|
|
942
944
|
findNestedElement('gmd:associationType', 'gmd:DS_AssociationTypeCode'),
|
|
943
945
|
readAttribute('codeListValue')
|
|
944
946
|
)(aggregateEl)
|
|
945
|
-
if (!
|
|
946
|
-
return {
|
|
947
|
+
if (!uniqueIdentifier || !associationTypeCode) return null
|
|
948
|
+
return {
|
|
949
|
+
uniqueIdentifier,
|
|
950
|
+
associationType: getAssociationTypeFromCode(associationTypeCode),
|
|
951
|
+
}
|
|
947
952
|
}),
|
|
948
953
|
filterArray((r): r is AssociatedRecord => r !== null)
|
|
949
954
|
)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AssociationType,
|
|
3
|
+
associationTypeValues,
|
|
4
|
+
} from '../../../../../../../libs/common/domain/src/lib/model/record'
|
|
5
|
+
|
|
6
|
+
export function getAssociationTypeFromCode(
|
|
7
|
+
associationTypeCode: string
|
|
8
|
+
): AssociationType {
|
|
9
|
+
return associationTypeValues.includes(associationTypeCode as AssociationType)
|
|
10
|
+
? (associationTypeCode as AssociationType)
|
|
11
|
+
: 'crossReference'
|
|
12
|
+
}
|
|
@@ -1276,7 +1276,7 @@ export function writeAssociatedRecords(
|
|
|
1276
1276
|
removeChildrenByName('gmd:aggregationInfo'),
|
|
1277
1277
|
appendChildren(
|
|
1278
1278
|
...record.associatedRecords
|
|
1279
|
-
.filter((assoc) => assoc.
|
|
1279
|
+
.filter((assoc) => assoc.uniqueIdentifier && assoc.associationType)
|
|
1280
1280
|
.map((assoc) =>
|
|
1281
1281
|
pipe(
|
|
1282
1282
|
createNestedElement(
|
|
@@ -1290,7 +1290,7 @@ export function writeAssociatedRecords(
|
|
|
1290
1290
|
'gmd:MD_Identifier',
|
|
1291
1291
|
'gmd:code'
|
|
1292
1292
|
),
|
|
1293
|
-
writeCharacterString(assoc.
|
|
1293
|
+
writeCharacterString(assoc.uniqueIdentifier)
|
|
1294
1294
|
),
|
|
1295
1295
|
pipe(
|
|
1296
1296
|
createNestedElement(
|