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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -1
- data/adiwg-mdtranslator.gemspec +1 -1
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +2 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/fgdc_reader.rb +4 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityAttribute.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_georectifiedRepresentation.rb +7 -12
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceInfo.rb +12 -11
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_source.rb +15 -7
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomy.rb +1 -6
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_timePeriod.rb +15 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_transferOption.rb +1 -3
- data/lib/adiwg/mdtranslator/version.rb +5 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_citation.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_contact.rb +4 -2
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicAge.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_identification.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_method.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_source.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomyKeywords.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomySystem.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_fcFeatureCatalogue.rb +7 -7
- data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb +6 -5
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_address.rb +104 -104
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_aggregateInformation.rb +63 -60
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/{class_attributeGroup.rb → class_attribute.rb} +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_baseUnit.rb +23 -23
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_boundingBox.rb +64 -60
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_browseGraphic.rb +55 -51
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_citation.rb +24 -14
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_contact.rb +96 -91
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_conventionalUnit.rb +45 -45
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_coverageDescription.rb +104 -77
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_crs.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataIdentification.rb +23 -8
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataQuality.rb +57 -52
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_date.rb +49 -46
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_definitionUnit.rb +20 -20
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_derivedUnit.rb +32 -32
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dimension.rb +56 -50
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_distribution.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_distributor.rb +77 -74
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_enumerationList.rb +34 -34
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_extension.rb +190 -186
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_extent.rb +66 -66
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_feature.rb +50 -45
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_featureCollection.rb +35 -35
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_featureProperties.rb +43 -43
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_format.rb +73 -69
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_fraction.rb +37 -33
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geographicElement.rb +59 -54
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geographicExtent.rb +58 -58
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geometricObjects.rb +49 -46
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geometryCollection.rb +68 -63
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_georectified.rb +113 -110
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_georeferenceable.rb +78 -75
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gmlIdentifier.rb +17 -17
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_grid.rb +55 -52
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gridRepresentation.rb +19 -19
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_hierarchy.rb +47 -47
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_image.rb +132 -132
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_keyword.rb +5 -2
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_lineString.rb +70 -70
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_lineage.rb +55 -55
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_locale.rb +51 -48
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_maintenance.rb +114 -105
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_mdBand.rb +111 -111
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_mdIdentifier.rb +9 -3
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_measure.rb +58 -41
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_medium.rb +104 -104
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_miBand.rb +70 -70
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_miMetadata.rb +51 -16
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_multiLine.rb +70 -70
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_multiPoint.rb +70 -70
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_multiPolygon.rb +70 -70
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_onlineResource.rb +79 -76
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_orderProcess.rb +67 -67
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_phone.rb +67 -67
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_point.rb +8 -8
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_polygon.rb +89 -89
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_processStep.rb +9 -3
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_rangeDimension.rb +59 -54
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_referenceSystem.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_resolution.rb +47 -47
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_responsibleParty.rb +111 -105
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_rsIdentifier.rb +71 -65
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_scope.rb +54 -50
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_scopeDescription.rb +45 -42
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_securityConstraints.rb +92 -89
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_series.rb +55 -55
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_source.rb +98 -91
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_spatialRepresentation.rb +42 -42
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_taxonomicClassification.rb +63 -59
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_taxonomicSystem.rb +40 -40
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_taxonomy.rb +133 -130
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_temporalExtent.rb +49 -49
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_timeInstant.rb +60 -60
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_timePeriod.rb +110 -108
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_transferOptions.rb +71 -69
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_unitsOfMeasure.rb +243 -243
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_usage.rb +98 -95
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_useConstraints.rb +38 -38
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_vectorRepresentation.rb +48 -48
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_verticalExtent.rb +74 -70
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_vouchers.rb +56 -53
- data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer.rb +61 -11
- data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer_messages_eng.yml +109 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_2/version.rb +3 -2
- data/lib/adiwg/mdtranslator_cli.rb +21 -4
- metadata +6 -5
@@ -10,249 +10,249 @@ require_relative 'class_derivedUnit'
|
|
10
10
|
require_relative 'class_definitionUnit'
|
11
11
|
|
12
12
|
module ADIWG
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
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
|
-
|
257
|
-
|
254
|
+
|
255
|
+
end
|
256
|
+
end
|
257
|
+
end
|
258
258
|
end
|