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.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -1
  3. data/adiwg-mdtranslator.gemspec +1 -1
  4. data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +2 -0
  5. data/lib/adiwg/mdtranslator/readers/fgdc/fgdc_reader.rb +4 -0
  6. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityAttribute.rb +1 -1
  7. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_georectifiedRepresentation.rb +7 -12
  8. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceInfo.rb +12 -11
  9. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_source.rb +15 -7
  10. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomy.rb +1 -6
  11. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_timePeriod.rb +15 -1
  12. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_transferOption.rb +1 -3
  13. data/lib/adiwg/mdtranslator/version.rb +5 -1
  14. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_citation.rb +1 -1
  15. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_contact.rb +4 -2
  16. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicAge.rb +1 -1
  17. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_identification.rb +1 -1
  18. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_method.rb +1 -1
  19. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_source.rb +1 -1
  20. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomyKeywords.rb +4 -4
  21. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomySystem.rb +1 -1
  22. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_fcFeatureCatalogue.rb +7 -7
  23. data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb +6 -5
  24. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_address.rb +104 -104
  25. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_aggregateInformation.rb +63 -60
  26. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/{class_attributeGroup.rb → class_attribute.rb} +1 -1
  27. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_baseUnit.rb +23 -23
  28. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_boundingBox.rb +64 -60
  29. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_browseGraphic.rb +55 -51
  30. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_citation.rb +24 -14
  31. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_contact.rb +96 -91
  32. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_conventionalUnit.rb +45 -45
  33. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_coverageDescription.rb +104 -77
  34. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_crs.rb +4 -4
  35. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataIdentification.rb +23 -8
  36. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataQuality.rb +57 -52
  37. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_date.rb +49 -46
  38. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_definitionUnit.rb +20 -20
  39. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_derivedUnit.rb +32 -32
  40. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dimension.rb +56 -50
  41. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_distribution.rb +1 -1
  42. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_distributor.rb +77 -74
  43. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_enumerationList.rb +34 -34
  44. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_extension.rb +190 -186
  45. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_extent.rb +66 -66
  46. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_feature.rb +50 -45
  47. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_featureCollection.rb +35 -35
  48. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_featureProperties.rb +43 -43
  49. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_format.rb +73 -69
  50. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_fraction.rb +37 -33
  51. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geographicElement.rb +59 -54
  52. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geographicExtent.rb +58 -58
  53. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geometricObjects.rb +49 -46
  54. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geometryCollection.rb +68 -63
  55. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_georectified.rb +113 -110
  56. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_georeferenceable.rb +78 -75
  57. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gmlIdentifier.rb +17 -17
  58. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_grid.rb +55 -52
  59. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gridRepresentation.rb +19 -19
  60. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_hierarchy.rb +47 -47
  61. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_image.rb +132 -132
  62. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_keyword.rb +5 -2
  63. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_lineString.rb +70 -70
  64. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_lineage.rb +55 -55
  65. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_locale.rb +51 -48
  66. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_maintenance.rb +114 -105
  67. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_mdBand.rb +111 -111
  68. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_mdIdentifier.rb +9 -3
  69. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_measure.rb +58 -41
  70. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_medium.rb +104 -104
  71. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_miBand.rb +70 -70
  72. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_miMetadata.rb +51 -16
  73. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_multiLine.rb +70 -70
  74. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_multiPoint.rb +70 -70
  75. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_multiPolygon.rb +70 -70
  76. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_onlineResource.rb +79 -76
  77. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_orderProcess.rb +67 -67
  78. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_phone.rb +67 -67
  79. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_point.rb +8 -8
  80. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_polygon.rb +89 -89
  81. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_processStep.rb +9 -3
  82. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_rangeDimension.rb +59 -54
  83. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_referenceSystem.rb +1 -1
  84. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_resolution.rb +47 -47
  85. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_responsibleParty.rb +111 -105
  86. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_rsIdentifier.rb +71 -65
  87. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_scope.rb +54 -50
  88. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_scopeDescription.rb +45 -42
  89. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_securityConstraints.rb +92 -89
  90. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_series.rb +55 -55
  91. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_source.rb +98 -91
  92. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_spatialRepresentation.rb +42 -42
  93. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_taxonomicClassification.rb +63 -59
  94. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_taxonomicSystem.rb +40 -40
  95. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_taxonomy.rb +133 -130
  96. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_temporalExtent.rb +49 -49
  97. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_timeInstant.rb +60 -60
  98. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_timePeriod.rb +110 -108
  99. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_transferOptions.rb +71 -69
  100. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_unitsOfMeasure.rb +243 -243
  101. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_usage.rb +98 -95
  102. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_useConstraints.rb +38 -38
  103. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_vectorRepresentation.rb +48 -48
  104. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_verticalExtent.rb +74 -70
  105. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_vouchers.rb +56 -53
  106. data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer.rb +61 -11
  107. data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer_messages_eng.yml +109 -0
  108. data/lib/adiwg/mdtranslator/writers/iso19115_2/version.rb +3 -2
  109. data/lib/adiwg/mdtranslator_cli.rb +21 -4
  110. metadata +6 -5
@@ -2,48 +2,48 @@
2
2
  # 19115-2 writer output in XML
3
3
 
4
4
  # History:
5
- # Stan Smith 2016-12-09 original script.
5
+ # Stan Smith 2016-12-09 original script.
6
6
 
7
7
  require_relative 'class_citation'
8
8
 
9
9
  module ADIWG
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 (required) {CI_Citation}
27
- hCitation = hSystem[:citation]
28
- unless hCitation.empty?
29
- citationClass.writeXML(hCitation)
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
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
- # Stan Smith 2016-12-09 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-15 refactored to handle namespacing readers and writers
10
- # Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
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
- module Mdtranslator
21
- module Writers
22
- module Iso19115_2
23
-
24
- class MD_TaxonSys
25
-
26
- def initialize(xml, hResponseObj)
27
- @xml = xml
28
- @hResponseObj = hResponseObj
29
- end
30
-
31
- def writeXML(hSystem)
32
-
33
- # classes used
34
- taxonomicClass = TaxonomicSystem.new(@xml, @hResponseObj)
35
- identifierClass = RS_Identifier.new(@xml, @hResponseObj)
36
- partyClass = CI_ResponsibleParty.new(@xml, @hResponseObj)
37
- voucherClass = MD_Vouchers.new(@xml, @hResponseObj)
38
- taxonClass = MD_TaxonCl.new(@xml, @hResponseObj)
39
-
40
- @xml.tag!('gmd:MD_TaxonSys') do
41
-
42
- # taxon system - classification system (required) [{TaxonomicSystem}]
43
- aSystems = hSystem[:taxonSystem]
44
- aSystems.each do |hSystem|
45
- @xml.tag!('gmd:classSys') do
46
- taxonomicClass.writeXML(hSystem)
47
- end
48
- end
49
- if aSystems.empty?
50
- @xml.tag!('gmd:classSys', {'gco:nilReason' => 'missing'})
51
- end
52
-
53
- # taxon system - general scope
54
- s = hSystem[:generalScope]
55
- unless s.nil?
56
- @xml.tag!('gmd:taxongen') do
57
- @xml.tag!('gco:CharacterString', s)
58
- end
59
- end
60
- if s.nil? && @hResponseObj[:writerShowTags]
61
- @xml.tag!('gmd:taxongen')
62
- end
63
-
64
- # taxon system - identification reference (required) [{RS_Identifier}]
65
- aIdentifier = hSystem[:idReferences]
66
- aIdentifier.each do |hIdentifier|
67
- unless hIdentifier.empty?
68
- @xml.tag!('gmd:idref') do
69
- identifierClass.writeXML(hIdentifier)
70
- end
71
- end
72
- end
73
- if aIdentifier.empty?
74
- @xml.tag!('gmd:idref', {'gco:nilReason' => 'missing'})
75
- end
76
-
77
- # taxon system - observers [{CI_ResponsibleParty}]
78
- aObservers = hSystem[:observers]
79
- aObservers.each do |hObserver|
80
- role = hObserver[:roleName]
81
- aParties = hObserver[:parties]
82
- aParties.each do |hParty|
83
- @xml.tag!('gmd:obs') do
84
- partyClass.writeXML(role, hParty)
85
- end
86
- end
87
- end
88
- if aObservers.empty?
89
- @xml.tag!('gmd:obs', {'gco:nilReason' => 'missing'})
90
- end
91
-
92
- # taxon system - taxon identification procedures (required)
93
- s = hSystem[:idProcedure]
94
- if s.nil?
95
- @xml.tag!('gmd:taxonpro', {'gco:nilReason' => 'missing'})
96
- else
97
- @xml.tag!('gmd:taxonpro') do
98
- @xml.tag!('gco:CharacterString', s)
99
- end
100
- end
101
-
102
- # taxon system - completeness
103
- s = hSystem[:idCompleteness]
104
- unless s.nil?
105
- @xml.tag!('gmd:taxoncom') do
106
- @xml.tag!('gco:CharacterString', s)
107
- end
108
- end
109
- if s.nil? && @hResponseObj[:writerShowTags]
110
- @xml.tag!('gmd:taxoncom')
111
- end
112
-
113
- # taxon system - voucher {MD_Voucher}
114
- aVouchers = hSystem[:vouchers]
115
- unless aVouchers.empty?
116
- unless aVouchers[0].nil?
117
- @xml.tag!('gmd:voucher') do
118
- voucherClass.writeXML(aVouchers[0])
119
- end
120
- end
121
- end
122
- if aVouchers.empty? && @hResponseObj[:writerShowTags]
123
- @xml.tag!('gmd:voucher')
124
- end
125
-
126
- # taxon system - taxonomy classification [] (required)
127
- hTaxClass = hSystem[:taxonClass]
128
- unless hTaxClass.empty?
129
- @xml.tag!('gmd:taxonCl') do
130
- taxonClass.writeXML(hTaxClass)
131
- end
132
- end
133
- if hTaxClass.empty?
134
- @xml.tag!('gmd:taxonCl', {'gco:nilReason' => 'missing'})
135
- end
136
-
137
- end # gmd:MD_TaxonSys tag
138
- end # writeXML
139
- end # MD_TaxonSys class
140
-
141
- end
142
- end
143
- end
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
- # 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
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
- 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
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