adiwg-mdtranslator 2.9.2 → 2.10.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 +30 -2
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +8 -8
- data/lib/adiwg/mdtranslator/internal/module_dateTimeFun.rb +179 -160
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_albers.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_azimuthEquidistant.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_equidistantConic.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_equirectangular.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_generalVertical.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_gnomonic.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_lambertConic.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_lambertEqualArea.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_mercator.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_millerCylinder.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_modifiedAlaska.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_obliqueMercator.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_orthographic.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_polarStereo.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_polyconic.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_robinson.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_sinusoidal.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_spaceOblique.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_stereographic.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_transverseMercator.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_vanDerGrinten.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_attribute.rb +16 -4
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_citation.rb +14 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_codeSet.rb +8 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_contact.rb +36 -8
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_date.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_dateTime.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_digitalForm.rb +8 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_distribution.rb +8 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_entity.rb +12 -3
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_entityAttribute.rb +5 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_entityOverview.rb +4 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_enumerated.rb +12 -3
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_fgdc.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_geodeticReference.rb +13 -4
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_geographicResolution.rb +13 -4
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_geologicAge.rb +6 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_horizontalReference.rb +3 -3
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_identification.rb +58 -12
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_keyword.rb +36 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_lineage.rb +8 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_localSystem.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapCoordinateInfo.rb +51 -12
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapGridSystem.rb +46 -9
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapLocalPlanar.rb +8 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapProjection.rb +4 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_metadataInfo.rb +10 -4
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_methodology.rb +4 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_offlineOption.rb +16 -4
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_onlineOption.rb +13 -4
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_orderProcess.rb +9 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_pointVector.rb +21 -4
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_process.rb +8 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_publication.rb +8 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_quality.rb +14 -3
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_range.rb +8 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_raster.rb +12 -3
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_security.rb +12 -3
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_series.rb +8 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_source.rb +20 -5
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_spatialDomain.rb +32 -8
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonClass.rb +8 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonSystem.rb +20 -5
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonomy.rb +8 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_transferInfo.rb +4 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_verticalAltitude.rb +12 -3
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_verticalDepth.rb +9 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/version.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_reader.rb +10 -10
- data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_validator.rb +13 -16
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_additionalDocumentation.rb +55 -55
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_address.rb +85 -85
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_allocation.rb +8 -8
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_associatedResource.rb +91 -92
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_attribute.rb +212 -212
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_attributeGroup.rb +43 -43
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_bearingDistanceResolution.rb +8 -8
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_boundingBox.rb +11 -11
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_citation.rb +17 -17
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_constraint.rb +26 -13
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_contact.rb +13 -12
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_coordinateResolution.rb +8 -5
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_coverageDescription.rb +77 -77
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dataDictionary.rb +9 -7
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_date.rb +54 -54
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dateTime.rb +35 -35
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dimension.rb +70 -70
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_distribution.rb +15 -4
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_distributor.rb +53 -53
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_domain.rb +5 -5
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_domainItem.rb +5 -5
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_duration.rb +92 -91
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entity.rb +10 -10
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityAttribute.rb +28 -18
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityForeignKey.rb +58 -59
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityIndex.rb +52 -53
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_extent.rb +70 -56
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_featureCollection.rb +64 -63
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_format.rb +6 -6
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_funding.rb +9 -6
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geoJson.rb +47 -47
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geodetic.rb +7 -7
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geographicExtent.rb +12 -7
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geographicResolution.rb +6 -5
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geologicAge.rb +6 -6
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geometryCollection.rb +63 -63
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geometryFeature.rb +84 -84
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geometryObject.rb +50 -49
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geometryProperties.rb +57 -57
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_georectifiedRepresentation.rb +115 -100
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_georeferenceableRepresentation.rb +85 -82
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_gmlIdentifier.rb +46 -46
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_graphic.rb +78 -78
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_gridRepresentation.rb +61 -56
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_identifier.rb +72 -72
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_imageDescription.rb +106 -107
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_keyword.rb +4 -4
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_keywordObject.rb +46 -46
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_legalConstraint.rb +55 -51
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_lineage.rb +87 -83
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_locale.rb +46 -46
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_maintenance.rb +73 -74
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_mdJson.rb +11 -5
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_measure.rb +56 -55
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_medium.rb +88 -88
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_metadata.rb +106 -105
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_metadataInfo.rb +4 -3
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_metadataRepository.rb +4 -4
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_obliqueLinePoint.rb +7 -4
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_onlineResource.rb +60 -61
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_orderProcess.rb +47 -47
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_party.rb +57 -57
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_phone.rb +49 -51
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_processStep.rb +6 -6
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_projectionParameters.rb +31 -30
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_referenceSystemParameters.rb +16 -2
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_releasability.rb +53 -47
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceInfo.rb +15 -13
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceType.rb +46 -46
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceUsage.rb +95 -95
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_responsibleParty.rb +67 -67
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_schema.rb +47 -46
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_scope.rb +47 -47
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_scopeDescription.rb +68 -63
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_securityConstraint.rb +50 -50
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_series.rb +38 -38
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_source.rb +8 -8
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_spatialReference.rb +6 -5
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_spatialRepresentation.rb +77 -75
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_spatialResolution.rb +8 -14
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomicClassification.rb +71 -72
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomicSystem.rb +46 -45
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomy.rb +118 -116
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_temporalExtent.rb +48 -46
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_timeInstant.rb +8 -8
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_timeInterval.rb +50 -50
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_timePeriod.rb +21 -14
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_transferOption.rb +86 -75
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_valueRange.rb +4 -4
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_vectorObject.rb +45 -45
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_vectorRepresentation.rb +45 -33
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_verticalDatum.rb +28 -6
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_verticalExtent.rb +59 -59
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_voucher.rb +43 -43
- data/lib/adiwg/mdtranslator/readers/mdReaders.rb +6 -2
- data/lib/adiwg/mdtranslator/version.rb +9 -1
- data/lib/adiwg/mdtranslator/writers/html/sections/html_entityAttribute.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_featureConstraint.rb +50 -46
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_multiplicity.rb +53 -43
- data/lib/adiwg/mdtranslator/writers/iso19110/version.rb +3 -1
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entityAttribute.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/mdWriters.rb +58 -58
- data/lib/adiwg/mdtranslator.rb +177 -165
- data/lib/adiwg/mdtranslator_cli.rb +8 -3
- metadata +2 -2
@@ -2,223 +2,223 @@
|
|
2
2
|
# Reader - ADIwg JSON to internal data structure
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2018-02-18 refactored error and warning messaging
|
5
6
|
# Stan Smith 2016-10-18 original script
|
6
7
|
|
7
8
|
require_relative 'module_identifier'
|
8
9
|
|
9
10
|
module ADIWG
|
10
|
-
|
11
|
-
|
12
|
-
|
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
|
-
end
|
218
|
-
|
219
|
-
end
|
11
|
+
module Mdtranslator
|
12
|
+
module Readers
|
13
|
+
module MdJson
|
14
|
+
|
15
|
+
module Attribute
|
16
|
+
|
17
|
+
def self.unpack(hAttribute, responseObj)
|
18
|
+
|
19
|
+
# return nil object if input is empty
|
20
|
+
if hAttribute.empty?
|
21
|
+
responseObj[:readerExecutionMessages] << 'WARNING: mdJson reader: coverage description attribute object is empty'
|
22
|
+
return nil
|
23
|
+
end
|
24
|
+
|
25
|
+
# instance classes needed in script
|
26
|
+
intMetadataClass = InternalMetadata.new
|
27
|
+
intAttGroup = intMetadataClass.newAttribute
|
28
|
+
|
29
|
+
# attribute group - sequence identifier
|
30
|
+
if hAttribute.has_key?('sequenceIdentifier')
|
31
|
+
unless hAttribute['sequenceIdentifier'] == ''
|
32
|
+
intAttGroup[:sequenceIdentifier] = hAttribute['sequenceIdentifier']
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
# attribute group - sequence identifier type (required if)
|
37
|
+
unless intAttGroup[:sequenceIdentifier].nil?
|
38
|
+
if hAttribute.has_key?('sequenceIdentifierType')
|
39
|
+
unless hAttribute['sequenceIdentifierType'] == ''
|
40
|
+
intAttGroup[:sequenceIdentifierType] = hAttribute['sequenceIdentifierType']
|
41
|
+
end
|
42
|
+
end
|
43
|
+
if intAttGroup[:sequenceIdentifierType].nil?
|
44
|
+
responseObj[:readerExecutionMessages] << 'ERROR: mdJson reader: coverage description attribute sequence identifierType is missing'
|
45
|
+
responseObj[:readerExecutionPass] = false
|
46
|
+
return nil
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
# attribute group - attribute description
|
51
|
+
if hAttribute.has_key?('attributeDescription')
|
52
|
+
unless hAttribute['attributeDescription'] == ''
|
53
|
+
intAttGroup[:attributeDescription] = hAttribute['attributeDescription']
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
# attribute group - attribute identifier [identifier]
|
58
|
+
if hAttribute.has_key?('attributeIdentifier')
|
59
|
+
aItems = hAttribute['attributeIdentifier']
|
60
|
+
aItems.each do |item|
|
61
|
+
hReturn = Identifier.unpack(item, responseObj)
|
62
|
+
unless hReturn.nil?
|
63
|
+
intAttGroup[:attributeIdentifiers] << hReturn
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
# attribute group - min value
|
69
|
+
if hAttribute.has_key?('minValue')
|
70
|
+
unless hAttribute['minValue'] == ''
|
71
|
+
intAttGroup[:minValue] = hAttribute['minValue']
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# attribute group - max value
|
76
|
+
if hAttribute.has_key?('maxValue')
|
77
|
+
unless hAttribute['maxValue'] == ''
|
78
|
+
intAttGroup[:maxValue] = hAttribute['maxValue']
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
# attribute group - units (required if)
|
83
|
+
unless intAttGroup[:minValue].nil? && intAttGroup[:maxValue].nil?
|
84
|
+
if hAttribute.has_key?('units')
|
85
|
+
unless hAttribute['units'] == ''
|
86
|
+
intAttGroup[:units] = hAttribute['units']
|
87
|
+
end
|
88
|
+
end
|
89
|
+
if intAttGroup[:units].nil?
|
90
|
+
responseObj[:readerExecutionMessages] << 'ERROR: mdJson reader: coverage description attribute units are missing'
|
91
|
+
responseObj[:readerExecutionPass] = false
|
92
|
+
return nil
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
# attribute group - scale factor
|
97
|
+
if hAttribute.has_key?('scaleFactor')
|
98
|
+
unless hAttribute['scaleFactor'] == ''
|
99
|
+
intAttGroup[:scaleFactor] = hAttribute['scaleFactor']
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
# attribute group - offset
|
104
|
+
if hAttribute.has_key?('offset')
|
105
|
+
unless hAttribute['offset'] == ''
|
106
|
+
intAttGroup[:offset] = hAttribute['offset']
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
# attribute group - mean value
|
111
|
+
if hAttribute.has_key?('meanValue')
|
112
|
+
unless hAttribute['meanValue'] == ''
|
113
|
+
intAttGroup[:meanValue] = hAttribute['meanValue']
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
# attribute group - number of values
|
118
|
+
if hAttribute.has_key?('numberOfValues')
|
119
|
+
unless hAttribute['numberOfValues'] == ''
|
120
|
+
intAttGroup[:numberOfValues] = hAttribute['numberOfValues']
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
# attribute group - standard deviation
|
125
|
+
if hAttribute.has_key?('standardDeviation')
|
126
|
+
unless hAttribute['standardDeviation'] == ''
|
127
|
+
intAttGroup[:standardDeviation] = hAttribute['standardDeviation']
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
# attribute group - bits per value
|
132
|
+
if hAttribute.has_key?('bitsPerValue')
|
133
|
+
unless hAttribute['bitsPerValue'] == ''
|
134
|
+
intAttGroup[:bitsPerValue] = hAttribute['bitsPerValue']
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
# attribute group - bound min
|
139
|
+
if hAttribute.has_key?('boundMin')
|
140
|
+
unless hAttribute['boundMin'] == ''
|
141
|
+
intAttGroup[:boundMin] = hAttribute['boundMin']
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
# attribute group - bound max
|
146
|
+
if hAttribute.has_key?('boundMax')
|
147
|
+
unless hAttribute['boundMax'] == ''
|
148
|
+
intAttGroup[:boundMax] = hAttribute['boundMax']
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
# attribute group - bound units (required if)
|
153
|
+
unless intAttGroup[:boundMin].nil? && intAttGroup[:boundMax].nil?
|
154
|
+
if hAttribute.has_key?('boundUnits')
|
155
|
+
unless hAttribute['boundUnits'] == ''
|
156
|
+
intAttGroup[:boundUnits] = hAttribute['boundUnits']
|
157
|
+
end
|
158
|
+
end
|
159
|
+
if intAttGroup[:boundUnits].nil?
|
160
|
+
responseObj[:readerExecutionMessages] << 'ERROR: mdJson reader: coverage description attribute bound units are missing'
|
161
|
+
responseObj[:readerExecutionPass] = false
|
162
|
+
return nil
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
# attribute group - peak response
|
167
|
+
if hAttribute.has_key?('peakResponse')
|
168
|
+
unless hAttribute['peakResponse'] == ''
|
169
|
+
intAttGroup[:peakResponse] = hAttribute['peakResponse']
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
# attribute group - tone gradations
|
174
|
+
if hAttribute.has_key?('toneGradations')
|
175
|
+
unless hAttribute['toneGradations'] == ''
|
176
|
+
intAttGroup[:toneGradations] = hAttribute['toneGradations']
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
# attribute group - band boundary definition
|
181
|
+
if hAttribute.has_key?('bandBoundaryDefinition')
|
182
|
+
unless hAttribute['bandBoundaryDefinition'] == ''
|
183
|
+
intAttGroup[:bandBoundaryDefinition] = hAttribute['bandBoundaryDefinition']
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
# attribute group - nominal spatial resolution {measure}
|
188
|
+
if hAttribute.has_key?('nominalSpatialResolution')
|
189
|
+
unless hAttribute['nominalSpatialResolution'] == ''
|
190
|
+
intAttGroup[:nominalSpatialResolution] = hAttribute['nominalSpatialResolution']
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
# attribute group - transfer function type
|
195
|
+
if hAttribute.has_key?('transferFunctionType')
|
196
|
+
unless hAttribute['transferFunctionType'] == ''
|
197
|
+
intAttGroup[:transferFunctionType] = hAttribute['transferFunctionType']
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
201
|
+
# attribute group - transmitted polarization
|
202
|
+
if hAttribute.has_key?('transmittedPolarization')
|
203
|
+
unless hAttribute['transmittedPolarization'] == ''
|
204
|
+
intAttGroup[:transmittedPolarization] = hAttribute['transmittedPolarization']
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
# attribute group - detected polarization
|
209
|
+
if hAttribute.has_key?('detectedPolarization')
|
210
|
+
unless hAttribute['detectedPolarization'] == ''
|
211
|
+
intAttGroup[:detectedPolarization] = hAttribute['detectedPolarization']
|
212
|
+
end
|
213
|
+
end
|
214
|
+
|
215
|
+
return intAttGroup
|
216
|
+
|
217
|
+
end
|
220
218
|
|
221
219
|
end
|
222
|
-
|
223
|
-
|
220
|
+
|
221
|
+
end
|
222
|
+
end
|
223
|
+
end
|
224
224
|
end
|
@@ -2,62 +2,62 @@
|
|
2
2
|
# Reader - ADIwg JSON to internal data structure
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2018-02-18 refactored error and warning messaging
|
5
6
|
# Stan Smith 2016-10-18 original script
|
6
7
|
|
7
8
|
require_relative 'module_attribute'
|
8
9
|
|
9
10
|
module ADIWG
|
10
|
-
|
11
|
-
|
12
|
-
|
11
|
+
module Mdtranslator
|
12
|
+
module Readers
|
13
|
+
module MdJson
|
13
14
|
|
14
|
-
|
15
|
+
module AttributeGroup
|
15
16
|
|
16
|
-
|
17
|
+
def self.unpack(hAttGroup, responseObj)
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
end
|
19
|
+
# return nil object if input is empty
|
20
|
+
if hAttGroup.empty?
|
21
|
+
responseObj[:readerExecutionMessages] << 'WARNING: mdJson reader: coverage description attribute group object is empty'
|
22
|
+
return nil
|
23
|
+
end
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
# attribute group - attribute content type [] (required)
|
30
|
-
if hAttGroup.has_key?('attributeContentType')
|
31
|
-
hAttGroup['attributeContentType'].each do |item|
|
32
|
-
if item != ''
|
33
|
-
intAttGroup[:attributeContentTypes] << item
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
if intAttGroup[:attributeContentTypes].empty?
|
38
|
-
responseObj[:readerExecutionMessages] << 'Attribute Group attribute attributeContentType is missing'
|
39
|
-
responseObj[:readerExecutionPass] = false
|
40
|
-
return nil
|
41
|
-
end
|
25
|
+
# instance classes needed in script
|
26
|
+
intMetadataClass = InternalMetadata.new
|
27
|
+
intAttGroup = intMetadataClass.newAttributeGroup
|
42
28
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
unless hReturn.nil?
|
49
|
-
intAttGroup[:attributes] << hReturn
|
50
|
-
end
|
51
|
-
end
|
29
|
+
# attribute group - attribute content type [] (required)
|
30
|
+
if hAttGroup.has_key?('attributeContentType')
|
31
|
+
hAttGroup['attributeContentType'].each do |item|
|
32
|
+
unless item == ''
|
33
|
+
intAttGroup[:attributeContentTypes] << item
|
52
34
|
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
if intAttGroup[:attributeContentTypes].empty?
|
38
|
+
responseObj[:readerExecutionMessages] << 'ERROR: mdJson reader: coverage description attribute group attribute content type is missing'
|
39
|
+
responseObj[:readerExecutionPass] = false
|
40
|
+
return nil
|
41
|
+
end
|
42
|
+
|
43
|
+
# attribute group - attribute []
|
44
|
+
if hAttGroup.has_key?('attribute')
|
45
|
+
aItems = hAttGroup['attribute']
|
46
|
+
aItems.each do |item|
|
47
|
+
hReturn = Attribute.unpack(item, responseObj)
|
48
|
+
unless hReturn.nil?
|
49
|
+
intAttGroup[:attributes] << hReturn
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
53
|
|
54
|
-
|
55
|
-
|
56
|
-
end
|
54
|
+
return intAttGroup
|
57
55
|
|
58
|
-
|
56
|
+
end
|
59
57
|
|
60
58
|
end
|
61
|
-
|
62
|
-
|
59
|
+
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
63
|
end
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# Reader - ADIwg JSON to internal data structure
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2018-02-18 refactored error and warning messaging
|
5
6
|
# Stan Smith 2017-10-19 original script
|
6
7
|
|
7
8
|
module ADIWG
|
@@ -15,8 +16,7 @@ module ADIWG
|
|
15
16
|
|
16
17
|
# return nil object if input is empty
|
17
18
|
if hBearRes.empty?
|
18
|
-
responseObj[:readerExecutionMessages] << '
|
19
|
-
responseObj[:readerExecutionPass] = false
|
19
|
+
responseObj[:readerExecutionMessages] << 'WARNING: mdJson reader: bearing distance resolution object is empty'
|
20
20
|
return nil
|
21
21
|
end
|
22
22
|
|
@@ -29,7 +29,7 @@ module ADIWG
|
|
29
29
|
intBearRes[:distanceResolution] = hBearRes['distanceResolution']
|
30
30
|
end
|
31
31
|
if intBearRes[:distanceResolution].nil? || intBearRes[:distanceResolution] == ''
|
32
|
-
responseObj[:readerExecutionMessages] << '
|
32
|
+
responseObj[:readerExecutionMessages] << 'ERROR: mdJson reader: bearing distance resolution is missing distance resolution'
|
33
33
|
responseObj[:readerExecutionPass] = false
|
34
34
|
return nil
|
35
35
|
end
|
@@ -39,7 +39,7 @@ module ADIWG
|
|
39
39
|
intBearRes[:distanceUnitOfMeasure] = hBearRes['distanceUnitOfMeasure']
|
40
40
|
end
|
41
41
|
if intBearRes[:distanceUnitOfMeasure].nil? || intBearRes[:distanceUnitOfMeasure] == ''
|
42
|
-
responseObj[:readerExecutionMessages] << '
|
42
|
+
responseObj[:readerExecutionMessages] << 'ERROR: mdJson reader: bearing distance resolution distance units are missing'
|
43
43
|
responseObj[:readerExecutionPass] = false
|
44
44
|
return nil
|
45
45
|
end
|
@@ -49,7 +49,7 @@ module ADIWG
|
|
49
49
|
intBearRes[:bearingResolution] = hBearRes['bearingResolution']
|
50
50
|
end
|
51
51
|
if intBearRes[:bearingResolution].nil? || intBearRes[:bearingResolution] == ''
|
52
|
-
responseObj[:readerExecutionMessages] << '
|
52
|
+
responseObj[:readerExecutionMessages] << 'ERROR: mdJson reader: bearing distance resolution bearing resolution is missing '
|
53
53
|
responseObj[:readerExecutionPass] = false
|
54
54
|
return nil
|
55
55
|
end
|
@@ -59,7 +59,7 @@ module ADIWG
|
|
59
59
|
intBearRes[:bearingUnitOfMeasure] = hBearRes['bearingUnitOfMeasure']
|
60
60
|
end
|
61
61
|
if intBearRes[:bearingUnitOfMeasure].nil? || intBearRes[:bearingUnitOfMeasure] == ''
|
62
|
-
responseObj[:readerExecutionMessages] << '
|
62
|
+
responseObj[:readerExecutionMessages] << 'ERROR: mdJson reader: bearing distance resolution bearing units is missing'
|
63
63
|
responseObj[:readerExecutionPass] = false
|
64
64
|
return nil
|
65
65
|
end
|
@@ -69,7 +69,7 @@ module ADIWG
|
|
69
69
|
intBearRes[:bearingReferenceDirection] = hBearRes['bearingReferenceDirection']
|
70
70
|
end
|
71
71
|
if intBearRes[:bearingReferenceDirection].nil? || intBearRes[:bearingReferenceDirection] == ''
|
72
|
-
responseObj[:readerExecutionMessages] << '
|
72
|
+
responseObj[:readerExecutionMessages] << 'ERROR: mdJson reader: bearing distance resolution bearing direction is missing'
|
73
73
|
responseObj[:readerExecutionPass] = false
|
74
74
|
return nil
|
75
75
|
end
|
@@ -79,7 +79,7 @@ module ADIWG
|
|
79
79
|
intBearRes[:bearingReferenceMeridian] = hBearRes['bearingReferenceMeridian']
|
80
80
|
end
|
81
81
|
if intBearRes[:bearingReferenceMeridian].nil? || intBearRes[:bearingReferenceMeridian] == ''
|
82
|
-
responseObj[:readerExecutionMessages] << '
|
82
|
+
responseObj[:readerExecutionMessages] << 'ERROR: mdJson reader: bearing distance resolution bearing meridian is missing'
|
83
83
|
responseObj[:readerExecutionPass] = false
|
84
84
|
return nil
|
85
85
|
end
|