adiwg-mdtranslator 2.10.0 → 2.12.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +20 -1
  3. data/adiwg-mdtranslator.gemspec +1 -1
  4. data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +23 -24
  5. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_identification.rb +2 -1
  6. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_localSystem.rb +2 -1
  7. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonClass.rb +4 -2
  8. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_allocation.rb +13 -0
  9. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_contactPostprocess.rb +38 -0
  10. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityAttribute.rb +2 -2
  11. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_mdJson.rb +5 -0
  12. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_projectionParameters.rb +2 -1
  13. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceInfo.rb +17 -6
  14. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_spatialResolution.rb +1 -2
  15. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomicClassification.rb +24 -5
  16. data/lib/adiwg/mdtranslator/version.rb +8 -1
  17. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_address.rb +10 -10
  18. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_attribute.rb +21 -16
  19. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_browse.rb +8 -7
  20. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_citation.rb +11 -11
  21. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_constraint.rb +6 -4
  22. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_contact.rb +14 -14
  23. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dataDomain.rb +18 -18
  24. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dateRange.rb +10 -7
  25. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dateSingle.rb +5 -2
  26. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_description.rb +10 -4
  27. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dictionary.rb +7 -9
  28. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_digitalForm.rb +7 -4
  29. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_distribution.rb +9 -5
  30. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_entityDetail.rb +15 -11
  31. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_entityOverview.rb +7 -4
  32. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_fgdc.rb +1 -1
  33. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geodeticReference.rb +7 -6
  34. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geographicResolution.rb +8 -7
  35. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicAge.rb +5 -4
  36. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicRange.rb +6 -5
  37. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_identification.rb +22 -18
  38. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_keyword.rb +32 -12
  39. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_lineage.rb +4 -2
  40. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_localSystem.rb +17 -6
  41. data/lib/adiwg/mdtranslator/writers/fgdc/classes/{class_mapProjection.rb → class_mapProjectionTags.rb} +33 -57
  42. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_metadataInfo.rb +9 -12
  43. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_method.rb +7 -8
  44. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_methodKeywords.rb +16 -8
  45. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_offlineOption.rb +24 -19
  46. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_onlineOption.rb +7 -4
  47. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_orderProcess.rb +8 -5
  48. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_phone.rb +6 -3
  49. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarGrid.rb +146 -0
  50. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarInfo.rb +168 -0
  51. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarLocal.rb +42 -0
  52. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarMap.rb +294 -0
  53. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarReference.rb +47 -328
  54. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_process.rb +6 -6
  55. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_publisher.rb +6 -4
  56. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_quality.rb +3 -2
  57. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_security.rb +5 -6
  58. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_series.rb +4 -4
  59. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_source.rb +11 -14
  60. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialDomain.rb +8 -8
  61. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialOrganization.rb +5 -2
  62. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialReference.rb +22 -7
  63. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_status.rb +8 -7
  64. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomy.rb +4 -2
  65. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomyClassification.rb +5 -4
  66. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomyKeywords.rb +17 -10
  67. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomySystem.rb +11 -15
  68. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_timePeriod.rb +9 -7
  69. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_transferInfo.rb +4 -2
  70. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_verticalDatum.rb +11 -17
  71. data/lib/adiwg/mdtranslator/writers/fgdc/fgdc_writer.rb +53 -3
  72. data/lib/adiwg/mdtranslator/writers/fgdc/fgdc_writer_messages_eng.yml +213 -0
  73. data/lib/adiwg/mdtranslator/writers/fgdc/version.rb +3 -2
  74. data/lib/adiwg/mdtranslator/writers/html/sections/html_allocation.rb +13 -1
  75. data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceInfo.rb +11 -1
  76. data/lib/adiwg/mdtranslator/writers/html/sections/html_taxonomy.rb +10 -10
  77. data/lib/adiwg/mdtranslator/writers/html/sections/html_taxonomyClass.rb +4 -4
  78. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_baseUnit.rb +27 -27
  79. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_citation.rb +5 -2
  80. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_codelist.rb +38 -38
  81. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_contact.rb +79 -79
  82. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_conventionalUnit.rb +49 -49
  83. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_date.rb +5 -2
  84. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_definitionUnit.rb +24 -24
  85. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_derivedUnit.rb +36 -36
  86. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_domain.rb +28 -21
  87. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_fcFeatureCatalogue.rb +12 -9
  88. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_featureAttribute.rb +9 -3
  89. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_featureType.rb +8 -3
  90. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_listedValue.rb +7 -4
  91. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_locale.rb +52 -49
  92. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_mdIdentifier.rb +4 -1
  93. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_multiplicity.rb +15 -0
  94. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_onlineResource.rb +79 -76
  95. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_phone.rb +67 -67
  96. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_responsibleParty.rb +117 -108
  97. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_unitsOfMeasure.rb +246 -246
  98. data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb +44 -6
  99. data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer_messages_eng.yml +40 -0
  100. data/lib/adiwg/mdtranslator/writers/iso19110/version.rb +6 -5
  101. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataIdentification.rb +13 -6
  102. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_extension.rb +1 -1
  103. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_allocation.rb +3 -0
  104. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_resourceInfo.rb +5 -4
  105. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_taxonomicClassification.rb +6 -4
  106. data/lib/adiwg/mdtranslator_cli.rb +18 -8
  107. metadata +14 -8
  108. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_mapCoordinateInfo.rb +0 -167
@@ -2,9 +2,12 @@
2
2
  # FGDC CSDGM writer output in XML
3
3
 
4
4
  # History:
5
- # Stan Smith 2018-01-02 original script
5
+ # Stan Smith 2018-03-21 original script
6
6
 
7
- require_relative 'class_mapProjection'
7
+ require_relative 'class_planarMap'
8
+ require_relative 'class_planarGrid'
9
+ require_relative 'class_planarLocal'
10
+ require_relative 'class_planarInfo'
8
11
 
9
12
  module ADIWG
10
13
  module Mdtranslator
@@ -18,351 +21,67 @@ module ADIWG
18
21
  @hResponseObj = hResponseObj
19
22
  end
20
23
 
21
- def writeXML(hProjection)
24
+ def writeXML(aSpaceRefs, aRepTypes, aResolutions)
22
25
 
23
26
  # classes used
24
- classProjection = MapProjection.new(@xml, @hResponseObj)
27
+ classMap = PlanarMap.new(@xml, @hResponseObj)
28
+ classGrid = PlanarGrid.new(@xml, @hResponseObj)
29
+ classLocal = PlanarLocal.new(@xml, @hResponseObj)
30
+ classInfo = PlanarInformation.new(@xml, @hResponseObj)
31
+
32
+ # <- planar 4.1.2 ...
33
+ # <- spatialReferences[].systemParameterSet.projection (map) 4.1.2.1
34
+ # <- spatialReferences[].systemParameterSet.projection (grid) 4.1.2.2
35
+ # <- spatialReferences[].systemParameterSet.projection (localPlanar) 4.1.2.3
36
+ # <- planar information 4.1.2.4 ...
25
37
 
26
38
  # planar 4.1.2.1 (mapproj) - map projection
27
- # <- hProjection.projectionName = oneOf ...
28
- projection = hProjection[:projection]
29
- case projection
30
- when 'alaska'
31
- @xml.tag!('mapproj') do
32
- classProjection.write_name('Modified Stereographic for Alaska')
33
- @xml.tag!('modsak') do
34
- classProjection.write_falseNE(hProjection)
35
- end
36
- end
37
- when 'albers'
38
- @xml.tag!('mapproj') do
39
- classProjection.write_name('Albers Conical Equal Area')
40
- @xml.tag!('albers') do
41
- classProjection.write_standParallel(hProjection)
42
- classProjection.write_longCM(hProjection)
43
- classProjection.write_latPO(hProjection)
44
- classProjection.write_falseNE(hProjection)
45
- end
46
- end
47
- when 'azimuthalEquidistant'
48
- @xml.tag!('mapproj') do
49
- classProjection.write_name('Azimuthal Equidistant')
50
- @xml.tag!('azimequi') do
51
- classProjection.write_longCM(hProjection)
52
- classProjection.write_latPO(hProjection)
53
- classProjection.write_falseNE(hProjection)
54
- end
55
- end
56
- when 'equidistantConic'
57
- @xml.tag!('mapproj') do
58
- classProjection.write_name('Equidistant Conic')
59
- @xml.tag!('equicon') do
60
- classProjection.write_standParallel(hProjection)
61
- classProjection.write_longCM(hProjection)
62
- classProjection.write_latPO(hProjection)
63
- classProjection.write_falseNE(hProjection)
64
- end
65
- end
66
- when 'equirectangular'
67
- @xml.tag!('mapproj') do
68
- classProjection.write_name('Equirectangular')
69
- @xml.tag!('equirect') do
70
- classProjection.write_standParallel(hProjection)
71
- classProjection.write_longCM(hProjection)
72
- classProjection.write_falseNE(hProjection)
73
- end
74
- end
75
- when 'generalVertical'
76
- @xml.tag!('mapproj') do
77
- classProjection.write_name('General Vertical Near-sided Perspective')
78
- @xml.tag!('gvnsp') do
79
- classProjection.write_heightPP(hProjection)
80
- classProjection.write_longPC(hProjection)
81
- classProjection.write_latPC(hProjection)
82
- classProjection.write_falseNE(hProjection)
83
- end
84
- end
85
- when 'gnomonic'
86
- @xml.tag!('mapproj') do
87
- classProjection.write_name('Gnomonic')
88
- @xml.tag!('gnomonic') do
89
- classProjection.write_longPC(hProjection)
90
- classProjection.write_latPC(hProjection)
91
- classProjection.write_falseNE(hProjection)
92
- end
93
- end
94
- when 'lambertEqualArea'
95
- @xml.tag!('mapproj') do
96
- classProjection.write_name('Lambert Azimuthal Equal Area')
97
- @xml.tag!('lamberta') do
98
- classProjection.write_longPC(hProjection)
99
- classProjection.write_latPC(hProjection)
100
- classProjection.write_falseNE(hProjection)
101
- end
102
- end
103
- when 'lambertConic'
104
- @xml.tag!('mapproj') do
105
- classProjection.write_name('Lambert Conformal Conic')
106
- @xml.tag!('lambertc') do
107
- classProjection.write_standParallel(hProjection)
108
- classProjection.write_longCM(hProjection)
109
- classProjection.write_latPO(hProjection)
110
- classProjection.write_falseNE(hProjection)
111
- end
112
- end
113
- when 'mercator'
114
- @xml.tag!('mapproj') do
115
- classProjection.write_name('Mercator')
116
- @xml.tag!('mercator') do
117
- if hProjection[:standardParallel1] || hProjection[:standardParallel2]
118
- classProjection.write_standParallel(hProjection)
119
- elsif hProjection[:scaleFactorAtEquator]
120
- classProjection.write_scaleFactorE(hProjection)
39
+ aSpaceRefs.each do |hSpaceRef|
40
+ unless hSpaceRef[:systemParameterSet].empty?
41
+ if hSpaceRef[:systemParameterSet][:projection]
42
+ hProjection = hSpaceRef[:systemParameterSet][:projection]
43
+ unless hProjection.empty?
44
+ unless hProjection[:projection].nil?
45
+ classMap.writeXML(hProjection)
121
46
  end
122
- classProjection.write_longCM(hProjection)
123
- classProjection.write_falseNE(hProjection)
124
- end
125
- end
126
- when 'miller'
127
- @xml.tag!('mapproj') do
128
- classProjection.write_name('Miller Cylindrical')
129
- @xml.tag!('miller') do
130
- classProjection.write_longCM(hProjection)
131
- classProjection.write_falseNE(hProjection)
132
- end
133
- end
134
- when 'obliqueMercator'
135
- @xml.tag!('mapproj') do
136
- classProjection.write_name('Oblique Mercator')
137
- @xml.tag!('obqmerc') do
138
- classProjection.write_scaleFactorCL(hProjection)
139
- if hProjection[:obliqueLinePoints].empty?
140
- classProjection.write_obliqueLineAzimuth(hProjection)
141
- else
142
- @xml.tag!('obqlpt') do
143
- hProjection[:obliqueLinePoints].each do |hLinePt|
144
- classProjection.write_obliqueLinePoint(hLinePt)
145
- end
146
- end
147
- end
148
- classProjection.write_latPO(hProjection)
149
- classProjection.write_falseNE(hProjection)
150
- end
151
- end
152
- when 'orthographic'
153
- @xml.tag!('mapproj') do
154
- classProjection.write_name('Orthographic')
155
- @xml.tag!('orthogr') do
156
- classProjection.write_longPC(hProjection)
157
- classProjection.write_latPC(hProjection)
158
- classProjection.write_falseNE(hProjection)
159
- end
160
- end
161
- when 'polarStereo'
162
- @xml.tag!('mapproj') do
163
- classProjection.write_name('Polar Stereographic')
164
- @xml.tag!('polarst') do
165
- classProjection.write_straightFromPole(hProjection)
166
- if hProjection[:standardParallel1] || hProjection[:standardParallel2]
167
- classProjection.write_standParallel(hProjection)
168
- elsif hProjection[:scaleFactorAtProjectionOrigin]
169
- classProjection.write_scaleFactorPO(hProjection)
170
- end
171
- classProjection.write_falseNE(hProjection)
172
- end
173
- end
174
- when 'polyconic'
175
- @xml.tag!('mapproj') do
176
- classProjection.write_name('Polyconic')
177
- @xml.tag!('polycon') do
178
- classProjection.write_longCM(hProjection)
179
- classProjection.write_latPO(hProjection)
180
- classProjection.write_falseNE(hProjection)
181
- end
182
- end
183
- when 'robinson'
184
- @xml.tag!('mapproj') do
185
- classProjection.write_name('Robinson')
186
- @xml.tag!('robinson') do
187
- classProjection.write_longPC(hProjection)
188
- classProjection.write_falseNE(hProjection)
189
- end
190
- end
191
- when 'sinusoidal'
192
- @xml.tag!('mapproj') do
193
- classProjection.write_name('Sinusoidal')
194
- @xml.tag!('sinusoid') do
195
- classProjection.write_longCM(hProjection)
196
- classProjection.write_falseNE(hProjection)
197
- end
198
- end
199
- when 'spaceOblique'
200
- @xml.tag!('mapproj') do
201
- classProjection.write_name('Space Oblique Mercator')
202
- @xml.tag!('spaceobq') do
203
- classProjection.write_landsat(hProjection)
204
- classProjection.write_landsatPath(hProjection)
205
- classProjection.write_falseNE(hProjection)
206
- end
207
- end
208
- when 'stereographic'
209
- @xml.tag!('mapproj') do
210
- classProjection.write_name('Stereographic')
211
- @xml.tag!('stereo') do
212
- classProjection.write_longPC(hProjection)
213
- classProjection.write_latPC(hProjection)
214
- classProjection.write_falseNE(hProjection)
215
- end
216
- end
217
- when 'transverseMercator'
218
- @xml.tag!('mapproj') do
219
- classProjection.write_name('Transverse Mercator')
220
- @xml.tag!('transmer') do
221
- classProjection.write_scaleFactorCM(hProjection)
222
- classProjection.write_longCM(hProjection)
223
- classProjection.write_latPO(hProjection)
224
- classProjection.write_falseNE(hProjection)
225
- end
226
- end
227
- when 'grinten'
228
- @xml.tag!('mapproj') do
229
- classProjection.write_name('van der Grinten')
230
- @xml.tag!('vdgrin') do
231
- classProjection.write_longCM(hProjection)
232
- classProjection.write_falseNE(hProjection)
233
- end
234
- end
235
- when 'parameters'
236
- @xml.tag!('mapproj') do
237
- classProjection.write_name('Map Projection Parameters')
238
- @xml.tag!('mapprojp') do
239
- classProjection.write_allParams(hProjection)
240
47
  end
241
48
  end
49
+ end
242
50
  end
243
51
 
244
- # planar 4.1.2.2 (gridsys) - grid coordinate system
245
- # <- hProjection.projectionName = oneOf ...
246
- gridSystem = hProjection[:gridSystem]
247
- case gridSystem
248
- when 'utm'
249
- @xml.tag!('gridsys') do
250
- if hProjection[:gridSystemName].nil?
251
- classProjection.write_gridName('Universal Transverse Mercator (UTM)')
252
- else
253
- classProjection.write_gridName(hProjection[:gridSystemName])
254
- end
255
- @xml.tag!('utm') do
256
- classProjection.write_utmZone(hProjection)
257
- @xml.tag!('transmer') do
258
- classProjection.write_scaleFactorCM(hProjection)
259
- classProjection.write_longCM(hProjection)
260
- classProjection.write_latPO(hProjection)
261
- classProjection.write_falseNE(hProjection)
262
- end
263
- end
264
- end
265
- when 'ups'
266
- @xml.tag!('gridsys') do
267
- if hProjection[:gridSystemName].nil?
268
- classProjection.write_gridName('Universal Polar Stereographic (UPS)')
269
- else
270
- classProjection.write_gridName(hProjection[:gridSystemName])
271
- end
272
- @xml.tag!('ups') do
273
- classProjection.write_upsZone(hProjection)
274
- @xml.tag!('polarst') do
275
- classProjection.write_straightFromPole(hProjection)
276
- if hProjection[:standardParallel1] || hProjection[:standardParallel2]
277
- classProjection.write_standParallel(hProjection)
278
- elsif hProjection[:scaleFactorAtProjectionOrigin]
279
- classProjection.write_scaleFactorPO(hProjection)
280
- end
281
- classProjection.write_falseNE(hProjection)
282
- end
283
- end
284
- end
285
- when 'spcs'
286
- @xml.tag!('gridsys') do
287
- if hProjection[:gridSystemName].nil?
288
- classProjection.write_gridName('State Plane Coordinate System')
289
- else
290
- classProjection.write_gridName(hProjection[:gridSystemName])
291
- end
292
- @xml.tag!('spcs') do
293
- classProjection.write_spcsZone(hProjection)
294
- if hProjection[:standardParallel1] || hProjection[:standardParallel2]
295
- @xml.tag!('lambertc') do
296
- classProjection.write_standParallel(hProjection)
297
- classProjection.write_longCM(hProjection)
298
- classProjection.write_latPO(hProjection)
299
- classProjection.write_falseNE(hProjection)
300
- end
301
- elsif hProjection[:scaleFactorAtCenterLine]
302
- @xml.tag!('obqmerc') do
303
- classProjection.write_scaleFactorCL(hProjection)
304
- if hProjection[:obliqueLinePoints].empty?
305
- classProjection.write_obliqueLineAzimuth(hProjection)
306
- else
307
- @xml.tag!('obqlpt') do
308
- hProjection[:obliqueLinePoints].each do |hLinePt|
309
- classProjection.write_obliqueLinePoint(hLinePt)
310
- end
311
- end
312
- end
313
- classProjection.write_latPO(hProjection)
314
- classProjection.write_falseNE(hProjection)
315
- end
316
- elsif hProjection[:scaleFactorAtCentralMeridian]
317
- @xml.tag!('transmer') do
318
- classProjection.write_scaleFactorCM(hProjection)
319
- classProjection.write_longCM(hProjection)
320
- classProjection.write_latPO(hProjection)
321
- classProjection.write_falseNE(hProjection)
322
- end
323
- else
324
- @xml.tag!('polycon') do
325
- classProjection.write_longCM(hProjection)
326
- classProjection.write_latPO(hProjection)
327
- classProjection.write_falseNE(hProjection)
328
- end
52
+ # planar 4.1.2.2 (gridsys) - grid projection
53
+ aSpaceRefs.each do |hSpaceRef|
54
+ unless hSpaceRef[:systemParameterSet].empty?
55
+ if hSpaceRef[:systemParameterSet][:projection]
56
+ hProjection = hSpaceRef[:systemParameterSet][:projection]
57
+ unless hProjection.empty?
58
+ unless hProjection[:gridSystem].nil?
59
+ classGrid.writeXML(hProjection)
329
60
  end
330
61
  end
331
62
  end
332
- when 'arcsys'
333
- @xml.tag!('gridsys') do
334
- if hProjection[:gridSystemName].nil?
335
- classProjection.write_gridName('Equal Arc-second Coordinate System')
336
- else
337
- classProjection.write_gridName(hProjection[:gridSystemName])
338
- end
339
- @xml.tag!('arcsys') do
340
- classProjection.write_arcZone(hProjection)
341
- if hProjection[:standardParallel1] || hProjection[:standardParallel2]
342
- @xml.tag!('equirect') do
343
- classProjection.write_standParallel(hProjection)
344
- classProjection.write_longCM(hProjection)
345
- classProjection.write_falseNE(hProjection)
346
- end
347
- elsif hProjection[:latitudeOfProjectionOrigin]
348
- @xml.tag!('azimequi') do
349
- classProjection.write_longCM(hProjection)
350
- classProjection.write_latPO(hProjection)
351
- classProjection.write_falseNE(hProjection)
63
+ end
64
+ end
65
+
66
+ # planar 4.1.2.3 (localp) - local planar projection
67
+ aSpaceRefs.each do |hSpaceRef|
68
+ unless hSpaceRef[:systemParameterSet].empty?
69
+ if hSpaceRef[:systemParameterSet][:projection]
70
+ hProjection = hSpaceRef[:systemParameterSet][:projection]
71
+ unless hProjection.empty?
72
+ unless hProjection[:projection].nil?
73
+ if hProjection[:projection] == 'localPlanar'
74
+ classLocal.writeXML(hProjection)
352
75
  end
353
76
  end
354
77
  end
355
78
  end
356
- end
357
-
358
- # planar 4.1.2.3 (localp) - local planar
359
- if projection == 'localPlanar'
360
- @xml.tag!('localp') do
361
- classProjection.write_localDesc(hProjection)
362
- classProjection.write_localGeoInfo(hProjection)
363
79
  end
364
80
  end
365
81
 
82
+ # planar 4.1.2.4 (planci) - local planar projection
83
+ classInfo.writeXML(aRepTypes, aResolutions)
84
+
366
85
  end # writeXML
367
86
  end # PlanarReference
368
87
 
@@ -2,6 +2,7 @@
2
2
  # FGDC CSDGM writer output in XML
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-03-19 refactored error and warning messaging
5
6
  # Stan Smith 2017-12-18 original script
6
7
 
7
8
  require 'adiwg/mdtranslator/internal/module_dateTimeFun'
@@ -18,6 +19,7 @@ module ADIWG
18
19
  def initialize(xml, hResponseObj)
19
20
  @xml = xml
20
21
  @hResponseObj = hResponseObj
22
+ @NameSpace = ADIWG::Mdtranslator::Writers::Fgdc
21
23
  end
22
24
 
23
25
  def writeXML(hStep)
@@ -31,8 +33,7 @@ module ADIWG
31
33
  @xml.tag!('procdesc', hStep[:description] )
32
34
  end
33
35
  if hStep[:description].nil?
34
- @hResponseObj[:writerPass] = false
35
- @hResponseObj[:writerMessages] << 'Lineage Source is missing description'
36
+ @NameSpace.issueWarning(240, 'procdesc')
36
37
  end
37
38
 
38
39
  # process 2.5.2.2 (srcused) - source used citation abbreviation []
@@ -73,8 +74,7 @@ module ADIWG
73
74
  end
74
75
  end
75
76
  unless haveProcDate
76
- @hResponseObj[:writerPass] = false
77
- @hResponseObj[:writerMessages] << 'Process Step is missing process date'
77
+ @NameSpace.issueWarning(241, 'procdate')
78
78
  end
79
79
  if !haveProcTime && @hResponseObj[:writerShowTags]
80
80
  @xml.tag!('proctime')
@@ -96,9 +96,9 @@ module ADIWG
96
96
  # process 2.5.2.6 (proccont) - process contact {contact} first
97
97
  haveProcessor = false
98
98
  aRParties = hStep[:processors]
99
- aProcessors = ADIWG::Mdtranslator::Writers::Fgdc.find_responsibility(aRParties, 'processor')
99
+ aProcessors = @NameSpace.find_responsibility(aRParties, 'processor')
100
100
  aProcessors.each do |contactId|
101
- hContact = ADIWG::Mdtranslator::Writers::Fgdc.get_contact(contactId)
101
+ hContact = @NameSpace.get_contact(contactId)
102
102
  unless hContact.empty?
103
103
  @xml.tag!('proccont') do
104
104
  contactClass.writeXML(hContact)
@@ -2,8 +2,11 @@
2
2
  # FGDC CSDGM writer output in XML
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-03-23 refactored error and warning messaging
5
6
  # Stan Smith 2017-11-21 original script
6
7
 
8
+ require_relative '../fgdc_writer'
9
+
7
10
  module ADIWG
8
11
  module Mdtranslator
9
12
  module Writers
@@ -14,6 +17,7 @@ module ADIWG
14
17
  def initialize(xml, hResponseObj)
15
18
  @xml = xml
16
19
  @hResponseObj = hResponseObj
20
+ @NameSpace = ADIWG::Mdtranslator::Writers::Fgdc
17
21
  end
18
22
 
19
23
  def writeXML(hContact)
@@ -43,8 +47,7 @@ module ADIWG
43
47
  end
44
48
  end
45
49
  if place == ''
46
- @hResponseObj[:writerPass] = false
47
- @hResponseObj[:writerMessages] << 'Publisher is missing place of publication'
50
+ @NameSpace.issueWarning(330, 'pubplace', 'identification information citation')
48
51
  end
49
52
 
50
53
  # publication 8.8.2 (publish) - publisher name
@@ -54,8 +57,7 @@ module ADIWG
54
57
  @xml.tag!('publish', name)
55
58
  end
56
59
  if name.nil?
57
- @hResponseObj[:writerPass] = false
58
- @hResponseObj[:writerMessages] << 'Publisher is missing name of publisher'
60
+ @NameSpace.issueWarning(331, 'publish', 'identification information citation')
59
61
  end
60
62
 
61
63
  end # writeXML
@@ -2,6 +2,7 @@
2
2
  # FGDC CSDGM writer output in XML
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-03-23 refactored error and warning messaging
5
6
  # Stan Smith 2017-12-15 original script
6
7
 
7
8
  require_relative 'class_lineage'
@@ -16,6 +17,7 @@ module ADIWG
16
17
  def initialize(xml, hResponseObj)
17
18
  @xml = xml
18
19
  @hResponseObj = hResponseObj
20
+ @NameSpace = ADIWG::Mdtranslator::Writers::Fgdc
19
21
  end
20
22
 
21
23
  def writeXML(intObj)
@@ -46,8 +48,7 @@ module ADIWG
46
48
  end
47
49
  end
48
50
  if intObj[:metadata][:lineageInfo].empty?
49
- @hResponseObj[:writerPass] = false
50
- @hResponseObj[:writerMessages] << 'Data Quality is missing lineage section'
51
+ @NameSpace.issueWarning(350, nil, 'data quality section')
51
52
  end
52
53
 
53
54
  # data quality 2.6 (cloud) - cloud cover (not implemented)
@@ -2,6 +2,7 @@
2
2
  # FGDC CSDGM writer output in XML
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-03-23 refactored error and warning messaging
5
6
  # Stan Smith 2017-12-12 original script
6
7
 
7
8
  module ADIWG
@@ -14,6 +15,7 @@ module ADIWG
14
15
  def initialize(xml, hResponseObj)
15
16
  @xml = xml
16
17
  @hResponseObj = hResponseObj
18
+ @NameSpace = ADIWG::Mdtranslator::Writers::Fgdc
17
19
  end
18
20
 
19
21
  def writeXML(aConstraints)
@@ -31,8 +33,7 @@ module ADIWG
31
33
  @xml.tag!('secsys', hSecurity[:classSystem])
32
34
  end
33
35
  if hSecurity[:classSystem].nil?
34
- @hResponseObj[:writerPass] = false
35
- @hResponseObj[:writerMessages] << 'Security is missing classification system'
36
+ @NameSpace.issueWarning(340, 'secsys', 'identification information section')
36
37
  end
37
38
 
38
39
  # security 1.12.2 (secclass) - security classification (required)
@@ -40,8 +41,7 @@ module ADIWG
40
41
  @xml.tag!('secclass', hSecurity[:classCode])
41
42
  end
42
43
  if hSecurity[:classCode].nil?
43
- @hResponseObj[:writerPass] = false
44
- @hResponseObj[:writerMessages] << 'Security is missing classification'
44
+ @NameSpace.issueWarning(341, 'secclass', 'identification information section')
45
45
  end
46
46
 
47
47
  # security 1.12.3 (sechandl) - security classification (required)
@@ -49,8 +49,7 @@ module ADIWG
49
49
  @xml.tag!('sechandl', hSecurity[:handling])
50
50
  end
51
51
  if hSecurity[:handling].nil?
52
- @hResponseObj[:writerPass] = false
53
- @hResponseObj[:writerMessages] << 'Security is missing handling instructions'
52
+ @NameSpace.issueWarning(342, 'sechandl', 'identification information section')
54
53
  end
55
54
 
56
55
  end
@@ -2,6 +2,7 @@
2
2
  # FGDC CSDGM writer output in XML
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-03-23 refactored error and warning messaging
5
6
  # Stan Smith 2017-11-21 original script
6
7
 
7
8
  module ADIWG
@@ -14,6 +15,7 @@ module ADIWG
14
15
  def initialize(xml, hResponseObj)
15
16
  @xml = xml
16
17
  @hResponseObj = hResponseObj
18
+ @NameSpace = ADIWG::Mdtranslator::Writers::Fgdc
17
19
  end
18
20
 
19
21
  def writeXML(hSeries)
@@ -24,8 +26,7 @@ module ADIWG
24
26
  @xml.tag!('sername', hSeries[:seriesName])
25
27
  end
26
28
  if hSeries[:seriesName].nil?
27
- @hResponseObj[:writerPass] = false
28
- @hResponseObj[:writerMessages] << 'Series is missing name'
29
+ @NameSpace.issueWarning(360, 'sername')
29
30
  end
30
31
 
31
32
  # series 8.7.2 (issue) - series issue
@@ -34,8 +35,7 @@ module ADIWG
34
35
  @xml.tag!('issue', hSeries[:seriesIssue])
35
36
  end
36
37
  if hSeries[:seriesIssue].nil?
37
- @hResponseObj[:writerPass] = false
38
- @hResponseObj[:writerMessages] << 'Series is missing issue'
38
+ @NameSpace.issueWarning(361, 'issue')
39
39
  end
40
40
 
41
41
  end # writeXML