adiwg-mdtranslator 2.12.0 → 2.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -1
- data/adiwg-mdtranslator.gemspec +1 -1
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +2 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/fgdc_reader.rb +4 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityAttribute.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_georectifiedRepresentation.rb +7 -12
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceInfo.rb +12 -11
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_source.rb +15 -7
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomy.rb +1 -6
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_timePeriod.rb +15 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_transferOption.rb +1 -3
- data/lib/adiwg/mdtranslator/version.rb +5 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_citation.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_contact.rb +4 -2
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicAge.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_identification.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_method.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_source.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomyKeywords.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomySystem.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_fcFeatureCatalogue.rb +7 -7
- data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb +6 -5
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_address.rb +104 -104
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_aggregateInformation.rb +63 -60
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/{class_attributeGroup.rb → class_attribute.rb} +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_baseUnit.rb +23 -23
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_boundingBox.rb +64 -60
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_browseGraphic.rb +55 -51
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_citation.rb +24 -14
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_contact.rb +96 -91
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_conventionalUnit.rb +45 -45
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_coverageDescription.rb +104 -77
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_crs.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataIdentification.rb +23 -8
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataQuality.rb +57 -52
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_date.rb +49 -46
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_definitionUnit.rb +20 -20
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_derivedUnit.rb +32 -32
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dimension.rb +56 -50
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_distribution.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_distributor.rb +77 -74
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_enumerationList.rb +34 -34
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_extension.rb +190 -186
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_extent.rb +66 -66
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_feature.rb +50 -45
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_featureCollection.rb +35 -35
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_featureProperties.rb +43 -43
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_format.rb +73 -69
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_fraction.rb +37 -33
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geographicElement.rb +59 -54
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geographicExtent.rb +58 -58
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geometricObjects.rb +49 -46
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geometryCollection.rb +68 -63
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_georectified.rb +113 -110
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_georeferenceable.rb +78 -75
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gmlIdentifier.rb +17 -17
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_grid.rb +55 -52
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gridRepresentation.rb +19 -19
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_hierarchy.rb +47 -47
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_image.rb +132 -132
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_keyword.rb +5 -2
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_lineString.rb +70 -70
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_lineage.rb +55 -55
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_locale.rb +51 -48
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_maintenance.rb +114 -105
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_mdBand.rb +111 -111
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_mdIdentifier.rb +9 -3
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_measure.rb +58 -41
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_medium.rb +104 -104
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_miBand.rb +70 -70
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_miMetadata.rb +51 -16
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_multiLine.rb +70 -70
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_multiPoint.rb +70 -70
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_multiPolygon.rb +70 -70
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_onlineResource.rb +79 -76
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_orderProcess.rb +67 -67
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_phone.rb +67 -67
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_point.rb +8 -8
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_polygon.rb +89 -89
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_processStep.rb +9 -3
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_rangeDimension.rb +59 -54
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_referenceSystem.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_resolution.rb +47 -47
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_responsibleParty.rb +111 -105
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_rsIdentifier.rb +71 -65
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_scope.rb +54 -50
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_scopeDescription.rb +45 -42
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_securityConstraints.rb +92 -89
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_series.rb +55 -55
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_source.rb +98 -91
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_spatialRepresentation.rb +42 -42
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_taxonomicClassification.rb +63 -59
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_taxonomicSystem.rb +40 -40
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_taxonomy.rb +133 -130
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_temporalExtent.rb +49 -49
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_timeInstant.rb +60 -60
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_timePeriod.rb +110 -108
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_transferOptions.rb +71 -69
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_unitsOfMeasure.rb +243 -243
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_usage.rb +98 -95
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_useConstraints.rb +38 -38
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_vectorRepresentation.rb +48 -48
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_verticalExtent.rb +74 -70
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_vouchers.rb +56 -53
- data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer.rb +61 -11
- data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer_messages_eng.yml +109 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_2/version.rb +3 -2
- data/lib/adiwg/mdtranslator_cli.rb +21 -4
- metadata +6 -5
@@ -5,60 +5,60 @@
|
|
5
5
|
# Stan Smith 2015-08-27 copied from 19110 writer
|
6
6
|
|
7
7
|
module ADIWG
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
module Mdtranslator
|
9
|
+
module Writers
|
10
|
+
module Iso19115_2
|
11
11
|
|
12
|
-
|
12
|
+
class ConventionalUnit
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
def initialize(xml, hResponseObj)
|
15
|
+
@xml = xml
|
16
|
+
@hResponseObj = hResponseObj
|
17
|
+
end
|
18
18
|
|
19
|
-
|
19
|
+
def writeXML(hConv)
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
# create and identity for the unit
|
22
|
+
@hResponseObj[:writerMissingIdCount] = @hResponseObj[:writerMissingIdCount].succ
|
23
|
+
unitID = 'unit' + @hResponseObj[:writerMissingIdCount]
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
25
|
+
@xml.tag!('gml:ConventionalUnit', {'gml:id' => unitID}) do
|
26
|
+
@xml.tag!('gml:identifier', {'codeSpace' => hConv[:codeSpace]}, hConv[:identifier])
|
27
|
+
@xml.tag!('gml:name', hConv[:name])
|
28
|
+
@xml.tag!('gml:catalogSymbol', hConv[:catalogSymbol])
|
29
|
+
@xml.tag!('gml:conversionToPreferredUnit', {'uom' => hConv[:preferredUnit]}) do
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
end
|
53
|
-
|
54
|
-
end
|
31
|
+
# two methods of conversion are available
|
32
|
+
# factor and formula
|
33
|
+
if !hConv[:factor].nil?
|
34
|
+
# factor:
|
35
|
+
# y = factor * x
|
36
|
+
# y is in preferred units
|
37
|
+
# x is in provided units
|
38
|
+
# factor is conversion to preferred units
|
39
|
+
@xml.tag!('gml:factor', hConv[:factor])
|
40
|
+
else
|
41
|
+
# formula:
|
42
|
+
# y = (a + bx) / (c + dx)
|
43
|
+
# y is in preferred units
|
44
|
+
# x is in provided units
|
45
|
+
# a,b,c,d are constants to convert to preferred units
|
46
|
+
@xml.tag!('gml:formula') do
|
47
|
+
@xml.tag!('gml:a', hConv[:a])
|
48
|
+
@xml.tag!('gml:b', hConv[:b])
|
49
|
+
@xml.tag!('gml:c', hConv[:c])
|
50
|
+
@xml.tag!('gml:d', hConv[:d])
|
51
|
+
end
|
55
52
|
end
|
56
53
|
|
57
|
-
|
54
|
+
end
|
55
|
+
end
|
58
56
|
|
59
|
-
|
57
|
+
end
|
60
58
|
|
61
59
|
end
|
62
|
-
|
63
|
-
|
60
|
+
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
64
|
end
|
@@ -2,98 +2,125 @@
|
|
2
2
|
# 19115-2 writer output in XML
|
3
3
|
|
4
4
|
# History:
|
5
|
-
#
|
5
|
+
# Stan Smith 2018-04-09 add error and warning messaging
|
6
|
+
# Stan Smith 2016-11-23 refactored for mdTranslator/mdJson 2.0
|
6
7
|
# Stan Smith 2015-08-27 original script.
|
7
8
|
|
9
|
+
require_relative '../iso19115_2_writer'
|
8
10
|
require_relative 'class_codelist'
|
9
|
-
require_relative '
|
11
|
+
require_relative 'class_attribute'
|
10
12
|
require_relative 'class_image'
|
11
13
|
|
12
14
|
module ADIWG
|
13
|
-
|
14
|
-
|
15
|
-
|
15
|
+
module Mdtranslator
|
16
|
+
module Writers
|
17
|
+
module Iso19115_2
|
16
18
|
|
17
|
-
|
19
|
+
class CoverageDescription
|
18
20
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
21
|
+
def initialize(xml, hResponseObj)
|
22
|
+
@xml = xml
|
23
|
+
@hResponseObj = hResponseObj
|
24
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_2
|
25
|
+
end
|
26
|
+
|
27
|
+
def writeXML(hCoverage)
|
23
28
|
|
24
|
-
|
29
|
+
# classes used
|
30
|
+
codelistClass = MD_Codelist.new(@xml, @hResponseObj)
|
31
|
+
attributeClass = Attribute.new(@xml, @hResponseObj)
|
32
|
+
imageClass = MI_ImageDescription.new(@xml, @hResponseObj)
|
25
33
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
34
|
+
# determine type of MD_CoverageDescription to write
|
35
|
+
if hCoverage[:imageDescription].empty?
|
36
|
+
contentTag = 'gmi:MI_CoverageDescription'
|
37
|
+
else
|
38
|
+
contentTag = 'gmi:MI_ImageDescription'
|
39
|
+
end
|
30
40
|
|
31
|
-
|
32
|
-
if hCoverage[:imageDescription].empty?
|
33
|
-
contentTag = 'gmi:MI_CoverageDescription'
|
34
|
-
else
|
35
|
-
contentTag = 'gmi:MI_ImageDescription'
|
36
|
-
end
|
37
|
-
|
38
|
-
@xml.tag!(contentTag) do
|
41
|
+
@xml.tag!(contentTag) do
|
39
42
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
43
|
+
# coverage description - attribute description (required)
|
44
|
+
# combine coverageName and coverageDescription
|
45
|
+
attDesc = ''
|
46
|
+
unless hCoverage[:coverageName].nil?
|
47
|
+
attDesc += hCoverage[:coverageName] + '; '
|
48
|
+
end
|
49
|
+
unless hCoverage[:coverageDescription].nil?
|
50
|
+
attDesc += hCoverage[:coverageDescription]
|
51
|
+
end
|
52
|
+
unless attDesc == ''
|
53
|
+
@xml.tag!('gmd:attributeDescription') do
|
54
|
+
@xml.tag!('gco:RecordType', attDesc)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
if attDesc == ''
|
58
|
+
@NameSpace.issueWarning(40, 'gmd:attributeDescription')
|
59
|
+
end
|
57
60
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
61
|
+
# coverage description - content type (required) {MD_CoverageContentTypeCode}
|
62
|
+
# coverageContentTypeCode (ISO) = attributeContentType (mdJson)
|
63
|
+
# in ISO 19115-1 coverageContentTypeCode [] (required) in attributeGroup
|
64
|
+
# ... coverageContentTypeCode applies only to attributeGroup
|
65
|
+
# in ISO 19115-2 coverageContentTypeCode (required) in CoverageDescription
|
66
|
+
# ... contentInfo must be either coverageDescription or imageDescription
|
67
|
+
# ... coverageContentTypeCode applies to both imageDescription and attribute (rangeDimension)
|
68
|
+
# mdJson does not require either attributeGroup or imageDescription
|
69
|
+
# so, coverageContentTypeCode will be missing when content info is imageDescription
|
70
|
+
# how to handle in ISO 19115-2 ...
|
71
|
+
# when content info is imageDescription set contentCoverageType to 'image'
|
72
|
+
# when content info is attributeGroup contentCoverageType will be available
|
73
|
+
# when content info is not provided set contentType to 'nilReason=missing'
|
74
|
+
contentType = nil
|
75
|
+
contentType = 'image' if contentTag == 'gmi:MI_ImageDescription'
|
76
|
+
if contentTag == 'gmi:MI_CoverageDescription'
|
77
|
+
aGroups = hCoverage[:attributeGroups]
|
78
|
+
unless aGroups.empty?
|
79
|
+
aAttContents = aGroups[0][:attributeContentTypes]
|
80
|
+
unless aAttContents.empty?
|
81
|
+
contentType = aAttContents[0]
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
unless contentType.nil?
|
86
|
+
@xml.tag!('gmd:contentType') do
|
87
|
+
codelistClass.writeXML('gmd', 'iso_coverageContentType', contentType)
|
88
|
+
end
|
89
|
+
end
|
90
|
+
if contentType.nil?
|
91
|
+
@NameSpace.issueWarning(41, 'gmd:contentType')
|
92
|
+
end
|
72
93
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
94
|
+
# coverage description - dimension []
|
95
|
+
haveAttribute = false
|
96
|
+
if contentTag == 'gmi:MI_CoverageDescription'
|
97
|
+
aGroups.each do |hGroup|
|
98
|
+
aAttributes = hGroup[:attributes]
|
99
|
+
aAttributes.each do |hAttribute|
|
100
|
+
@xml.tag!('gmd:dimension') do
|
101
|
+
attributeClass.writeXML(hAttribute)
|
102
|
+
haveAttribute = true
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
if !haveAttribute && @hResponseObj[:writerShowTags]
|
107
|
+
@xml.tag!('gmd:dimension')
|
108
|
+
end
|
109
|
+
end
|
85
110
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
111
|
+
# coverage description - image information
|
112
|
+
if contentTag == 'gmi:MI_ImageDescription'
|
113
|
+
hImage = hCoverage[:imageDescription]
|
114
|
+
unless hImage.empty?
|
115
|
+
imageClass.writeXML(hCoverage)
|
116
|
+
end
|
117
|
+
end
|
91
118
|
|
92
|
-
|
93
|
-
|
94
|
-
|
119
|
+
end # MI_CoverageDescription/MI_ImageDescription tag
|
120
|
+
end # writeXML
|
121
|
+
end # ContentInformation class
|
95
122
|
|
96
|
-
|
97
|
-
|
98
|
-
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
99
126
|
end
|
@@ -33,7 +33,7 @@ module ADIWG
|
|
33
33
|
hIdentifier = hParamSet[:projection][:projectionIdentifier]
|
34
34
|
unless hIdentifier.empty?
|
35
35
|
@xml.tag!('gmd:projection') do
|
36
|
-
idClass.writeXML(hIdentifier)
|
36
|
+
idClass.writeXML(hIdentifier, 'CRS projection')
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
@@ -46,7 +46,7 @@ module ADIWG
|
|
46
46
|
hIdentifier = hParamSet[:geodetic][:ellipsoidIdentifier]
|
47
47
|
unless hIdentifier.empty?
|
48
48
|
@xml.tag!('gmd:ellipsoid') do
|
49
|
-
idClass.writeXML(hIdentifier)
|
49
|
+
idClass.writeXML(hIdentifier, 'CRS geodetic ellipsoid')
|
50
50
|
end
|
51
51
|
end
|
52
52
|
end
|
@@ -60,7 +60,7 @@ module ADIWG
|
|
60
60
|
hIdentifier = hParamSet[:geodetic][:datumIdentifier]
|
61
61
|
unless hIdentifier.empty?
|
62
62
|
@xml.tag!('gmd:datum') do
|
63
|
-
idClass.writeXML(hIdentifier)
|
63
|
+
idClass.writeXML(hIdentifier, 'CRS geodetic datum')
|
64
64
|
haveDatum = true
|
65
65
|
end
|
66
66
|
end
|
@@ -71,7 +71,7 @@ module ADIWG
|
|
71
71
|
hIdentifier = hParamSet[:verticalDatum][:datumIdentifier]
|
72
72
|
unless hIdentifier.empty?
|
73
73
|
@xml.tag!('gmd:datum') do
|
74
|
-
idClass.writeXML(hIdentifier)
|
74
|
+
idClass.writeXML(hIdentifier, 'CRS vertical datum')
|
75
75
|
haveDatum = true
|
76
76
|
end
|
77
77
|
end
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# 19115-2 writer output in XML
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2018-04-09 add error and warning messaging
|
5
6
|
# Stan Smith 2018-04-06 changed taxonomy to an array
|
6
7
|
# Stan Smith 2018-01-05 deprecated topicCategory[]
|
7
8
|
# Stan Smith 2018-01-05 get topics from keywords where type='isoTopicCategory'
|
@@ -14,7 +15,7 @@
|
|
14
15
|
# Stan Smith 2015-06-11 change all codelists to use 'class_codelist' method
|
15
16
|
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
16
17
|
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
17
|
-
# Stan Smith 2014-10-29 add resource time period as a
|
18
|
+
# Stan Smith 2014-10-29 add resource time period as a temporalExtent element
|
18
19
|
# Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
|
19
20
|
# Stan Smith 2014-05-21 added aggregate information section
|
20
21
|
# Stan Smith 2014-05-15 modify to support JSON schema version 0.4.0
|
@@ -27,6 +28,8 @@
|
|
27
28
|
# Stan Smith 2013-09-18 add descriptive keywords
|
28
29
|
# Stan Smith 2013-08-26 original script
|
29
30
|
|
31
|
+
require 'adiwg/mdtranslator/internal/internal_metadata_obj'
|
32
|
+
require_relative '../iso19115_2_writer'
|
30
33
|
require_relative 'class_codelist'
|
31
34
|
require_relative 'class_enumerationList'
|
32
35
|
require_relative 'class_citation'
|
@@ -54,11 +57,13 @@ module ADIWG
|
|
54
57
|
def initialize(xml, hResponseObj)
|
55
58
|
@xml = xml
|
56
59
|
@hResponseObj = hResponseObj
|
60
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_2
|
57
61
|
end
|
58
62
|
|
59
63
|
def writeXML(hData, aAssocRes, aDistInfo)
|
60
64
|
|
61
65
|
# classes used
|
66
|
+
intMetadataClass = InternalMetadata.new
|
62
67
|
codelistClass = MD_Codelist.new(@xml, @hResponseObj)
|
63
68
|
enumerationClass = MD_EnumerationList.new(@xml, @hResponseObj)
|
64
69
|
citationClass = CI_Citation.new(@xml, @hResponseObj)
|
@@ -83,11 +88,11 @@ module ADIWG
|
|
83
88
|
hCitation = hData[:citation]
|
84
89
|
unless hCitation.empty?
|
85
90
|
@xml.tag!('gmd:citation') do
|
86
|
-
citationClass.writeXML(hCitation)
|
91
|
+
citationClass.writeXML(hCitation, 'main resource citation')
|
87
92
|
end
|
88
93
|
end
|
89
94
|
if hCitation.empty?
|
90
|
-
@
|
95
|
+
@NameSpace.issueWarning(50, 'gmd:citation')
|
91
96
|
end
|
92
97
|
|
93
98
|
# data identification - abstract (required)
|
@@ -98,7 +103,7 @@ module ADIWG
|
|
98
103
|
end
|
99
104
|
end
|
100
105
|
if s.nil?
|
101
|
-
@
|
106
|
+
@NameSpace.issueWarning(51, 'gmd:abstract')
|
102
107
|
end
|
103
108
|
|
104
109
|
# data identification - purpose
|
@@ -112,6 +117,16 @@ module ADIWG
|
|
112
117
|
@xml.tag!('gmd:purpose')
|
113
118
|
end
|
114
119
|
|
120
|
+
# data identification - time period {timePeriod}
|
121
|
+
# package as a temporal extent
|
122
|
+
unless hData[:timePeriod].empty?
|
123
|
+
hExtent = intMetadataClass.newExtent
|
124
|
+
hTempExtent = intMetadataClass.newTemporalExtent
|
125
|
+
hTempExtent[:timePeriod] = hData[:timePeriod]
|
126
|
+
hExtent[:temporalExtents] << hTempExtent
|
127
|
+
hData[:extents] << hExtent
|
128
|
+
end
|
129
|
+
|
115
130
|
# data identification - credit []
|
116
131
|
aCredits = hData[:credits]
|
117
132
|
aCredits.each do |credit|
|
@@ -141,19 +156,19 @@ module ADIWG
|
|
141
156
|
aParties = hRParty[:parties]
|
142
157
|
aParties.each do |hParty|
|
143
158
|
@xml.tag!('gmd:pointOfContact') do
|
144
|
-
rPartyClass.writeXML(role, hParty)
|
159
|
+
rPartyClass.writeXML(role, hParty, 'data resource point of contact')
|
145
160
|
end
|
146
161
|
end
|
147
162
|
end
|
148
163
|
if aRParties.empty? && @hResponseObj[:writerShowTags]
|
149
|
-
@
|
164
|
+
@NameSpace.issueWarning(52, 'gmd:pointOfContact')
|
150
165
|
end
|
151
166
|
|
152
167
|
# data identification - resource maintenance []
|
153
168
|
aMaint = hData[:resourceMaintenance]
|
154
169
|
aMaint.each do |hMaint|
|
155
170
|
@xml.tag!('gmd:resourceMaintenance') do
|
156
|
-
mInfoClass.writeXML(hMaint)
|
171
|
+
mInfoClass.writeXML(hMaint, 'data resource')
|
157
172
|
end
|
158
173
|
end
|
159
174
|
if aMaint.empty? && @hResponseObj[:writerShowTags]
|
@@ -164,7 +179,7 @@ module ADIWG
|
|
164
179
|
aGraphics = hData[:graphicOverviews]
|
165
180
|
aGraphics.each do |hGraphic|
|
166
181
|
@xml.tag!('gmd:graphicOverview') do
|
167
|
-
bGraphicClass.writeXML(hGraphic)
|
182
|
+
bGraphicClass.writeXML(hGraphic, 'data resource')
|
168
183
|
end
|
169
184
|
end
|
170
185
|
if aGraphics.empty? && @hResponseObj[:writerShowTags]
|