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
@@ -0,0 +1,294 @@
1
+ # FGDC <<Class>> PlanarReference
2
+ # FGDC CSDGM writer output in XML
3
+
4
+ # History:
5
+ # Stan Smith 2018-03-21 original script
6
+
7
+ require_relative 'class_mapProjectionTags'
8
+
9
+ module ADIWG
10
+ module Mdtranslator
11
+ module Writers
12
+ module Fgdc
13
+
14
+ class PlanarMap
15
+
16
+ def initialize(xml, hResponseObj)
17
+ @xml = xml
18
+ @hResponseObj = hResponseObj
19
+ end
20
+
21
+ def writeXML(hProjection)
22
+
23
+ # classes used
24
+ classTags = MapProjectionTags.new(@xml, @hResponseObj)
25
+
26
+ # 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
+ projectionName = 'Modified Stereographic for Alaska'
33
+ hProjection[:projectionName] = projectionName if hProjection[:projectionName].nil?
34
+ classTags.write_name(projectionName)
35
+ @xml.tag!('modsak') do
36
+ classTags.write_falseNE(hProjection)
37
+ end
38
+ end
39
+ when 'albers'
40
+ @xml.tag!('mapproj') do
41
+ projectionName = 'Albers Conical Equal Area'
42
+ hProjection[:projectionName] = projectionName if hProjection[:projectionName].nil?
43
+ classTags.write_name(projectionName)
44
+ @xml.tag!('albers') do
45
+ classTags.write_standParallel(hProjection)
46
+ classTags.write_longCM(hProjection)
47
+ classTags.write_latPO(hProjection)
48
+ classTags.write_falseNE(hProjection)
49
+ end
50
+ end
51
+ when 'azimuthalEquidistant'
52
+ @xml.tag!('mapproj') do
53
+ projectionName = 'Azimuthal Equidistant'
54
+ hProjection[:projectionName] = projectionName if hProjection[:projectionName].nil?
55
+ classTags.write_name(projectionName)
56
+ @xml.tag!('azimequi') do
57
+ classTags.write_longCM(hProjection)
58
+ classTags.write_latPO(hProjection)
59
+ classTags.write_falseNE(hProjection)
60
+ end
61
+ end
62
+ when 'equidistantConic'
63
+ @xml.tag!('mapproj') do
64
+ projectionName = 'Equidistant Conic'
65
+ hProjection[:projectionName] = projectionName if hProjection[:projectionName].nil?
66
+ classTags.write_name(projectionName)
67
+ @xml.tag!('equicon') do
68
+ classTags.write_standParallel(hProjection)
69
+ classTags.write_longCM(hProjection)
70
+ classTags.write_latPO(hProjection)
71
+ classTags.write_falseNE(hProjection)
72
+ end
73
+ end
74
+ when 'equirectangular'
75
+ @xml.tag!('mapproj') do
76
+ projectionName = 'Equirectangular'
77
+ hProjection[:projectionName] = projectionName if hProjection[:projectionName].nil?
78
+ classTags.write_name(projectionName)
79
+ @xml.tag!('equirect') do
80
+ classTags.write_standParallel(hProjection)
81
+ classTags.write_longCM(hProjection)
82
+ classTags.write_falseNE(hProjection)
83
+ end
84
+ end
85
+ when 'generalVertical'
86
+ @xml.tag!('mapproj') do
87
+ projectionName = 'General Vertical Near-sided Perspective'
88
+ hProjection[:projectionName] = projectionName if hProjection[:projectionName].nil?
89
+ classTags.write_name(projectionName)
90
+ @xml.tag!('gvnsp') do
91
+ classTags.write_heightPP(hProjection)
92
+ classTags.write_longPC(hProjection)
93
+ classTags.write_latPC(hProjection)
94
+ classTags.write_falseNE(hProjection)
95
+ end
96
+ end
97
+ when 'gnomonic'
98
+ @xml.tag!('mapproj') do
99
+ projectionName = 'Gnomonic'
100
+ hProjection[:projectionName] = projectionName if hProjection[:projectionName].nil?
101
+ classTags.write_name(projectionName)
102
+ @xml.tag!('gnomonic') do
103
+ classTags.write_longPC(hProjection)
104
+ classTags.write_latPC(hProjection)
105
+ classTags.write_falseNE(hProjection)
106
+ end
107
+ end
108
+ when 'lambertEqualArea'
109
+ @xml.tag!('mapproj') do
110
+ projectionName = 'Lambert Azimuthal Equal Area'
111
+ hProjection[:projectionName] = projectionName if hProjection[:projectionName].nil?
112
+ classTags.write_name(projectionName)
113
+ @xml.tag!('lamberta') do
114
+ classTags.write_longPC(hProjection)
115
+ classTags.write_latPC(hProjection)
116
+ classTags.write_falseNE(hProjection)
117
+ end
118
+ end
119
+ when 'lambertConic'
120
+ @xml.tag!('mapproj') do
121
+ projectionName = 'Lambert Conformal Conic'
122
+ hProjection[:projectionName] = projectionName if hProjection[:projectionName].nil?
123
+ classTags.write_name(projectionName)
124
+ @xml.tag!('lambertc') do
125
+ classTags.write_standParallel(hProjection)
126
+ classTags.write_longCM(hProjection)
127
+ classTags.write_latPO(hProjection)
128
+ classTags.write_falseNE(hProjection)
129
+ end
130
+ end
131
+ when 'mercator'
132
+ @xml.tag!('mapproj') do
133
+ projectionName = 'Mercator'
134
+ hProjection[:projectionName] = projectionName if hProjection[:projectionName].nil?
135
+ classTags.write_name(projectionName)
136
+ @xml.tag!('mercator') do
137
+ if hProjection[:standardParallel1] || hProjection[:standardParallel2]
138
+ classTags.write_standParallel(hProjection)
139
+ elsif hProjection[:scaleFactorAtEquator]
140
+ classTags.write_scaleFactorE(hProjection)
141
+ end
142
+ classTags.write_longCM(hProjection)
143
+ classTags.write_falseNE(hProjection)
144
+ end
145
+ end
146
+ when 'miller'
147
+ @xml.tag!('mapproj') do
148
+ projectionName = 'Miller Cylindrical'
149
+ hProjection[:projectionName] = projectionName if hProjection[:projectionName].nil?
150
+ classTags.write_name(projectionName)
151
+ @xml.tag!('miller') do
152
+ classTags.write_longCM(hProjection)
153
+ classTags.write_falseNE(hProjection)
154
+ end
155
+ end
156
+ when 'obliqueMercator'
157
+ @xml.tag!('mapproj') do
158
+ projectionName = 'Oblique Mercator'
159
+ hProjection[:projectionName] = projectionName if hProjection[:projectionName].nil?
160
+ classTags.write_name(projectionName)
161
+ @xml.tag!('obqmerc') do
162
+ classTags.write_scaleFactorCL(hProjection)
163
+ if hProjection[:obliqueLinePoints].empty?
164
+ classTags.write_obliqueLineAzimuth(hProjection)
165
+ else
166
+ @xml.tag!('obqlpt') do
167
+ hProjection[:obliqueLinePoints].each do |hLinePt|
168
+ classTags.write_obliqueLinePoint(hLinePt)
169
+ end
170
+ end
171
+ end
172
+ classTags.write_latPO(hProjection)
173
+ classTags.write_falseNE(hProjection)
174
+ end
175
+ end
176
+ when 'orthographic'
177
+ @xml.tag!('mapproj') do
178
+ projectionName = 'Orthographic'
179
+ hProjection[:projectionName] = projectionName if hProjection[:projectionName].nil?
180
+ classTags.write_name(projectionName)
181
+ @xml.tag!('orthogr') do
182
+ classTags.write_longPC(hProjection)
183
+ classTags.write_latPC(hProjection)
184
+ classTags.write_falseNE(hProjection)
185
+ end
186
+ end
187
+ when 'polarStereo'
188
+ @xml.tag!('mapproj') do
189
+ projectionName = 'Polar Stereographic'
190
+ hProjection[:projectionName] = projectionName if hProjection[:projectionName].nil?
191
+ classTags.write_name(projectionName)
192
+ @xml.tag!('polarst') do
193
+ classTags.write_straightFromPole(hProjection)
194
+ if hProjection[:standardParallel1] || hProjection[:standardParallel2]
195
+ classTags.write_standParallel(hProjection)
196
+ elsif hProjection[:scaleFactorAtProjectionOrigin]
197
+ classTags.write_scaleFactorPO(hProjection)
198
+ end
199
+ classTags.write_falseNE(hProjection)
200
+ end
201
+ end
202
+ when 'polyconic'
203
+ @xml.tag!('mapproj') do
204
+ projectionName = 'Polyconic'
205
+ hProjection[:projectionName] = projectionName if hProjection[:projectionName].nil?
206
+ classTags.write_name(projectionName)
207
+ @xml.tag!('polycon') do
208
+ classTags.write_longCM(hProjection)
209
+ classTags.write_latPO(hProjection)
210
+ classTags.write_falseNE(hProjection)
211
+ end
212
+ end
213
+ when 'robinson'
214
+ @xml.tag!('mapproj') do
215
+ projectionName = 'Robinson'
216
+ hProjection[:projectionName] = projectionName if hProjection[:projectionName].nil?
217
+ classTags.write_name(projectionName)
218
+ @xml.tag!('robinson') do
219
+ classTags.write_longPC(hProjection)
220
+ classTags.write_falseNE(hProjection)
221
+ end
222
+ end
223
+ when 'sinusoidal'
224
+ @xml.tag!('mapproj') do
225
+ projectionName = 'Sinusoidal'
226
+ hProjection[:projectionName] = projectionName if hProjection[:projectionName].nil?
227
+ classTags.write_name(projectionName)
228
+ @xml.tag!('sinusoid') do
229
+ classTags.write_longCM(hProjection)
230
+ classTags.write_falseNE(hProjection)
231
+ end
232
+ end
233
+ when 'spaceOblique'
234
+ @xml.tag!('mapproj') do
235
+ projectionName = 'Space Oblique Mercator'
236
+ hProjection[:projectionName] = projectionName if hProjection[:projectionName].nil?
237
+ classTags.write_name(projectionName)
238
+ @xml.tag!('spaceobq') do
239
+ classTags.write_landsat(hProjection)
240
+ classTags.write_landsatPath(hProjection)
241
+ classTags.write_falseNE(hProjection)
242
+ end
243
+ end
244
+ when 'stereographic'
245
+ @xml.tag!('mapproj') do
246
+ projectionName = 'Stereographic'
247
+ hProjection[:projectionName] = projectionName if hProjection[:projectionName].nil?
248
+ classTags.write_name(projectionName)
249
+ @xml.tag!('stereo') do
250
+ classTags.write_longPC(hProjection)
251
+ classTags.write_latPC(hProjection)
252
+ classTags.write_falseNE(hProjection)
253
+ end
254
+ end
255
+ when 'transverseMercator'
256
+ @xml.tag!('mapproj') do
257
+ projectionName = 'Transverse Mercator'
258
+ hProjection[:projectionName] = projectionName if hProjection[:projectionName].nil?
259
+ classTags.write_name(projectionName)
260
+ @xml.tag!('transmer') do
261
+ classTags.write_scaleFactorCM(hProjection)
262
+ classTags.write_longCM(hProjection)
263
+ classTags.write_latPO(hProjection)
264
+ classTags.write_falseNE(hProjection)
265
+ end
266
+ end
267
+ when 'grinten'
268
+ @xml.tag!('mapproj') do
269
+ projectionName = 'Van der Grinten'
270
+ hProjection[:projectionName] = projectionName if hProjection[:projectionName].nil?
271
+ classTags.write_name(projectionName)
272
+ @xml.tag!('vdgrin') do
273
+ classTags.write_longCM(hProjection)
274
+ classTags.write_falseNE(hProjection)
275
+ end
276
+ end
277
+ when 'parameters'
278
+ @xml.tag!('mapproj') do
279
+ projectionName = 'Map Projection Parameters'
280
+ hProjection[:projectionName] = projectionName if hProjection[:projectionName].nil?
281
+ classTags.write_name(projectionName)
282
+ @xml.tag!('mapprojp') do
283
+ classTags.write_allParams(hProjection)
284
+ end
285
+ end
286
+ end
287
+
288
+ end # writeXML
289
+ end # PlanarMap
290
+
291
+ end
292
+ end
293
+ end
294
+ end