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
@@ -2,48 +2,48 @@
|
|
2
2
|
# 19115-2 writer output in XML
|
3
3
|
|
4
4
|
# History:
|
5
|
-
#
|
5
|
+
# Stan Smith 2016-12-09 original script.
|
6
6
|
|
7
7
|
require_relative 'class_citation'
|
8
8
|
|
9
9
|
module ADIWG
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
10
|
+
module Mdtranslator
|
11
|
+
module Writers
|
12
|
+
module Iso19115_2
|
13
|
+
|
14
|
+
class TaxonomicSystem
|
15
|
+
|
16
|
+
def initialize(xml, hResponseObj)
|
17
|
+
@xml = xml
|
18
|
+
@hResponseObj = hResponseObj
|
19
|
+
end
|
20
|
+
|
21
|
+
def writeXML(hSystem)
|
22
|
+
|
23
|
+
# classes used
|
24
|
+
citationClass = CI_Citation.new(@xml, @hResponseObj)
|
25
|
+
|
26
|
+
# taxon system - citation {CI_Citation}
|
27
|
+
hCitation = hSystem[:citation]
|
28
|
+
unless hCitation.empty?
|
29
|
+
citationClass.writeXML(hCitation, 'taxonomic system')
|
30
|
+
end
|
31
|
+
|
32
|
+
# taxon system - modifications
|
33
|
+
s = hSystem[:modifications]
|
34
|
+
unless s.nil?
|
35
|
+
@xml.tag!('gmd:classmod') do
|
36
|
+
@xml.tag!('gco:CharacterString', s)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
if s.nil? && @hResponseObj[:writerShowTags]
|
40
|
+
@xml.tag!('gmd:classmod')
|
41
|
+
end
|
42
|
+
|
43
|
+
end # writeXML
|
44
|
+
end # TaxonomicSystem class
|
45
|
+
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
49
|
end
|
@@ -2,14 +2,16 @@
|
|
2
2
|
# 19115-2 writer output in XML
|
3
3
|
|
4
4
|
# History:
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
5
|
+
# Stan Smith 2018-04-10 add error and warning messaging
|
6
|
+
# Stan Smith 2016-12-09 refactored for mdTranslator/mdJson 2.0
|
7
|
+
# Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
|
8
|
+
# Stan Smith 2015-07-14 refactored to make iso19110 independent of iso19115_2 classes
|
9
|
+
# Stan Smith 2015-06-22 replace global ($response) with passed in object (hResponseObj)
|
10
|
+
# Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
|
11
|
+
# Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
|
11
12
|
# Stan Smith 2013-11-19 original script.
|
12
13
|
|
14
|
+
require_relative '../iso19115_2_writer'
|
13
15
|
require_relative 'class_taxonomicSystem'
|
14
16
|
require_relative 'class_rsIdentifier'
|
15
17
|
require_relative 'class_responsibleParty'
|
@@ -17,128 +19,129 @@ require_relative 'class_vouchers'
|
|
17
19
|
require_relative 'class_taxonomicClassification'
|
18
20
|
|
19
21
|
module ADIWG
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
22
|
+
module Mdtranslator
|
23
|
+
module Writers
|
24
|
+
module Iso19115_2
|
25
|
+
|
26
|
+
class MD_TaxonSys
|
27
|
+
|
28
|
+
def initialize(xml, hResponseObj)
|
29
|
+
@xml = xml
|
30
|
+
@hResponseObj = hResponseObj
|
31
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_2
|
32
|
+
end
|
33
|
+
|
34
|
+
def writeXML(hSystem)
|
35
|
+
|
36
|
+
# classes used
|
37
|
+
taxonomicClass = TaxonomicSystem.new(@xml, @hResponseObj)
|
38
|
+
identifierClass = RS_Identifier.new(@xml, @hResponseObj)
|
39
|
+
partyClass = CI_ResponsibleParty.new(@xml, @hResponseObj)
|
40
|
+
voucherClass = MD_Vouchers.new(@xml, @hResponseObj)
|
41
|
+
taxonClass = MD_TaxonCl.new(@xml, @hResponseObj)
|
42
|
+
|
43
|
+
@xml.tag!('gmd:MD_TaxonSys') do
|
44
|
+
|
45
|
+
# taxon system - classification system (required) [{TaxonomicSystem}]
|
46
|
+
aSystems = hSystem[:taxonSystem]
|
47
|
+
aSystems.each do |hSystem|
|
48
|
+
@xml.tag!('gmd:classSys') do
|
49
|
+
taxonomicClass.writeXML(hSystem)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
if aSystems.empty?
|
53
|
+
@NameSpace.issueWarning(310, 'gmd:classSys')
|
54
|
+
end
|
55
|
+
|
56
|
+
# taxon system - general scope
|
57
|
+
s = hSystem[:generalScope]
|
58
|
+
unless s.nil?
|
59
|
+
@xml.tag!('gmd:taxongen') do
|
60
|
+
@xml.tag!('gco:CharacterString', s)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
if s.nil? && @hResponseObj[:writerShowTags]
|
64
|
+
@xml.tag!('gmd:taxongen')
|
65
|
+
end
|
66
|
+
|
67
|
+
# taxon system - identification reference (required) [{RS_Identifier}]
|
68
|
+
aIdentifier = hSystem[:idReferences]
|
69
|
+
aIdentifier.each do |hIdentifier|
|
70
|
+
unless hIdentifier.empty?
|
71
|
+
@xml.tag!('gmd:idref') do
|
72
|
+
identifierClass.writeXML(hIdentifier, 'taxon identification reference')
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
if aIdentifier.empty?
|
77
|
+
@NameSpace.issueWarning(311, 'gmd:idref')
|
78
|
+
end
|
79
|
+
|
80
|
+
# taxon system - observers [{CI_ResponsibleParty}]
|
81
|
+
aObservers = hSystem[:observers]
|
82
|
+
aObservers.each do |hObserver|
|
83
|
+
role = hObserver[:roleName]
|
84
|
+
aParties = hObserver[:parties]
|
85
|
+
aParties.each do |hParty|
|
86
|
+
@xml.tag!('gmd:obs') do
|
87
|
+
partyClass.writeXML(role, hParty, 'taxon observer')
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
if aObservers.empty? && @hResponseObj[:writerShowTags]
|
92
|
+
@xml.tag!('gmd:obs')
|
93
|
+
end
|
94
|
+
|
95
|
+
# taxon system - taxon identification procedures (required)
|
96
|
+
s = hSystem[:idProcedure]
|
97
|
+
if s.nil?
|
98
|
+
@NameSpace.issueWarning(313, 'gmd:taxonpro')
|
99
|
+
else
|
100
|
+
@xml.tag!('gmd:taxonpro') do
|
101
|
+
@xml.tag!('gco:CharacterString', s)
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
# taxon system - completeness
|
106
|
+
s = hSystem[:idCompleteness]
|
107
|
+
unless s.nil?
|
108
|
+
@xml.tag!('gmd:taxoncom') do
|
109
|
+
@xml.tag!('gco:CharacterString', s)
|
110
|
+
end
|
111
|
+
end
|
112
|
+
if s.nil? && @hResponseObj[:writerShowTags]
|
113
|
+
@xml.tag!('gmd:taxoncom')
|
114
|
+
end
|
115
|
+
|
116
|
+
# taxon system - voucher {MD_Voucher}
|
117
|
+
aVouchers = hSystem[:vouchers]
|
118
|
+
unless aVouchers.empty?
|
119
|
+
unless aVouchers[0].nil?
|
120
|
+
@xml.tag!('gmd:voucher') do
|
121
|
+
voucherClass.writeXML(aVouchers[0])
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
125
|
+
if aVouchers.empty? && @hResponseObj[:writerShowTags]
|
126
|
+
@xml.tag!('gmd:voucher')
|
127
|
+
end
|
128
|
+
|
129
|
+
# taxon system - taxonomy classification [] (required)
|
130
|
+
hTaxClass = hSystem[:taxonClass]
|
131
|
+
unless hTaxClass.empty?
|
132
|
+
@xml.tag!('gmd:taxonCl') do
|
133
|
+
taxonClass.writeXML(hTaxClass)
|
134
|
+
end
|
135
|
+
end
|
136
|
+
if hTaxClass.empty?
|
137
|
+
@NameSpace.issueWarning(314, 'gmd:taxonCl')
|
138
|
+
end
|
139
|
+
|
140
|
+
end # gmd:MD_TaxonSys tag
|
141
|
+
end # writeXML
|
142
|
+
end # MD_TaxonSys class
|
143
|
+
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end
|
144
147
|
end
|
@@ -2,59 +2,59 @@
|
|
2
2
|
# 19115-2 writer output in XML
|
3
3
|
|
4
4
|
# History:
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
5
|
+
# Stan Smith 2016-12-01 refactored for mdTranslator/mdJson 2.0
|
6
|
+
# Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
|
7
|
+
# Stan Smith 2015-07-14 refactored to make iso19110 independent of iso19115_2 classes
|
8
|
+
# Stan Smith 2015-06-22 replace global ($response) with passed in object (hResponseObj)
|
9
|
+
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
10
|
+
# Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
|
11
|
+
# Stan Smith 2014-06-03 add support for date as time instant
|
12
12
|
# Stan Smith 2013-11-15 original script
|
13
13
|
|
14
14
|
require_relative 'class_timeInstant'
|
15
15
|
require_relative 'class_timePeriod'
|
16
16
|
|
17
17
|
module ADIWG
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
18
|
+
module Mdtranslator
|
19
|
+
module Writers
|
20
|
+
module Iso19115_2
|
21
|
+
|
22
|
+
class EX_TemporalExtent
|
23
|
+
|
24
|
+
def initialize(xml, hResponseObj)
|
25
|
+
@xml = xml
|
26
|
+
@hResponseObj = hResponseObj
|
27
|
+
end
|
28
|
+
|
29
|
+
def writeXML(hTempEle)
|
30
|
+
|
31
|
+
# classes used
|
32
|
+
timeInstClass = TimeInstant.new(@xml, @hResponseObj)
|
33
|
+
timePeriodClass = TimePeriod.new(@xml, @hResponseObj)
|
34
|
+
|
35
|
+
@xml.tag!('gmd:EX_TemporalExtent') do
|
36
|
+
|
37
|
+
# temporal extent - time instant
|
38
|
+
hTimeInst = hTempEle[:timeInstant]
|
39
|
+
unless hTimeInst.empty?
|
40
|
+
@xml.tag!('gmd:extent') do
|
41
|
+
timeInstClass.writeXML(hTimeInst)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# temporal extent - time period
|
46
|
+
hTimePeriod = hTempEle[:timePeriod]
|
47
|
+
unless hTimePeriod.empty?
|
48
|
+
@xml.tag!('gmd:extent') do
|
49
|
+
timePeriodClass.writeXML(hTimePeriod)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
end # EX_TemporalExtent tag
|
54
|
+
end # writeXML
|
55
|
+
end # EX_TemporalExtent class
|
56
|
+
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
60
|
end
|