adiwg-mdtranslator 2.14.2 → 2.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -1
  3. data/CHANGELOG.md +20 -5
  4. data/Rakefile +2 -0
  5. data/adiwg-mdtranslator.gemspec +2 -1
  6. data/lib/adiwg/mdtranslator.rb +1 -0
  7. data/lib/adiwg/mdtranslator/internal/module_codelistFun.rb +26 -0
  8. data/lib/adiwg/mdtranslator/internal/module_coordinates.rb +3 -0
  9. data/lib/adiwg/mdtranslator/internal/module_dateTimeFun.rb +1 -1
  10. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_date.rb +0 -1
  11. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_dateTime.rb +0 -1
  12. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_keyword.rb +1 -1
  13. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonSystem.rb +2 -4
  14. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_contact.rb +0 -1
  15. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_date.rb +0 -2
  16. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dateTime.rb +0 -2
  17. data/lib/adiwg/mdtranslator/readers/sbJson/modules/module_provenance.rb +0 -1
  18. data/lib/adiwg/mdtranslator/version.rb +3 -2
  19. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_attribute.rb +0 -1
  20. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_citation.rb +0 -1
  21. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dateRange.rb +0 -1
  22. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dateSingle.rb +0 -1
  23. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_method.rb +1 -1
  24. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_methodKeywords.rb +1 -1
  25. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_process.rb +0 -1
  26. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_transferInfo.rb +0 -1
  27. data/lib/adiwg/mdtranslator/writers/html/sections/html_taxonomy.rb +1 -3
  28. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_additionalDocument.rb +48 -0
  29. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_address.rb +90 -0
  30. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_associatedResource.rb +84 -0
  31. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_attribute.rb +107 -0
  32. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_attributeGroup.rb +69 -0
  33. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_baseUnit.rb +38 -0
  34. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_boundingBox.rb +70 -0
  35. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_browseGraphic.rb +95 -0
  36. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_citation.rb +205 -0
  37. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_codelist.rb +50 -0
  38. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_constraint.rb +51 -0
  39. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_constraintCommon.rb +104 -0
  40. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_contact.rb +119 -0
  41. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_conventionalUnit.rb +64 -0
  42. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_coverageDescription.rb +84 -0
  43. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_dataIdentification.rb +347 -0
  44. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_date.rb +62 -0
  45. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_definitionUnit.rb +35 -0
  46. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_derivedUnit.rb +42 -0
  47. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_dimension.rb +72 -0
  48. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_distribution.rb +62 -0
  49. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_distributor.rb +77 -0
  50. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_email.rb +44 -0
  51. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_extent.rb +85 -0
  52. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_feature.rb +71 -0
  53. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_featureCollection.rb +56 -0
  54. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_featureProperties.rb +64 -0
  55. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_format.rb +74 -0
  56. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_fraction.rb +46 -0
  57. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_gcoDateTime.rb +45 -0
  58. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_geographicElement.rb +77 -0
  59. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_geographicExtent.rb +96 -0
  60. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_geometricObjects.rb +60 -0
  61. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_geometryCollection.rb +97 -0
  62. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_georectified.rb +121 -0
  63. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_georeferenceable.rb +87 -0
  64. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_gmlIdentifier.rb +32 -0
  65. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_grid.rb +71 -0
  66. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_gridRepresentation.rb +36 -0
  67. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_identifier.rb +95 -0
  68. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_imageDescription.rb +175 -0
  69. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_individual.rb +85 -0
  70. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_keyword.rb +78 -0
  71. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_legalConstraints.rb +87 -0
  72. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_lineString.rb +76 -0
  73. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_lineage.rb +97 -0
  74. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_locale.rb +67 -0
  75. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_maintenance.rb +101 -0
  76. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_mdBand.rb +82 -0
  77. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_mdMetadata.rb +372 -0
  78. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_measure.rb +71 -0
  79. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_medium.rb +113 -0
  80. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_miBand.rb +90 -0
  81. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_multiLine.rb +84 -0
  82. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_multiPoint.rb +84 -0
  83. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_multiPolygon.rb +84 -0
  84. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_onlineResource.rb +91 -0
  85. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_orderProcess.rb +79 -0
  86. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_organization.rb +106 -0
  87. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_phone.rb +81 -0
  88. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_point.rb +77 -0
  89. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_polygon.rb +95 -0
  90. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_processStep.rb +130 -0
  91. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_rangeDimension.rb +94 -0
  92. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_referenceSystem.rb +92 -0
  93. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_releasability.rb +71 -0
  94. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_resolution.rb +97 -0
  95. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_responsibility.rb +91 -0
  96. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_sampleDimension.rb +127 -0
  97. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_scope.rb +75 -0
  98. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_scopeDescription.rb +75 -0
  99. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_securityConstraints.rb +97 -0
  100. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_series.rb +63 -0
  101. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_source.rb +125 -0
  102. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_spatialRepresentation.rb +61 -0
  103. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_temporalExtent.rb +53 -0
  104. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_timeInstant.rb +80 -0
  105. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_timePeriod.rb +113 -0
  106. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_transferOptions.rb +107 -0
  107. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_unitsOfMeasure.rb +258 -0
  108. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_usage.rb +134 -0
  109. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_useConstraints.rb +41 -0
  110. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_vectorRepresentation.rb +61 -0
  111. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_verticalExtent.rb +70 -0
  112. data/lib/adiwg/mdtranslator/writers/iso19115_1/iso19115_1_writer.rb +105 -0
  113. data/lib/adiwg/mdtranslator/writers/iso19115_1/iso19115_1_writer_messages_eng.yml +132 -0
  114. data/lib/adiwg/mdtranslator/writers/iso19115_1/readme.md +12 -0
  115. data/lib/adiwg/mdtranslator/writers/iso19115_1/version.rb +15 -0
  116. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_citation.rb +3 -2
  117. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataIdentification.rb +42 -39
  118. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataQuality.rb +2 -2
  119. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_distributor.rb +3 -1
  120. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_extension.rb +12 -7
  121. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_miMetadata.rb +2 -3
  122. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_referenceSystem.rb +1 -1
  123. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_resolution.rb +1 -1
  124. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_responsibleParty.rb +42 -35
  125. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_spatialRepresentation.rb +4 -10
  126. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_useConstraints.rb +1 -1
  127. data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer_messages_eng.yml +5 -0
  128. data/lib/adiwg/mdtranslator/writers/iso19115_2/readme.md +2 -2
  129. data/lib/adiwg/mdtranslator/writers/iso19115_2/version.rb +1 -1
  130. data/lib/adiwg/mdtranslator/writers/mdWriters.rb +7 -7
  131. data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_citation.rb +0 -1
  132. data/lib/adiwg/mdtranslator_cli.rb +2 -1
  133. metadata +93 -5
  134. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_gmlIdentifier.rb +0 -55
@@ -0,0 +1,36 @@
1
+ # ISO <<Class>> MD_GridSpatialRepresentation
2
+ # writer output in XML
3
+
4
+ # History:
5
+ # Stan Smith 2019-04-16 original script.
6
+
7
+ require_relative 'class_grid'
8
+
9
+ module ADIWG
10
+ module Mdtranslator
11
+ module Writers
12
+ module Iso19115_1
13
+
14
+ class MD_GridSpatialRepresentation
15
+
16
+ def initialize(xml, hResponseObj)
17
+ @xml = xml
18
+ @hResponseObj = hResponseObj
19
+ end
20
+
21
+ def writeXML(hGrid, inContext = nil)
22
+
23
+ # classes used
24
+ gridClass = Grid.new(@xml, @hResponseObj)
25
+
26
+ @xml.tag!('msr:MD_GridSpatialRepresentation') do
27
+ gridClass.writeXML(hGrid, 'grid representation')
28
+ end
29
+
30
+ end # writeXML
31
+ end # MD_GridRepresentation class
32
+
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,95 @@
1
+ # ISO <<Class>> MD_Identifier
2
+ # 19115-3 output for ISO 19115-1 XML
3
+
4
+ # History:
5
+ # Stan Smith 2019-03-13 original script
6
+
7
+ require_relative '../iso19115_1_writer'
8
+ require_relative 'class_citation'
9
+
10
+ module ADIWG
11
+ module Mdtranslator
12
+ module Writers
13
+ module Iso19115_1
14
+
15
+ class MD_Identifier
16
+
17
+ def initialize(xml, hResponseObj)
18
+ @xml = xml
19
+ @hResponseObj = hResponseObj
20
+ @NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_1
21
+ end
22
+
23
+ def writeXML(hIdentifier, inContext = nil)
24
+
25
+ outContext = 'identifier'
26
+ outContext = inContext + ' authority' unless inContext.nil?
27
+
28
+ # classes used in MD_Metadata
29
+ citationClass = CI_Citation.new(@xml, @hResponseObj)
30
+
31
+ @xml.tag!('mcc:MD_Identifier') do
32
+
33
+ # identifier - authority {CI_Citation}
34
+ hCitation = hIdentifier[:citation]
35
+ unless hCitation.empty?
36
+ @xml.tag!('mcc:authority') do
37
+ citationClass.writeXML(hCitation, outContext)
38
+ end
39
+ end
40
+ if hCitation.empty? && @hResponseObj[:writerShowTags]
41
+ @xml.tag!('mcc:authority')
42
+ end
43
+
44
+ # identifier - code (required)
45
+ s = hIdentifier[:identifier]
46
+ unless s.nil?
47
+ @xml.tag!('mcc:code') do
48
+ @xml.tag!('gco:CharacterString', s)
49
+ end
50
+ end
51
+ if s.nil?
52
+ @NameSpace.issueWarning(230, 'mcc:code', inContext)
53
+ end
54
+
55
+ # identifier - codeSpace
56
+ s = hIdentifier[:namespace]
57
+ unless s.nil?
58
+ @xml.tag!('mcc:codeSpace') do
59
+ @xml.tag!('gco:CharacterString', s)
60
+ end
61
+ end
62
+ if s.nil? && @hResponseObj[:writerShowTags]
63
+ @xml.tag!('mcc:codeSpace')
64
+ end
65
+
66
+ # identifier - codeSpace version
67
+ s = hIdentifier[:version]
68
+ unless s.nil?
69
+ @xml.tag!('mcc:version') do
70
+ @xml.tag!('gco:CharacterString', s)
71
+ end
72
+ end
73
+ if s.nil? && @hResponseObj[:writerShowTags]
74
+ @xml.tag!('mcc:version')
75
+ end
76
+
77
+ # identifier - description
78
+ s = hIdentifier[:description]
79
+ unless s.nil?
80
+ @xml.tag!('mcc:description') do
81
+ @xml.tag!('gco:CharacterString', s)
82
+ end
83
+ end
84
+ if s.nil? && @hResponseObj[:writerShowTags]
85
+ @xml.tag!('mcc:description')
86
+ end
87
+
88
+ end # MD_Identifier tag
89
+ end # writeXML
90
+ end # MD_Identifier class
91
+
92
+ end
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,175 @@
1
+ # ISO <<Class>> image description
2
+ # 19115-1 writer output in XML
3
+
4
+ # History:
5
+ # Stan Smith 2019-04-08 original script
6
+
7
+ require_relative 'class_codelist'
8
+ require_relative 'class_identifier'
9
+ require_relative 'class_attributeGroup'
10
+
11
+ module ADIWG
12
+ module Mdtranslator
13
+ module Writers
14
+ module Iso19115_1
15
+
16
+ class MD_ImageDescription
17
+
18
+ def initialize(xml, hResponseObj)
19
+ @xml = xml
20
+ @hResponseObj = hResponseObj
21
+ end
22
+
23
+ def writeXML(hCoverage, inContext = nil)
24
+
25
+ # classes used
26
+ codelistClass = MD_Codelist.new(@xml, @hResponseObj)
27
+ identifierClass = MD_Identifier.new(@xml, @hResponseObj)
28
+ groupClass = MD_AttributeGroup.new(@xml, @hResponseObj)
29
+
30
+ outContext = 'content coverage image description'
31
+
32
+ unless hCoverage.empty?
33
+ @xml.tag!('mrc:MD_ImageDescription') do
34
+
35
+ # image description - attribute description (required)
36
+ # combine coverageName and coverageDescription
37
+ attDesc = ''
38
+ unless hCoverage[:coverageName].nil?
39
+ attDesc += hCoverage[:coverageName] + '; '
40
+ end
41
+ unless hCoverage[:coverageDescription].nil?
42
+ attDesc += hCoverage[:coverageDescription]
43
+ end
44
+ unless attDesc == ''
45
+ @xml.tag!('mrc:attributeDescription') do
46
+ @xml.tag!('gco:RecordType', attDesc)
47
+ end
48
+ end
49
+ if attDesc == ''
50
+ @NameSpace.issueWarning(40, 'mrc:attributeDescription')
51
+ end
52
+
53
+ # image description - processing level code {MD_Identifier}
54
+ unless hCoverage[:processingLevelCode].empty?
55
+ @xml.tag!('mrc:processingLevelCode') do
56
+ identifierClass.writeXML(hCoverage[:processingLevelCode], outContext+' processing level')
57
+ end
58
+ if hCoverage[:processingLevelCode].empty? && @hResponseObj[:writerShowTags]
59
+ @xml.tag!('mrc:processingLevelCode')
60
+ end
61
+ end
62
+
63
+ # image description - attribute group [] {MD_AttributeGroup}
64
+ aGroups = hCoverage[:attributeGroups]
65
+ aGroups.each do |hGroup|
66
+ unless hGroup.empty?
67
+ @xml.tag!('mrc:attributeGroup') do
68
+ groupClass.writeXML(hGroup, outContext)
69
+ end
70
+ end
71
+ end
72
+ if aGroups.empty? && @hResponseObj[:writerShowTags]
73
+ @xml.tag!('mrc:attributeGroup')
74
+ end
75
+
76
+ hImage = hCoverage[:imageDescription]
77
+ unless hImage.empty?
78
+
79
+ # image description - illumination elevation angle
80
+ unless hImage[:illuminationElevationAngle].nil?
81
+ @xml.tag!('mrc:illuminationElevationAngle') do
82
+ @xml.tag!('gco:Real', hImage[:illuminationElevationAngle])
83
+ end
84
+ end
85
+ if hImage[:illuminationElevationAngle].nil? && @hResponseObj[:writerShowTags]
86
+ @xml.tag!('mrc:illuminationElevationAngle')
87
+ end
88
+
89
+ # image description - illumination azimuth angle
90
+ unless hImage[:illuminationAzimuthAngle].nil?
91
+ @xml.tag!('mrc:illuminationAzimuthAngle') do
92
+ @xml.tag!('gco:Real', hImage[:illuminationAzimuthAngle])
93
+ end
94
+ end
95
+ if hImage[:illuminationAzimuthAngle].nil? && @hResponseObj[:writerShowTags]
96
+ @xml.tag!('mrc:illuminationAzimuthAngle')
97
+ end
98
+
99
+ # image description - image condition {MD_ImageConditionCode}
100
+ unless hImage[:imagingCondition].nil?
101
+ @xml.tag!('mrc:imagingCondition') do
102
+ codelistClass.writeXML('mrc', 'iso_imageCondition', hImage[:imagingCondition])
103
+ end
104
+ end
105
+ if hImage[:imagingCondition].nil? && @hResponseObj[:writerShowTags]
106
+ @xml.tag!('mrc:imagingCondition')
107
+ end
108
+
109
+ # image description - image quality code {MD_Identifier}
110
+ unless hImage[:imageQualityCode].empty?
111
+ @xml.tag!('mrc:imageQualityCode') do
112
+ identifierClass.writeXML(hImage[:imageQualityCode], 'image quality code')
113
+ end
114
+ end
115
+ if hImage[:imageQualityCode].empty? && @hResponseObj[:writerShowTags]
116
+ @xml.tag!('mrc:imageQualityCode')
117
+ end
118
+
119
+ # image description - cloud cover percentage
120
+ unless hImage[:cloudCoverPercent].nil?
121
+ @xml.tag!('mrc:cloudCoverPercentage') do
122
+ @xml.tag!('gco:Real', hImage[:cloudCoverPercent])
123
+ end
124
+ end
125
+ if hImage[:cloudCoverPercent].nil? && @hResponseObj[:writerShowTags]
126
+ @xml.tag!('mrc:cloudCoverPercentage')
127
+ end
128
+
129
+ # image description - compression generation quality
130
+ unless hImage[:compressionQuantity].nil?
131
+ @xml.tag!('mrc:compressionGenerationQuantity') do
132
+ @xml.tag!('gco:Integer', hImage[:compressionQuantity])
133
+ end
134
+ end
135
+ if hImage[:compressionQuantity].nil? && @hResponseObj[:writerShowTags]
136
+ @xml.tag!('mrc:compressionGenerationQuantity')
137
+ end
138
+
139
+ # image description - triangulation indicator
140
+ @xml.tag!('mrc:triangulationIndicator') do
141
+ @xml.tag!('gco:Boolean', hImage[:triangulationIndicator])
142
+ end
143
+
144
+ # image description - radiometric calibration data availability
145
+ @xml.tag!('mrc:radiometricCalibrationDataAvailability') do
146
+ @xml.tag!('gco:Boolean', hImage[:radiometricCalibrationAvailable])
147
+ end
148
+
149
+ # image description - camera calibration information availability
150
+ @xml.tag!('mrc:cameraCalibrationInformationAvailability') do
151
+ @xml.tag!('gco:Boolean', hImage[:cameraCalibrationAvailable])
152
+ end
153
+
154
+ # image description - film distortion information availability
155
+ @xml.tag!('mrc:filmDistortionInformationAvailability') do
156
+ @xml.tag!('gco:Boolean', hImage[:filmDistortionAvailable])
157
+ end
158
+
159
+ # image description - lens distortion information availability
160
+ @xml.tag!('mrc:lensDistortionInformationAvailability') do
161
+ @xml.tag!('gco:Boolean', hImage[:lensDistortionAvailable])
162
+ end
163
+
164
+ end
165
+
166
+ end
167
+
168
+ end # tag MD_ImageDescription
169
+ end # writeXML
170
+ end # class MD_ImageDescription
171
+
172
+ end
173
+ end
174
+ end
175
+ end
@@ -0,0 +1,85 @@
1
+ # ISO <<Class>> CI_Individual
2
+ # 19115-1 writer output in XML
3
+
4
+ # History:
5
+ # Stan Smith 2019-03-15 original script.
6
+
7
+ require_relative '../iso19115_1_writer'
8
+ require_relative 'class_contact'
9
+
10
+ module ADIWG
11
+ module Mdtranslator
12
+ module Writers
13
+ module Iso19115_1
14
+
15
+ class CI_Individual
16
+
17
+ def initialize(xml, hResponseObj)
18
+ @xml = xml
19
+ @hResponseObj = hResponseObj
20
+ @NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_1
21
+ end
22
+
23
+ def writeXML(hContact, inContext = nil)
24
+
25
+ # classes used
26
+ contactClass = CI_Contact.new(@xml, @hResponseObj)
27
+
28
+ outContext = 'individual contact'
29
+ outContext = inContext + ' individual contact' unless inContext.nil?
30
+
31
+ unless hContact.empty?
32
+ @xml.tag!('cit:CI_Individual') do
33
+
34
+ # individual - name
35
+ unless hContact[:name].nil?
36
+ @xml.tag!('cit:name') do
37
+ @xml.tag!('gco:CharacterString', hContact[:name])
38
+ end
39
+ end
40
+ if hContact[:name].nil? && @hResponseObj[:writerShowTags]
41
+ @xml.tag!('cit:name')
42
+ end
43
+
44
+ # individual - contact information [] (only one contactInfo supported in this implementation)
45
+ haveInfo = false
46
+ unless hContact[:phones].empty? &&
47
+ hContact[:addresses].empty? &&
48
+ hContact[:eMailList].empty? &&
49
+ hContact[:onlineResources].empty? &&
50
+ hContact[:hoursOfService].empty? &&
51
+ hContact[:contactInstructions].nil?
52
+ haveInfo = true
53
+ end
54
+ if haveInfo
55
+ @xml.tag!('cit:contactInfo') do
56
+ contactClass.writeXML(hContact)
57
+ end
58
+ end
59
+ if !haveInfo && @hResponseObj[:writerShowTags]
60
+ @xml.tag!('cit:contactInfo')
61
+ end
62
+
63
+ # individual - position
64
+ unless hContact[:positionName].nil?
65
+ @xml.tag!('cit:positionName') do
66
+ @xml.tag!('gco:CharacterString', hContact[:positionName])
67
+ end
68
+ end
69
+ if hContact[:positionName].nil? && @hResponseObj[:writerShowTags]
70
+ @xml.tag!('cit:positionName')
71
+ end
72
+
73
+ end
74
+ end
75
+ if hContact.empty?
76
+ @NameSpace.issueWarning(271, nil, outContext)
77
+ end
78
+
79
+ end # write XML
80
+ end # CI_Individual class
81
+
82
+ end
83
+ end
84
+ end
85
+ end
@@ -0,0 +1,78 @@
1
+ # ISO <<Class>> MD_Keyword
2
+ # 19115-1 writer output in XML
3
+
4
+ # History:
5
+ # Stan Smith 2019-03-25 original script
6
+
7
+ require_relative '../iso19115_1_writer'
8
+ require_relative 'class_codelist'
9
+ require_relative 'class_citation'
10
+
11
+ module ADIWG
12
+ module Mdtranslator
13
+ module Writers
14
+ module Iso19115_1
15
+
16
+ class MD_Keywords
17
+
18
+ def initialize(xml, hResponseObj)
19
+ @xml = xml
20
+ @hResponseObj = hResponseObj
21
+ @NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_1
22
+ end
23
+
24
+ def writeXML(hKeyword)
25
+
26
+ # classes used
27
+ codelistClass = MD_Codelist.new(@xml, @hResponseObj)
28
+ citationClass = CI_Citation.new(@xml, @hResponseObj)
29
+
30
+ @xml.tag!('mri:MD_Keywords') do
31
+
32
+ # keyword - keyword (required)
33
+ aKeyObjects = hKeyword[:keywords]
34
+ unless aKeyObjects.empty?
35
+ aKeyObjects.each do |hKeyObj|
36
+ keyword = hKeyObj[:keyword]
37
+ unless keyword.nil?
38
+ @xml.tag!('mri:keyword') do
39
+ @xml.tag!('gco:CharacterString', keyword)
40
+ end
41
+ end
42
+ end
43
+ end
44
+ if aKeyObjects.empty?
45
+ @NameSpace.issueWarning(200, 'mri:keyword')
46
+ end
47
+
48
+ # keyword - type {MD_KeywordTypeCode}
49
+ unless hKeyword[:keywordType].nil?
50
+ @xml.tag!('mri:type') do
51
+ codelistClass.writeXML('mri', 'iso_keywordType', hKeyword[:keywordType])
52
+ end
53
+ end
54
+ if hKeyword[:keywordType].nil? && @hResponseObj[:writerShowTags]
55
+ @xml.tag!('mri:type')
56
+ end
57
+
58
+ # keyword - thesaurus {MD_KeywordTypeCode}
59
+ hCitation = hKeyword[:thesaurus]
60
+ unless hCitation.empty?
61
+ @xml.tag!('mri:thesaurusName') do
62
+ citationClass.writeXML(hCitation, 'keyword thesaurus')
63
+ end
64
+ end
65
+ if hCitation.empty? && @hResponseObj[:writerShowTags]
66
+ @xml.tag!('mri:thesaurusName')
67
+ end
68
+
69
+ # keyword - keyword class {MD_KeywordClass} - not implemented in mdJson 2.0
70
+
71
+ end # mri:MD_Keywords tag
72
+ end # writeXML
73
+ end # MD_Keywords class
74
+
75
+ end
76
+ end
77
+ end
78
+ end