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
@@ -10,249 +10,249 @@ require_relative 'class_derivedUnit'
10
10
  require_relative 'class_definitionUnit'
11
11
 
12
12
  module ADIWG
13
- module Mdtranslator
14
- module Writers
15
- module Iso19115_2
16
-
17
- class UnitsOfMeasure
18
-
19
- def initialize(xml, hResponseObj)
20
- @xml = xml
21
- @hResponseObj = hResponseObj
22
- end
23
-
24
- def writeUnits(unit)
25
-
26
- # define empty containers here to save lines of code
27
- # for base units
28
- hBase = {}
29
- hBase[:identifier] = ''
30
- hBase[:codeSpace] = 'http://www.bipm.org/en/si/'
31
- hBase[:name] = ''
32
- hBase[:catalogSymbol] = ''
33
- hBase[:unitsSystem] = 'base unit'
34
-
35
- # for conventional units
36
- hConvent = {}
37
- hConvent[:identifier] = ''
38
- hConvent[:codeSpace] = 'http://www.bipm.org/en/si/'
39
- hConvent[:name] = ''
40
- hConvent[:catalogSymbol] = ''
41
- hConvent[:preferredUnit] = ''
42
- hConvent[:factor] = nil
43
- hConvent[:a] = nil
44
- hConvent[:b] = nil
45
- hConvent[:c] = nil
46
- hConvent[:d] = nil
47
-
48
- # for derived units
49
- hDerived = {}
50
- hDerived[:identifier] = ''
51
- hDerived[:codeSpace] = ''
52
- hDerived[:name] = ''
53
- hDerived[:remarks] = ''
54
- hDerived[:catalogSymbol] = ''
55
- hDerived[:derivationUnitTerm] = nil
56
-
57
- # find matching units of measure
58
- case unit
59
-
60
- # angular degrees
61
- when 'deg', 'degree', 'degrees'
62
- hBase[:identifier] = 'degree'
63
- hBase[:codeSpace] = 'urn:ogc:def:uom:1.0'
64
- hBase[:name] = 'degree of arc'
65
- hBase[:catalogSymbol] = 'deg'
66
- hBase[:unitsSystem] = 'http://www.opengis.net/def/uom/OGC/1.0/degree'
67
-
68
- baseClass = BaseUnit.new(@xml, @hResponseObj)
69
- baseClass.writeXML(hBase)
70
-
71
- when 'm', 'meter', 'meters', 'metre'
72
- hBase[:identifier] = 'meter'
73
- hBase[:name] = 'meter'
74
- hBase[:catalogSymbol] = 'm'
75
-
76
- baseClass = BaseUnit.new(@xml, @hResponseObj)
77
- baseClass.writeXML(hBase)
78
-
79
- when 'kg', 'kilogram', 'kilograms'
80
- hBase[:identifier] = 'kilogram'
81
- hBase[:name] = 'kilogram'
82
- hBase[:catalogSymbol] = 'kg'
83
-
84
- baseClass = BaseUnit.new(@xml, @hResponseObj)
85
- baseClass.writeXML(hBase)
86
-
87
- when 's', 'second', 'seconds'
88
- hBase[:identifier] = 'second'
89
- hBase[:name] = 'second'
90
- hBase[:catalogSymbol] = 'd'
91
-
92
- baseClass = BaseUnit.new(@xml, @hResponseObj)
93
- baseClass.writeXML(hBase)
94
-
95
- when 'A', 'ampere', 'amperes'
96
- hBase[:identifier] = 'ampere'
97
- hBase[:name] = 'ampere'
98
- hBase[:catalogSymbol] = 'A'
99
-
100
- baseClass = BaseUnit.new(@xml, @hResponseObj)
101
- baseClass.writeXML(hBase)
102
-
103
- when 'K', 'kelvin'
104
- hBase[:identifier] = 'kelvin'
105
- hBase[:name] = 'kelvin'
106
- hBase[:catalogSymbol] = 'K'
107
-
108
- baseClass = BaseUnit.new(@xml, @hResponseObj)
109
- baseClass.writeXML(hBase)
110
-
111
- when 'mol', 'mole', 'moles'
112
- hBase[:identifier] = 'mole'
113
- hBase[:name] = 'mole'
114
- hBase[:catalogSymbol] = 'mol'
115
-
116
- baseClass = BaseUnit.new(@xml, @hResponseObj)
117
- baseClass.writeXML(hBase)
118
-
119
- when 'cd', 'candela', 'candelas'
120
- hBase[:identifier] = 'candela'
121
- hBase[:name] = 'candela'
122
- hBase[:catalogSymbol] = 'cd'
123
-
124
- baseClass = BaseUnit.new(@xml, @hResponseObj)
125
- baseClass.writeXML(hBase)
126
-
127
- when 'ft', 'foot', 'feet'
128
- hConvent[:identifier] = 'meter'
129
- hConvent[:name] = 'foot'
130
- hConvent[:catalogSymbol] = 'ft'
131
- hConvent[:preferredUnit] = 'meter'
132
- hConvent[:factor] = 3.280839
133
-
134
- convClass = ConventionalUnit.new(@xml, @hResponseObj)
135
- convClass.writeXML(hConvent)
136
-
137
- when 'in', 'inch', 'inches'
138
- hConvent[:identifier] = 'meter'
139
- hConvent[:name] = 'inch'
140
- hConvent[:catalogSymbol] = 'in'
141
- hConvent[:preferredUnit] = 'meter'
142
- hConvent[:factor] = 0.0254
143
-
144
- convClass = ConventionalUnit.new(@xml, @hResponseObj)
145
- convClass.writeXML(hConvent)
146
-
147
- when 'mm', 'millimeter', 'millimeters'
148
- hConvent[:identifier] = 'meter'
149
- hConvent[:name] = 'millimeter'
150
- hConvent[:catalogSymbol] = 'mm'
151
- hConvent[:preferredUnit] = 'meter'
152
- hConvent[:factor] = 0.001
153
-
154
- convClass = ConventionalUnit.new(@xml, @hResponseObj)
155
- convClass.writeXML(hConvent)
156
-
157
- when 'micrometer','micrometers'
158
- micro = "\u00b5"
159
- s = micro.encode('utf-8')
160
- s += 'm'
161
- hConvent[:identifier] = 'meter'
162
- hConvent[:name] = 'micrometer'
163
- hConvent[:catalogSymbol] = s
164
- hConvent[:preferredUnit] = 'meter'
165
- hConvent[:factor] = 0.000001
166
-
167
- convClass = ConventionalUnit.new(@xml, @hResponseObj)
168
- convClass.writeXML(hConvent)
169
-
170
- when 'nm', 'nanometer', 'nanometers'
171
- hConvent[:identifier] = 'meter'
172
- hConvent[:name] = 'nanometer'
173
- hConvent[:catalogSymbol] = 'nm'
174
- hConvent[:preferredUnit] = 'meter'
175
- hConvent[:factor] = 0.000000001
176
-
177
- convClass = ConventionalUnit.new(@xml, @hResponseObj)
178
- convClass.writeXML(hConvent)
179
-
180
- when 'degC', 'centigrade', 'degreesC', 'Celsius'
181
- hConvent[:identifier] = 'kelvin'
182
- hConvent[:name] = 'degree Celsius'
183
- hConvent[:catalogSymbol] = 'degC'
184
- hConvent[:preferredUnit] = 'kelvin'
185
- hConvent[:a] = 273.16
186
- hConvent[:b] = 1
187
- hConvent[:c] = 1
188
- hConvent[:d] = 0
189
-
190
- convClass = ConventionalUnit.new(@xml, @hResponseObj)
191
- convClass.writeXML(hConvent)
192
-
193
- when 'degF', 'degreesF', 'Fahrenheit'
194
- hConvent[:identifier] = 'kelvin'
195
- hConvent[:name] = 'degree Fahrenheit'
196
- hConvent[:catalogSymbol] = 'degF'
197
- hConvent[:preferredUnit] = 'kelvin'
198
- hConvent[:a] = 2298.44
199
- hConvent[:b] = 5
200
- hConvent[:c] = 9
201
- hConvent[:d] = 0
202
-
203
- convClass = ConventionalUnit.new(@xml, @hResponseObj)
204
- convClass.writeXML(hConvent)
205
-
206
- when 'mph', 'miles per hour'
207
- hConvent[:identifier] = 'mi/h'
208
- hConvent[:name] = 'miles per hour'
209
- hConvent[:catalogSymbol] = 'mph'
210
- hConvent[:preferredUnit] = 'm/s'
211
- hConvent[:a] = 0
212
- hConvent[:b] = 1609.344
213
- hConvent[:c] = 0
214
- hConvent[:d] = 3600.0
215
-
216
- convClass = ConventionalUnit.new(@xml, @hResponseObj)
217
- convClass.writeXML(hConvent)
218
-
219
- when 'kph', 'kilometers per hour'
220
- hConvent[:identifier] = 'k/h'
221
- hConvent[:name] = 'kilometers per hour'
222
- hConvent[:catalogSymbol] = 'kph'
223
- hConvent[:preferredUnit] = 'm/s'
224
- hConvent[:a] = 0
225
- hConvent[:b] = 1000
226
- hConvent[:c] = 0
227
- hConvent[:d] = 3600
228
-
229
- convClass = ConventionalUnit.new(@xml, @hResponseObj)
230
- convClass.writeXML(hConvent)
231
-
232
- when 'density'
233
- hDerived = {}
234
- hDerived[:identifier] = 'kg/m^3'
235
- hDerived[:name] = 'kilograms per cubic meter'
236
- hDerived[:remarks] = 'volumetric mass density'
237
- hDerived[:catalogSymbol] = 'p'
238
- unitTerms = []
239
- unitTerms << {'uom' => 'kg', 'exponent' => '1'}
240
- unitTerms << {'uom' => 'm', 'exponent' => '-3'}
241
- hDerived[:derivationUnitTerm] = unitTerms
242
-
243
- dervClass = DerivedUnit.new(@xml, @hResponseObj)
244
- dervClass.writeXML(hDerived)
245
-
246
- else
247
- defnClass = UnitDefinition.new(@xml, @hResponseObj)
248
- defnClass.writeXML(unit)
249
-
250
- end
251
- end
252
-
253
- end
13
+ module Mdtranslator
14
+ module Writers
15
+ module Iso19115_2
16
+
17
+ class UnitsOfMeasure
18
+
19
+ def initialize(xml, hResponseObj)
20
+ @xml = xml
21
+ @hResponseObj = hResponseObj
22
+ end
23
+
24
+ def writeUnits(unit)
25
+
26
+ # define empty containers here to save lines of code
27
+ # for base units
28
+ hBase = {}
29
+ hBase[:identifier] = ''
30
+ hBase[:codeSpace] = 'http://www.bipm.org/en/si/'
31
+ hBase[:name] = ''
32
+ hBase[:catalogSymbol] = ''
33
+ hBase[:unitsSystem] = 'base unit'
34
+
35
+ # for conventional units
36
+ hConvent = {}
37
+ hConvent[:identifier] = ''
38
+ hConvent[:codeSpace] = 'http://www.bipm.org/en/si/'
39
+ hConvent[:name] = ''
40
+ hConvent[:catalogSymbol] = ''
41
+ hConvent[:preferredUnit] = ''
42
+ hConvent[:factor] = nil
43
+ hConvent[:a] = nil
44
+ hConvent[:b] = nil
45
+ hConvent[:c] = nil
46
+ hConvent[:d] = nil
47
+
48
+ # for derived units
49
+ hDerived = {}
50
+ hDerived[:identifier] = ''
51
+ hDerived[:codeSpace] = ''
52
+ hDerived[:name] = ''
53
+ hDerived[:remarks] = ''
54
+ hDerived[:catalogSymbol] = ''
55
+ hDerived[:derivationUnitTerm] = nil
56
+
57
+ # find matching units of measure
58
+ case unit
59
+
60
+ # angular degrees
61
+ when 'deg', 'degree', 'degrees'
62
+ hBase[:identifier] = 'degree'
63
+ hBase[:codeSpace] = 'urn:ogc:def:uom:1.0'
64
+ hBase[:name] = 'degree of arc'
65
+ hBase[:catalogSymbol] = 'deg'
66
+ hBase[:unitsSystem] = 'http://www.opengis.net/def/uom/OGC/1.0/degree'
67
+
68
+ baseClass = BaseUnit.new(@xml, @hResponseObj)
69
+ baseClass.writeXML(hBase)
70
+
71
+ when 'm', 'meter', 'meters', 'metre'
72
+ hBase[:identifier] = 'meter'
73
+ hBase[:name] = 'meter'
74
+ hBase[:catalogSymbol] = 'm'
75
+
76
+ baseClass = BaseUnit.new(@xml, @hResponseObj)
77
+ baseClass.writeXML(hBase)
78
+
79
+ when 'kg', 'kilogram', 'kilograms'
80
+ hBase[:identifier] = 'kilogram'
81
+ hBase[:name] = 'kilogram'
82
+ hBase[:catalogSymbol] = 'kg'
83
+
84
+ baseClass = BaseUnit.new(@xml, @hResponseObj)
85
+ baseClass.writeXML(hBase)
86
+
87
+ when 's', 'second', 'seconds'
88
+ hBase[:identifier] = 'second'
89
+ hBase[:name] = 'second'
90
+ hBase[:catalogSymbol] = 'd'
91
+
92
+ baseClass = BaseUnit.new(@xml, @hResponseObj)
93
+ baseClass.writeXML(hBase)
94
+
95
+ when 'A', 'ampere', 'amperes'
96
+ hBase[:identifier] = 'ampere'
97
+ hBase[:name] = 'ampere'
98
+ hBase[:catalogSymbol] = 'A'
99
+
100
+ baseClass = BaseUnit.new(@xml, @hResponseObj)
101
+ baseClass.writeXML(hBase)
102
+
103
+ when 'K', 'kelvin'
104
+ hBase[:identifier] = 'kelvin'
105
+ hBase[:name] = 'kelvin'
106
+ hBase[:catalogSymbol] = 'K'
107
+
108
+ baseClass = BaseUnit.new(@xml, @hResponseObj)
109
+ baseClass.writeXML(hBase)
110
+
111
+ when 'mol', 'mole', 'moles'
112
+ hBase[:identifier] = 'mole'
113
+ hBase[:name] = 'mole'
114
+ hBase[:catalogSymbol] = 'mol'
115
+
116
+ baseClass = BaseUnit.new(@xml, @hResponseObj)
117
+ baseClass.writeXML(hBase)
118
+
119
+ when 'cd', 'candela', 'candelas'
120
+ hBase[:identifier] = 'candela'
121
+ hBase[:name] = 'candela'
122
+ hBase[:catalogSymbol] = 'cd'
123
+
124
+ baseClass = BaseUnit.new(@xml, @hResponseObj)
125
+ baseClass.writeXML(hBase)
126
+
127
+ when 'ft', 'foot', 'feet'
128
+ hConvent[:identifier] = 'meter'
129
+ hConvent[:name] = 'foot'
130
+ hConvent[:catalogSymbol] = 'ft'
131
+ hConvent[:preferredUnit] = 'meter'
132
+ hConvent[:factor] = 3.280839
133
+
134
+ convClass = ConventionalUnit.new(@xml, @hResponseObj)
135
+ convClass.writeXML(hConvent)
136
+
137
+ when 'in', 'inch', 'inches'
138
+ hConvent[:identifier] = 'meter'
139
+ hConvent[:name] = 'inch'
140
+ hConvent[:catalogSymbol] = 'in'
141
+ hConvent[:preferredUnit] = 'meter'
142
+ hConvent[:factor] = 0.0254
143
+
144
+ convClass = ConventionalUnit.new(@xml, @hResponseObj)
145
+ convClass.writeXML(hConvent)
146
+
147
+ when 'mm', 'millimeter', 'millimeters'
148
+ hConvent[:identifier] = 'meter'
149
+ hConvent[:name] = 'millimeter'
150
+ hConvent[:catalogSymbol] = 'mm'
151
+ hConvent[:preferredUnit] = 'meter'
152
+ hConvent[:factor] = 0.001
153
+
154
+ convClass = ConventionalUnit.new(@xml, @hResponseObj)
155
+ convClass.writeXML(hConvent)
156
+
157
+ when 'micrometer', 'micrometers'
158
+ micro = "\u00b5"
159
+ s = micro.encode('utf-8')
160
+ s += 'm'
161
+ hConvent[:identifier] = 'meter'
162
+ hConvent[:name] = 'micrometer'
163
+ hConvent[:catalogSymbol] = s
164
+ hConvent[:preferredUnit] = 'meter'
165
+ hConvent[:factor] = 0.000001
166
+
167
+ convClass = ConventionalUnit.new(@xml, @hResponseObj)
168
+ convClass.writeXML(hConvent)
169
+
170
+ when 'nm', 'nanometer', 'nanometers'
171
+ hConvent[:identifier] = 'meter'
172
+ hConvent[:name] = 'nanometer'
173
+ hConvent[:catalogSymbol] = 'nm'
174
+ hConvent[:preferredUnit] = 'meter'
175
+ hConvent[:factor] = 0.000000001
176
+
177
+ convClass = ConventionalUnit.new(@xml, @hResponseObj)
178
+ convClass.writeXML(hConvent)
179
+
180
+ when 'degC', 'centigrade', 'degreesC', 'Celsius'
181
+ hConvent[:identifier] = 'kelvin'
182
+ hConvent[:name] = 'degree Celsius'
183
+ hConvent[:catalogSymbol] = 'degC'
184
+ hConvent[:preferredUnit] = 'kelvin'
185
+ hConvent[:a] = 273.16
186
+ hConvent[:b] = 1
187
+ hConvent[:c] = 1
188
+ hConvent[:d] = 0
189
+
190
+ convClass = ConventionalUnit.new(@xml, @hResponseObj)
191
+ convClass.writeXML(hConvent)
192
+
193
+ when 'degF', 'degreesF', 'Fahrenheit'
194
+ hConvent[:identifier] = 'kelvin'
195
+ hConvent[:name] = 'degree Fahrenheit'
196
+ hConvent[:catalogSymbol] = 'degF'
197
+ hConvent[:preferredUnit] = 'kelvin'
198
+ hConvent[:a] = 2298.44
199
+ hConvent[:b] = 5
200
+ hConvent[:c] = 9
201
+ hConvent[:d] = 0
202
+
203
+ convClass = ConventionalUnit.new(@xml, @hResponseObj)
204
+ convClass.writeXML(hConvent)
205
+
206
+ when 'mph', 'miles per hour'
207
+ hConvent[:identifier] = 'mi/h'
208
+ hConvent[:name] = 'miles per hour'
209
+ hConvent[:catalogSymbol] = 'mph'
210
+ hConvent[:preferredUnit] = 'm/s'
211
+ hConvent[:a] = 0
212
+ hConvent[:b] = 1609.344
213
+ hConvent[:c] = 0
214
+ hConvent[:d] = 3600.0
215
+
216
+ convClass = ConventionalUnit.new(@xml, @hResponseObj)
217
+ convClass.writeXML(hConvent)
218
+
219
+ when 'kph', 'kilometers per hour'
220
+ hConvent[:identifier] = 'k/h'
221
+ hConvent[:name] = 'kilometers per hour'
222
+ hConvent[:catalogSymbol] = 'kph'
223
+ hConvent[:preferredUnit] = 'm/s'
224
+ hConvent[:a] = 0
225
+ hConvent[:b] = 1000
226
+ hConvent[:c] = 0
227
+ hConvent[:d] = 3600
228
+
229
+ convClass = ConventionalUnit.new(@xml, @hResponseObj)
230
+ convClass.writeXML(hConvent)
231
+
232
+ when 'density'
233
+ hDerived = {}
234
+ hDerived[:identifier] = 'kg/m^3'
235
+ hDerived[:name] = 'kilograms per cubic meter'
236
+ hDerived[:remarks] = 'volumetric mass density'
237
+ hDerived[:catalogSymbol] = 'p'
238
+ unitTerms = []
239
+ unitTerms << {'uom' => 'kg', 'exponent' => '1'}
240
+ unitTerms << {'uom' => 'm', 'exponent' => '-3'}
241
+ hDerived[:derivationUnitTerm] = unitTerms
242
+
243
+ dervClass = DerivedUnit.new(@xml, @hResponseObj)
244
+ dervClass.writeXML(hDerived)
245
+
246
+ else
247
+ defnClass = UnitDefinition.new(@xml, @hResponseObj)
248
+ defnClass.writeXML(unit)
249
+
250
+ end
251
+ end
254
252
 
255
253
  end
256
- end
257
- end
254
+
255
+ end
256
+ end
257
+ end
258
258
  end