adiwg-mdtranslator 2.7.0 → 2.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -1
  3. data/adiwg-mdtranslator.gemspec +1 -1
  4. data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +12 -6
  5. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_albers.rb +2 -1
  6. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_azimuthEquidistant.rb +2 -1
  7. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_common.rb +2 -2
  8. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_equidistantConic.rb +2 -1
  9. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_equirectangular.rb +2 -1
  10. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_generalVertical.rb +2 -1
  11. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_gnomonic.rb +2 -1
  12. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_lambertConic.rb +2 -1
  13. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_lambertEqualArea.rb +2 -1
  14. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_mercator.rb +2 -1
  15. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_millerCylinder.rb +2 -1
  16. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_modifiedAlaska.rb +2 -1
  17. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_obliqueMercator.rb +2 -1
  18. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_orthographic.rb +2 -1
  19. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_parameters.rb +2 -1
  20. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_polarStereo.rb +2 -1
  21. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_polyconic.rb +2 -1
  22. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_robinson.rb +2 -1
  23. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_sinusoidal.rb +2 -1
  24. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_spaceOblique.rb +2 -1
  25. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_stereographic.rb +2 -1
  26. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_transverseMercator.rb +2 -1
  27. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_vanDerGrinten.rb +2 -1
  28. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_geodeticReference.rb +82 -0
  29. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_geographicResolution.rb +57 -0
  30. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_horizontalPlanar.rb +2 -2
  31. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_horizontalReference.rb +12 -113
  32. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_keyword.rb +9 -27
  33. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_localSystem.rb +53 -0
  34. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapCoordinateInfo.rb +1 -0
  35. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapGridSystem.rb +27 -15
  36. data/lib/adiwg/mdtranslator/readers/fgdc/modules/{module_mapLocalSystem.rb → module_mapLocalPlanar.rb} +3 -14
  37. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_spatialReference.rb +1 -1
  38. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonSystem.rb +1 -1
  39. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_verticalAltitude.rb +4 -6
  40. data/lib/adiwg/mdtranslator/readers/fgdc/modules/{module_verticalReference.rb → module_verticalDatum.rb} +0 -0
  41. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_verticalDepth.rb +4 -7
  42. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geodetic.rb +95 -0
  43. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_keyword.rb +1 -14
  44. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_projectionParameters.rb +29 -8
  45. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_referenceSystemParameters.rb +5 -5
  46. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceInfo.rb +15 -3
  47. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_spatialReference.rb +16 -4
  48. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_verticalDatum.rb +8 -23
  49. data/lib/adiwg/mdtranslator/readers/sbJson/modules/module_tag.rb +2 -2
  50. data/lib/adiwg/mdtranslator/version.rb +4 -1
  51. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_citation.rb +1 -0
  52. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dateRange.rb +6 -1
  53. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dateSingle.rb +5 -1
  54. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_fgdc.rb +18 -5
  55. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geodeticReference.rb +62 -0
  56. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geographicResolution.rb +56 -0
  57. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_keyword.rb +1 -0
  58. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_localSystem.rb +45 -0
  59. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_mapCoordinateInfo.rb +167 -0
  60. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_mapProjection.rb +374 -0
  61. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarReference.rb +372 -0
  62. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_process.rb +1 -0
  63. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialReference.rb +134 -0
  64. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomySystem.rb +8 -11
  65. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_timePeriod.rb +8 -8
  66. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_verticalDatum.rb +120 -0
  67. data/lib/adiwg/mdtranslator/writers/html/sections/html_body.rb +12 -2
  68. data/lib/adiwg/mdtranslator/writers/html/sections/html_geodeticParameters.rb +85 -0
  69. data/lib/adiwg/mdtranslator/writers/html/sections/html_keyword.rb +5 -1
  70. data/lib/adiwg/mdtranslator/writers/html/sections/html_projectionParameters.rb +36 -15
  71. data/lib/adiwg/mdtranslator/writers/html/sections/html_referenceSystemParameters.rb +6 -6
  72. data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceInfo.rb +1 -2
  73. data/lib/adiwg/mdtranslator/writers/html/sections/html_verticalDatumParameters.rb +7 -0
  74. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_crs.rb +21 -8
  75. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataIdentification.rb +332 -321
  76. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_keyword.rb +8 -8
  77. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_projectionParameters.rb +1 -1
  78. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_geodeticParameters.rb +34 -0
  79. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_projectionParameters.rb +5 -2
  80. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_spatialReference.rb +1 -0
  81. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_spatialReferenceParameters.rb +2 -2
  82. data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_tag.rb +1 -1
  83. metadata +20 -9
  84. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_ellipsoid.rb +0 -78
  85. data/lib/adiwg/mdtranslator/writers/html/sections/html_ellipsoidParameters.rb +0 -68
  86. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_ellipsoidParameters.rb +0 -32
@@ -60,6 +60,7 @@ module ADIWG
60
60
  unless hEndDT.empty?
61
61
  procDate = AdiwgDateTimeFun.stringDateFromDateTime(hEndDT[:dateTime], hEndDT[:dateResolution])
62
62
  procTime = AdiwgDateTimeFun.stringTimeFromDateTime(hEndDT[:dateTime], hEndDT[:dateResolution])
63
+ procDate.gsub!(/[-]/,'')
63
64
  unless procDate == 'ERROR'
64
65
  @xml.tag!('procdate', procDate)
65
66
  haveProcDate = true
@@ -0,0 +1,134 @@
1
+ # FGDC <<Class>> SpatialReference
2
+ # FGDC CSDGM writer output in XML
3
+
4
+ # History:
5
+ # Stan Smith 2017-12-29 original script
6
+
7
+ require_relative 'class_geographicResolution'
8
+ require_relative 'class_planarReference'
9
+ require_relative 'class_mapCoordinateInfo'
10
+ require_relative 'class_localSystem'
11
+ require_relative 'class_geodeticReference'
12
+ require_relative 'class_verticalDatum'
13
+
14
+ module ADIWG
15
+ module Mdtranslator
16
+ module Writers
17
+ module Fgdc
18
+
19
+ class SpatialReference
20
+
21
+ def initialize(xml, hResponseObj)
22
+ @xml = xml
23
+ @hResponseObj = hResponseObj
24
+ end
25
+
26
+ def writeXML(hResourceInfo)
27
+
28
+ aRepTypes = hResourceInfo[:spatialRepresentationTypes]
29
+ aResolutions = hResourceInfo[:spatialResolutions]
30
+ aSpaceRefs = hResourceInfo[:spatialReferenceSystems]
31
+
32
+ # classes used
33
+ geoResClass = GeographicResolution.new(@xml, @hResponseObj)
34
+ planarClass = PlanarReference.new(@xml, @hResponseObj)
35
+ coordInfoClass = CoordinateInformation.new(@xml, @hResponseObj)
36
+ localClass = LocalSystem.new(@xml, @hResponseObj)
37
+ geodeticClass = GeodeticReference.new(@xml, @hResponseObj)
38
+ vDatumClass = VerticalDatum.new(@xml, @hResponseObj)
39
+
40
+ # spatial reference 4.1 (horizsys) - horizontal coordinate reference system (required)
41
+ # oneOf [geograph | planar | local]
42
+ @xml.tag!('horizsys') do
43
+
44
+ # horizontal reference 4.1.1 (geograph) - geographic resolution
45
+ # <- resourceInfo.spatialResolution[].geographicResolution (first)
46
+ aResolutions.each do |hSpaceRes|
47
+ unless hSpaceRes.empty?
48
+ if hSpaceRes[:geographicResolution]
49
+ unless hSpaceRes[:geographicResolution].empty?
50
+ @xml.tag!('geograph') do
51
+ geoResClass.writeXML(hSpaceRes[:geographicResolution])
52
+ end
53
+ break
54
+ end
55
+ end
56
+ end
57
+ end
58
+
59
+ # horizontal reference 4.1.2 (planar) - planar coordinate system []
60
+ # <- spatialReferences[].systemParameterSet.projection
61
+ aSpaceRefs.each do |hSpaceRef|
62
+ unless hSpaceRef[:systemParameterSet].empty?
63
+ if hSpaceRef[:systemParameterSet][:projection]
64
+ hProjection = hSpaceRef[:systemParameterSet][:projection]
65
+ unless hProjection.empty?
66
+ @xml.tag!('planar') do
67
+ planarClass.writeXML(hProjection)
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
73
+ # horizontal reference 4.1.2.4 (planci) - planar coordinate information
74
+ coordInfoClass.writeXML(aRepTypes, aResolutions)
75
+
76
+ # horizontal reference 4.1.3 (local) - any rectangular coordinate system not aligned with surface of earth
77
+ # <- spatialReferences[].systemParameterSet.projection
78
+ aSpaceRefs.each do |hSpaceRef|
79
+ unless hSpaceRef[:systemParameterSet].empty?
80
+ if hSpaceRef[:systemParameterSet][:projection]
81
+ hProjection = hSpaceRef[:systemParameterSet][:projection]
82
+ unless hProjection.empty?
83
+ if hProjection[:projection] == 'local'
84
+ @xml.tag!('local') do
85
+ localClass.writeXML(hProjection)
86
+ end
87
+ end
88
+ end
89
+ end
90
+ end
91
+ end
92
+
93
+ # horizontal reference 4.1.4 (geodetic) - parameters for shape of earth
94
+ # <- spatialReferences[].systemParameterSet.geodetic
95
+ aSpaceRefs.each do |hSpaceRef|
96
+ unless hSpaceRef[:systemParameterSet].empty?
97
+ if hSpaceRef[:systemParameterSet][:geodetic]
98
+ hGeodetic = hSpaceRef[:systemParameterSet][:geodetic]
99
+ unless hGeodetic.empty?
100
+ @xml.tag!('geodetic') do
101
+ geodeticClass.writeXML(hGeodetic)
102
+ end
103
+ end
104
+ end
105
+ end
106
+ end
107
+
108
+ end
109
+
110
+ # vertical reference 4.2 (vertdef) - vertical coordinate reference system
111
+ # <- spatialReferences[].systemParameterSet.verticalDatum
112
+ # pass in the full spatial reference array,
113
+ # ... all vertical datum must be under same 'vertdef' tag
114
+ haveVertical = false
115
+ aSpaceRefs.each do |hSpaceRef|
116
+ unless hSpaceRef[:systemParameterSet].empty?
117
+ unless hSpaceRef[:systemParameterSet][:verticalDatum].empty?
118
+ haveVertical = true
119
+ end
120
+ end
121
+ end
122
+ if haveVertical
123
+ @xml.tag!('vertdef') do
124
+ vDatumClass.writeXML(aSpaceRefs)
125
+ end
126
+ end
127
+
128
+ end # writeXML
129
+ end # SpatialReference
130
+
131
+ end
132
+ end
133
+ end
134
+ end
@@ -115,20 +115,17 @@ module ADIWG
115
115
  end
116
116
 
117
117
  # voucher (repository) - repository (required)
118
+ # take first party as repository custodian
118
119
  unless hVoucher[:repository].empty?
119
- haveRepo = false
120
- aRParties = [hVoucher[:repository]]
121
- aRepos = ADIWG::Mdtranslator::Writers::Fgdc.find_responsibility(aRParties, 'custodian')
122
- aRepos.each do |contactId|
123
- hContact = ADIWG::Mdtranslator::Writers::Fgdc.get_contact(contactId)
124
- unless hContact.empty?
125
- @xml.tag!('repository') do
126
- contactClass.writeXML(hContact)
127
- haveRepo = true
128
- end
120
+ aRParties = hVoucher[:repository][:parties]
121
+ contactId = aRParties[0][:contactId]
122
+ hContact = ADIWG::Mdtranslator::Writers::Fgdc.get_contact(contactId)
123
+ unless hContact.empty?
124
+ @xml.tag!('repository') do
125
+ contactClass.writeXML(hContact)
129
126
  end
130
127
  end
131
- unless haveRepo
128
+ if hContact.empty?
132
129
  @hResponseObj[:writerPass] = false
133
130
  @hResponseObj[:writerMessages] << 'Taxonomic Voucher is missing repository'
134
131
  end
@@ -88,15 +88,15 @@ module ADIWG
88
88
  end
89
89
  end
90
90
 
91
- # add timeInfo currentness (required)
92
- unless current.nil?
93
- @xml.tag!(currentTag, current)
94
- end
95
- if current.nil?
96
- @hResponseObj[:writerPass] = false
97
- @hResponseObj[:writerMessages] << 'Time Info is missing time currentness'
98
- end
91
+ end
99
92
 
93
+ # add timeInfo currentness (required)
94
+ unless current.nil?
95
+ @xml.tag!(currentTag, current)
96
+ end
97
+ if current.nil?
98
+ @hResponseObj[:writerPass] = false
99
+ @hResponseObj[:writerMessages] << 'Time Info is missing time currentness'
100
100
  end
101
101
 
102
102
  end # writeXML
@@ -0,0 +1,120 @@
1
+ # FGDC <<Class>> SpatialReference
2
+ # FGDC CSDGM writer output in XML
3
+
4
+ # History:
5
+ # Stan Smith 2018-01-16 original script
6
+
7
+ module ADIWG
8
+ module Mdtranslator
9
+ module Writers
10
+ module Fgdc
11
+
12
+ class VerticalDatum
13
+
14
+ def initialize(xml, hResponseObj)
15
+ @xml = xml
16
+ @hResponseObj = hResponseObj
17
+ end
18
+
19
+ def writeXML(aSpaceRefs)
20
+
21
+ aSpaceRefs.each do |hSpaceRef|
22
+ unless hSpaceRef[:systemParameterSet].empty?
23
+ if hSpaceRef[:systemParameterSet][:verticalDatum]
24
+ hVDatum = hSpaceRef[:systemParameterSet][:verticalDatum]
25
+
26
+ # determine if vertical datum is altitude or depth
27
+ if hVDatum[:isDepthSystem]
28
+ @xml.tag!('depthsys') do
29
+
30
+ # vertical datum 4.2.1.1 (depthdn) - depth datum name (required)
31
+ unless hVDatum[:datumName].nil?
32
+ @xml.tag!('depthdn', hVDatum[:datumName])
33
+ end
34
+ if hVDatum[:datumName].nil?
35
+ @hResponseObj[:writerPass] = false
36
+ @hResponseObj[:writerMessages] << 'Vertical Depth Datum is missing datum name'
37
+ end
38
+
39
+ # vertical datum 4.2.1.2 (depthres) - depth units resolution (required)
40
+ unless hVDatum[:verticalResolution].nil?
41
+ @xml.tag!('depthres', hVDatum[:verticalResolution])
42
+ end
43
+ if hVDatum[:verticalResolution].nil?
44
+ @hResponseObj[:writerPass] = false
45
+ @hResponseObj[:writerMessages] << 'Vertical Depth Datum is missing depth units resolution'
46
+ end
47
+
48
+ # vertical datum 4.2.1.3 (depthdu) - depth units (required)
49
+ unless hVDatum[:unitOfMeasure].nil?
50
+ @xml.tag!('depthdu', hVDatum[:unitOfMeasure])
51
+ end
52
+ if hVDatum[:unitOfMeasure].nil?
53
+ @hResponseObj[:writerPass] = false
54
+ @hResponseObj[:writerMessages] << 'Vertical Depth Datum is missing depth units'
55
+ end
56
+
57
+ # vertical datum 4.2.1.4 (depthem) - depth units (required)
58
+ unless hVDatum[:encodingMethod].nil?
59
+ @xml.tag!('depthem', hVDatum[:encodingMethod])
60
+ end
61
+ if hVDatum[:encodingMethod].nil?
62
+ @hResponseObj[:writerPass] = false
63
+ @hResponseObj[:writerMessages] << 'Vertical Depth Datum is missing depth encoding method'
64
+ end
65
+
66
+ end
67
+
68
+ else
69
+ @xml.tag!('altsys') do
70
+
71
+ # altitude datum 4.2.2.1 (altdatum) - altitude datum name (required)
72
+ unless hVDatum[:datumName].nil?
73
+ @xml.tag!('altdatum', hVDatum[:datumName])
74
+ end
75
+ if hVDatum[:datumName].nil?
76
+ @hResponseObj[:writerPass] = false
77
+ @hResponseObj[:writerMessages] << 'Vertical Altitude Datum is missing datum name'
78
+ end
79
+
80
+ # altitude datum 4.2.2.2 (altres) - altitude units resolution (required)
81
+ unless hVDatum[:verticalResolution].nil?
82
+ @xml.tag!('altres', hVDatum[:verticalResolution])
83
+ end
84
+ if hVDatum[:verticalResolution].nil?
85
+ @hResponseObj[:writerPass] = false
86
+ @hResponseObj[:writerMessages] << 'Vertical Altitude Datum is missing depth units resolution'
87
+ end
88
+
89
+ # altitude datum 4.2.2.3 (altunits) - altitude units (required)
90
+ unless hVDatum[:unitOfMeasure].nil?
91
+ @xml.tag!('altunits', hVDatum[:unitOfMeasure])
92
+ end
93
+ if hVDatum[:unitOfMeasure].nil?
94
+ @hResponseObj[:writerPass] = false
95
+ @hResponseObj[:writerMessages] << 'Vertical Altitude Datum is missing depth units'
96
+ end
97
+
98
+ # altitude datum 4.2.2.4 (altenc) - altitude units (required)
99
+ unless hVDatum[:encodingMethod].nil?
100
+ @xml.tag!('altenc', hVDatum[:encodingMethod])
101
+ end
102
+ if hVDatum[:encodingMethod].nil?
103
+ @hResponseObj[:writerPass] = false
104
+ @hResponseObj[:writerMessages] << 'Vertical Altitude Datum is missing depth encoding method'
105
+ end
106
+
107
+ end
108
+ end
109
+
110
+ end
111
+ end
112
+ end
113
+
114
+ end # writeXML
115
+ end # VerticalDatum
116
+
117
+ end
118
+ end
119
+ end
120
+ end
@@ -2,6 +2,7 @@
2
2
  # html body
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-01-19 add resource citation title to report header
5
6
  # Stan Smith 2017-03-22 refactor for mdTranslator 2.0
6
7
  # Stan Smith 2015-07-20 moved mdTranslator logo to html_inlineCss.css
7
8
  # Stan Smith 2015-07-16 refactored to remove global namespace $HtmlNS
@@ -30,7 +31,7 @@ module ADIWG
30
31
  @html = html
31
32
  end
32
33
 
33
- def writeHtml(version,intObj)
34
+ def writeHtml(version, intObj)
34
35
  @html.body do
35
36
 
36
37
  # classes used
@@ -94,6 +95,15 @@ module ADIWG
94
95
  # shortVersion = aShortVersion[0].to_s + '.' + aShortVersion[1].to_s
95
96
  @html.h1('mdTranslator ' + version + ' HTML Metadata Record', 'id' => 'mdtranslator-metadata-report')
96
97
 
98
+ # resource citation title
99
+ unless hResourceInfo.empty?
100
+ unless hResourceInfo[:citation].empty?
101
+ unless hResourceInfo[:citation][:title].nil?
102
+ @html.h2(hResourceInfo[:citation][:title])
103
+ end
104
+ end
105
+ end
106
+
97
107
  # report date
98
108
  @html.section(:class => 'block') do
99
109
  @html.em('Report Generated:')
@@ -101,7 +111,7 @@ module ADIWG
101
111
  end
102
112
 
103
113
  # metadata source
104
- @html.h2('Metadata Source', 'id' => 'metadataSource')
114
+ @html.h3('Metadata Source', 'id' => 'metadataSource')
105
115
  @html.section(:class => 'block') do
106
116
  @html.em('Metadata schema:')
107
117
  @html.text!(hSchema[:name])
@@ -0,0 +1,85 @@
1
+ # HTML writer
2
+ # spatial reference system ellipsoid parameters
3
+
4
+ # History:
5
+ # Stan Smith 2017-10-24 original script
6
+
7
+ require_relative 'html_identifier'
8
+
9
+ module ADIWG
10
+ module Mdtranslator
11
+ module Writers
12
+ module Html
13
+
14
+ class Html_GeodeticParameters
15
+
16
+ def initialize(html)
17
+ @html = html
18
+ end
19
+
20
+ def writeHtml(hGeodetic)
21
+
22
+ # classes used
23
+ identifierClass = Html_Identifier.new(@html)
24
+
25
+ # geodetic parameters - datum name
26
+ unless hGeodetic[:datumName].nil?
27
+ @html.em('Datum Name: ')
28
+ @html.text!(hGeodetic[:datumName])
29
+ @html.br
30
+ end
31
+
32
+ # geodetic parameters - ellipsoid name
33
+ unless hGeodetic[:ellipsoidName].nil?
34
+ @html.em('Ellipsoid Name: ')
35
+ @html.text!(hGeodetic[:ellipsoidName])
36
+ @html.br
37
+ end
38
+
39
+ # geodetic parameters - semi-major axis
40
+ unless hGeodetic[:semiMajorAxis].nil?
41
+ @html.em('Semi-major Axis: ')
42
+ @html.text!(hGeodetic[:semiMajorAxis].to_s)
43
+ @html.br
44
+ end
45
+
46
+ # geodetic parameters - axis units
47
+ unless hGeodetic[:axisUnits].nil?
48
+ @html.em('Axis Units: ')
49
+ @html.text!(hGeodetic[:axisUnits])
50
+ @html.br
51
+ end
52
+
53
+ # geodetic parameters - denominator of flattening ratio
54
+ unless hGeodetic[:denominatorOfFlatteningRatio].nil?
55
+ @html.em('Denominator or Flattening Ratio: ')
56
+ @html.text!(hGeodetic[:denominatorOfFlatteningRatio].to_s)
57
+ end
58
+
59
+ # geodetic parameters - ellipsoid identifier
60
+ unless hGeodetic[:ellipsoidIdentifier].empty?
61
+ @html.details do
62
+ @html.summary('Ellipsoid Identifier', {'id' => 'ellipsoid-identifier', 'class' => 'h5'})
63
+ @html.section(:class => 'block') do
64
+ identifierClass.writeHtml(hGeodetic[:ellipsoidIdentifier])
65
+ end
66
+ end
67
+ end
68
+
69
+ # geodetic parameters - datum identifier
70
+ unless hGeodetic[:datumIdentifier].empty?
71
+ @html.details do
72
+ @html.summary('Datum Identifier', {'id' => 'datum-identifier', 'class' => 'h5'})
73
+ @html.section(:class => 'block') do
74
+ identifierClass.writeHtml(hGeodetic[:datumIdentifier])
75
+ end
76
+ end
77
+ end
78
+
79
+ end # writeHtml
80
+ end # Html_ProjectionParameters
81
+
82
+ end
83
+ end
84
+ end
85
+ end
@@ -37,7 +37,11 @@ module ADIWG
37
37
  @html.ul do
38
38
  hKeyword[:keywords].each do |hKeyword|
39
39
  unless hKeyword[:keyword].nil?
40
- @html.li(hKeyword[:keyword])
40
+ keyword = hKeyword[:keyword]
41
+ unless hKeyword[:keywordId].nil?
42
+ keyword += ' (ID: ' + hKeyword[:keywordId].to_s + ')'
43
+ end
44
+ @html.li(keyword)
41
45
  end
42
46
  end
43
47
  end