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,62 @@
1
+ # ISO <<Class>> CI_Date
2
+ # 19115-1 writer output in XML
3
+
4
+ # History:
5
+ # Stan Smith 2019-03-14 original script
6
+
7
+ require_relative '../iso19115_1_writer'
8
+ require_relative 'class_codelist'
9
+ require_relative 'class_gcoDateTime'
10
+
11
+ module ADIWG
12
+ module Mdtranslator
13
+ module Writers
14
+ module Iso19115_1
15
+
16
+ class CI_Date
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(hDate, inContext = nil)
25
+
26
+ # classes used
27
+ codelistClass = MD_Codelist.new(@xml, @hResponseObj)
28
+ gcoDateTimeClass = GcoDateTime.new(@xml, @hResponseObj)
29
+
30
+ date = hDate[:date]
31
+ dateType = hDate[:dateType]
32
+
33
+ @xml.tag!('cit:CI_Date') do
34
+
35
+ # date - date (required)
36
+ unless date.nil?
37
+ @xml.tag!('cit:date') do
38
+ gcoDateTimeClass.writeXML(hDate)
39
+ end
40
+ end
41
+ if date.nil?
42
+ @NameSpace.issueError(70)
43
+ end
44
+
45
+ # date - date type (required)
46
+ unless dateType.nil?
47
+ @xml.tag!('cit:dateType') do
48
+ codelistClass.writeXML('cit', 'iso_dateType', dateType)
49
+ end
50
+ end
51
+ if dateType.nil?
52
+ @NameSpace.issueWarning(71, 'cit:dateType', inContext)
53
+ end
54
+
55
+ end # CI_Date tag
56
+ end # write XML
57
+ end # CI_Date class
58
+
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,35 @@
1
+ # ISO <<Class>> UnitDefinition
2
+ # 19115-1 writer output in XML
3
+
4
+ # History:
5
+ # Stan Smith 2019-04-08 copied from 19115_2 writer
6
+
7
+ module ADIWG
8
+ module Mdtranslator
9
+ module Writers
10
+ module Iso19115_1
11
+
12
+ class UnitDefinition
13
+
14
+ def initialize(xml, hResponseObj)
15
+ @xml = xml
16
+ @hResponseObj = hResponseObj
17
+ end
18
+
19
+ def writeXML(unit)
20
+
21
+ # create an identity for the unit
22
+ @hResponseObj[:writerMissingIdCount] = @hResponseObj[:writerMissingIdCount].succ
23
+ unitID = 'unit' + @hResponseObj[:writerMissingIdCount]
24
+ @xml.tag!('gml:UnitDefinition', {'gml:id' => unitID}) do
25
+ @xml.tag!('gml:identifier', {'codeSpace' => ''}, unit)
26
+ end
27
+
28
+ end
29
+
30
+ end
31
+
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,42 @@
1
+ # ISO <<Class>> DerivedUnit
2
+ # 19115-1 writer output in XML
3
+
4
+ # History:
5
+ # Stan Smith 2019-04-08 copied from 19115_2 writer
6
+
7
+ module ADIWG
8
+ module Mdtranslator
9
+ module Writers
10
+ module Iso19115_1
11
+
12
+ class DerivedUnit
13
+
14
+ def initialize(xml, hResponseObj)
15
+ @xml = xml
16
+ @hResponseObj = hResponseObj
17
+ end
18
+
19
+ def writeXML(hDerived)
20
+
21
+ # create and identity for the unit
22
+ @hResponseObj[:writerMissingIdCount] = @hResponseObj[:writerMissingIdCount].succ
23
+ unitID = 'unit' + @hResponseObj[:writerMissingIdCount]
24
+ @xml.tag!('gml:DerivedUnit', {'gml:id' => unitID}) do
25
+ @xml.tag!('gml:identifier', {'codeSpace' => hDerived[:codeSpace]}, hDerived[:identifier])
26
+ @xml.tag!('gml:name', hDerived[:name])
27
+ @xml.tag!('gml:remarks', hDerived[:remarks])
28
+ @xml.tag!('gml:catalogSymbol', hDerived[:catalogSymbol])
29
+ aTerms = hDerived[:derivationUnitTerm]
30
+ aTerms.each do |term|
31
+ @xml.tag!('gml:derivationUnitTerm', term)
32
+ end
33
+ end
34
+
35
+ end
36
+
37
+ end
38
+
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,72 @@
1
+ # ISO <<Class>> MD_Dimension
2
+ # 19115-1 writer output in XML
3
+
4
+ # History:
5
+ # Stan Smith 2019-04-16 original script.
6
+
7
+ require_relative '../iso19115_1_writer'
8
+ require_relative 'class_codelist'
9
+ require_relative 'class_measure'
10
+
11
+ module ADIWG
12
+ module Mdtranslator
13
+ module Writers
14
+ module Iso19115_1
15
+
16
+ class MD_Dimension
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(hDim, inContext = nil)
25
+
26
+ # classes used
27
+ codelistClass = MD_Codelist.new(@xml, @hResponseObj)
28
+ measureClass = Measure.new(@xml, @hResponseObj)
29
+
30
+ outContext = 'dimension'
31
+ outContext = inContext + ' dimension' unless inContext.nil?
32
+
33
+ @xml.tag!('msr:MD_Dimension') do
34
+
35
+ # dimension information - dimension type code (required)
36
+ unless hDim[:dimensionType].nil?
37
+ @xml.tag!('msr:dimensionName') do
38
+ codelistClass.writeXML('msr', 'iso_dimensionNameType', hDim[:dimensionType])
39
+ end
40
+ end
41
+ if hDim[:dimensionType].nil?
42
+ @NameSpace.issueWarning(80, 'msr:dimensionName', inContext)
43
+ end
44
+
45
+ # dimension information - dimension size (required)
46
+ unless hDim[:dimensionSize].nil?
47
+ @xml.tag!('msr:dimensionSize') do
48
+ @xml.tag!('gco:Integer', hDim[:dimensionSize])
49
+ end
50
+ end
51
+ if hDim[:dimensionSize].nil?
52
+ @NameSpace.issueWarning(81, 'msr:dimensionSize', inContext)
53
+ end
54
+
55
+ # dimension information - dimension resolution
56
+ unless hDim[:resolution].empty?
57
+ @xml.tag!('msr:resolution') do
58
+ measureClass.writeXML(hDim[:resolution], outContext)
59
+ end
60
+ end
61
+ if hDim[:resolution].empty? && @hResponseObj[:writerShowTags]
62
+ @xml.tag!('msr:resolution')
63
+ end
64
+
65
+ end # MD_Dimension tag
66
+ end # writeXML
67
+ end # Md_Dimension class
68
+
69
+ end
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,62 @@
1
+ # ISO <<Class>> MD_Distribution
2
+ # 19115-1 writer output in XML
3
+
4
+ # History:
5
+ # Stan Smith 2019-04-09 original script
6
+
7
+ require_relative 'class_distributor'
8
+
9
+ module ADIWG
10
+ module Mdtranslator
11
+ module Writers
12
+ module Iso19115_1
13
+
14
+ class MD_Distribution
15
+
16
+ def initialize(xml, hResponseObj)
17
+ @xml = xml
18
+ @hResponseObj = hResponseObj
19
+ end
20
+
21
+ def writeXML(hDistribution)
22
+
23
+ # classes used
24
+ distributorClass = MD_Distributor.new(@xml, @hResponseObj)
25
+
26
+ @xml.tag!('mrd:MD_Distribution') do
27
+
28
+ # distribution - description
29
+ unless hDistribution[:description].nil?
30
+ @xml.tag!('mrd:description') do
31
+ @xml.tag!('gco:CharacterString', hDistribution[:description])
32
+ end
33
+ end
34
+ if hDistribution[:description].nil? && @hResponseObj[:writerShowTags]
35
+ @xml.tag!('mrd:description')
36
+ end
37
+
38
+ # distribution - distributor
39
+ aDistributors = hDistribution[:distributor]
40
+ unless aDistributors.empty?
41
+ aDistributors.each do |hDistributor|
42
+ @xml.tag!('mrd:distributor') do
43
+ distributorClass.writeXML(hDistributor)
44
+ end
45
+ end
46
+ end
47
+ if aDistributors.empty? && @hResponseObj[:writerShowTags]
48
+ @xml.tag!('mrd:distributor')
49
+ end
50
+
51
+ # distribution - transfer options - supported under distributor
52
+
53
+ # distribution - distribution format - supported under distributor
54
+
55
+ end # gmd:MD_Distribution tag
56
+ end # writeXML
57
+ end # MD_Distribution class
58
+
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,77 @@
1
+ # ISO <<Class>> MD_Distributor
2
+ # 19115-1 writer output in XML
3
+
4
+ # History:
5
+ # Stan Smith 2019-04-09 original script
6
+
7
+ require_relative '../iso19115_1_writer'
8
+ require_relative 'class_responsibility'
9
+ require_relative 'class_orderProcess'
10
+ require_relative 'class_transferOptions'
11
+
12
+ module ADIWG
13
+ module Mdtranslator
14
+ module Writers
15
+ module Iso19115_1
16
+
17
+ class MD_Distributor
18
+
19
+ def initialize(xml, hResponseObj)
20
+ @xml = xml
21
+ @hResponseObj = hResponseObj
22
+ @NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_1
23
+ end
24
+
25
+ def writeXML(hDistributor)
26
+
27
+ # classes used
28
+ responsibilityClass = CI_Responsibility.new(@xml, @hResponseObj)
29
+ orderClass = MD_StandardOrderProcess.new(@xml, @hResponseObj)
30
+ transferClass = MD_DigitalTransferOptions.new(@xml, @hResponseObj)
31
+
32
+ @xml.tag!('mrd:MD_Distributor') do
33
+
34
+ # distributor - contact (required) {CI_Responsibility}
35
+ hContact = hDistributor[:contact]
36
+ unless hContact.empty?
37
+ @xml.tag!('mrd:distributorContact') do
38
+ responsibilityClass.writeXML(hContact, 'distributor')
39
+ end
40
+ end
41
+ if hContact.empty?
42
+ @NameSpace.issueWarning(90, 'mrd:distributorContact')
43
+ end
44
+
45
+ # distributor - order process [{MD_StandardOrderProcess}]
46
+ aDistOrderProc = hDistributor[:orderProcess]
47
+ aDistOrderProc.each do |hOrder|
48
+ @xml.tag!('mrd:distributionOrderProcess') do
49
+ orderClass.writeXML(hOrder)
50
+ end
51
+ end
52
+ if aDistOrderProc.empty? && @hResponseObj[:writerShowTags]
53
+ @xml.tag!('mrd:distributionOrderProcess')
54
+ end
55
+
56
+ # distributor - format [] {MD_Format}
57
+ # supported under transfer options
58
+
59
+ # distributor - transfer options [{MD_DigitalTransferOptions}]
60
+ aOptions = hDistributor[:transferOptions]
61
+ aOptions.each do |hOption|
62
+ @xml.tag!('mrd:distributorTransferOptions') do
63
+ transferClass.writeXML(hOption)
64
+ end
65
+ end
66
+ if aOptions.empty? && @hResponseObj[:writerShowTags]
67
+ @xml.tag!('mrd:distributorTransferOptions')
68
+ end
69
+
70
+ end # mrd:MD_Distributor tag
71
+ end # writeXML
72
+ end # MD_Distributor class
73
+
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,44 @@
1
+ # ISO <<Class>> CI_Address
2
+ # 19115-1 writer output in XML
3
+
4
+ # History:
5
+ # Stan Smith 2019-03-18 original script
6
+
7
+ module ADIWG
8
+ module Mdtranslator
9
+ module Writers
10
+ module Iso19115_1
11
+
12
+ class Email
13
+
14
+ def initialize(xml, hResponseObj)
15
+ @xml = xml
16
+ @hResponseObj = hResponseObj
17
+ end
18
+
19
+ def writeXML(aEmail)
20
+
21
+ @xml.tag!('cit:CI_Address') do
22
+
23
+ unless aEmail.empty?
24
+
25
+ # address - email addresses []
26
+ aEmail.each do |myEmail|
27
+ @xml.tag!('cit:electronicMailAddress') do
28
+ @xml.tag!('gco:CharacterString', myEmail)
29
+ end
30
+ end
31
+ if aEmail.empty? && @hResponseObj[:writerShowTags]
32
+ @xml.tag!('cit:electronicMailAddress')
33
+ end
34
+
35
+ end
36
+
37
+ end # CI_Address tag
38
+ end # writeXML
39
+ end # CI_Address class
40
+
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,85 @@
1
+ # ISO <<Class>> EX_Extent
2
+ # 19115-1 writer output in XML
3
+
4
+ # History:
5
+ # Stan Smith 2019-03-15 original script
6
+
7
+ require_relative 'class_geographicExtent'
8
+ require_relative 'class_temporalExtent'
9
+ require_relative 'class_verticalExtent'
10
+
11
+ module ADIWG
12
+ module Mdtranslator
13
+ module Writers
14
+ module Iso19115_1
15
+
16
+ class EX_Extent
17
+
18
+ def initialize(xml, hResponseObj)
19
+ @xml = xml
20
+ @hResponseObj = hResponseObj
21
+ end
22
+
23
+ def writeXML(hExtent, inContext = nil)
24
+
25
+ # classes used
26
+ tempExtClass = EX_TemporalExtent.new(@xml, @hResponseObj)
27
+ vertExtClass = EX_VerticalExtent.new(@xml, @hResponseObj)
28
+ geoExtClass = GeographicExtent.new(@xml, @hResponseObj)
29
+
30
+ outContext = 'extent'
31
+ outContext = inContext + ' extent' unless inContext.nil?
32
+
33
+ @xml.tag!('gex:EX_Extent') do
34
+
35
+ # extent - description
36
+ unless hExtent[:description].nil?
37
+ @xml.tag!('gex:description') do
38
+ @xml.tag!('gco:CharacterString', hExtent[:description])
39
+ end
40
+ end
41
+ if hExtent[:description].nil? && @hResponseObj[:writerShowTags]
42
+ @xml.tag!('gex:description')
43
+ end
44
+
45
+ # extent - geographic extent []
46
+ # {EX_GeographicDescription | EX_GeographicBoundingBox | EX_BoundingPolygon}
47
+ aGeoExtents = hExtent[:geographicExtents]
48
+ aGeoExtents.each do |hGeoExtent|
49
+ geoExtClass.writeXML(hGeoExtent)
50
+ end
51
+ if aGeoExtents.empty? && @hResponseObj[:writerShowTags]
52
+ @xml.tag!('gex:geographicElement')
53
+ end
54
+
55
+ # extent - temporal extent [] {EX_TemporalExtent}
56
+ # EX_SpatialTemporalExtent not implemented
57
+ aTempElements = hExtent[:temporalExtents]
58
+ aTempElements.each do |hTempElement|
59
+ @xml.tag!('gex:temporalElement') do
60
+ tempExtClass.writeXML(hTempElement)
61
+ end
62
+ end
63
+ if aTempElements.empty? && @hResponseObj[:writerShowTags]
64
+ @xml.tag!('gex:temporalElement')
65
+ end
66
+
67
+ # extent - vertical extent [] {EX_VerticalExtent}
68
+ aVertElements = hExtent[:verticalExtents]
69
+ aVertElements.each do |hVertElement|
70
+ @xml.tag!('gex:verticalElement') do
71
+ vertExtClass.writeXML(hVertElement)
72
+ end
73
+ end
74
+ if aVertElements.empty? && @hResponseObj[:writerShowTags]
75
+ @xml.tag!('gex:verticalElement')
76
+ end
77
+
78
+ end # gmd:EX_Extent tag
79
+ end # writeXML
80
+ end # EX_Extent class
81
+
82
+ end
83
+ end
84
+ end
85
+ end