adiwg-mdtranslator 2.13.3 → 2.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +3 -3
  3. data/CHANGELOG.md +11 -4
  4. data/Rakefile +14 -14
  5. data/adiwg-mdtranslator.gemspec +3 -3
  6. data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +14 -14
  7. data/lib/adiwg/mdtranslator/readers/fgdc/modules/gridSystems/grid_equalArcSecond.rb +69 -0
  8. data/lib/adiwg/mdtranslator/readers/fgdc/modules/gridSystems/grid_other.rb +42 -0
  9. data/lib/adiwg/mdtranslator/readers/fgdc/modules/gridSystems/grid_statePlane.rb +87 -0
  10. data/lib/adiwg/mdtranslator/readers/fgdc/modules/gridSystems/grid_ups.rb +58 -0
  11. data/lib/adiwg/mdtranslator/readers/fgdc/modules/gridSystems/grid_utm.rb +58 -0
  12. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_albers.rb +7 -7
  13. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_azimuthEquidistant.rb +6 -6
  14. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_common.rb +23 -22
  15. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_equidistantConic.rb +7 -7
  16. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_equirectangular.rb +6 -6
  17. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_generalVertical.rb +7 -7
  18. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_gnomonic.rb +6 -6
  19. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_lambertConic.rb +7 -7
  20. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_lambertEqualArea.rb +6 -6
  21. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_mercator.rb +7 -7
  22. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_millerCylinder.rb +5 -5
  23. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_modifiedAlaska.rb +4 -4
  24. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_obliqueMercator.rb +8 -8
  25. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_orthographic.rb +6 -6
  26. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_parameters.rb +20 -20
  27. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_polarStereo.rb +8 -8
  28. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_polyconic.rb +6 -6
  29. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_robinson.rb +5 -5
  30. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_sinusoidal.rb +5 -5
  31. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_spaceOblique.rb +6 -6
  32. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_stereographic.rb +6 -6
  33. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_transverseMercator.rb +7 -7
  34. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_vanDerGrinten.rb +5 -5
  35. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_geodeticReference.rb +15 -7
  36. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_geographicResolution.rb +6 -3
  37. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_horizontalPlanar.rb +8 -6
  38. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_horizontalReference.rb +1 -1
  39. data/lib/adiwg/mdtranslator/readers/fgdc/modules/{module_mapLocalPlanar.rb → module_localPlanar.rb} +16 -8
  40. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_localSystem.rb +23 -8
  41. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapGridSystem.rb +21 -144
  42. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapProjection.rb +48 -3
  43. data/lib/adiwg/mdtranslator/readers/fgdc/modules/{module_mapCoordinateInfo.rb → module_planarCoordinateInfo.rb} +23 -11
  44. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonomy.rb +1 -1
  45. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_verticalAltitude.rb +5 -2
  46. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_verticalDepth.rb +6 -2
  47. data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_reader_messages_eng.yml +20 -5
  48. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geodetic.rb +41 -8
  49. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_localProjection.rb +57 -0
  50. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_obliqueLinePoint.rb +6 -6
  51. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_projectionParameters.rb +36 -53
  52. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_referenceSystemParameters.rb +1 -1
  53. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomy.rb +39 -13
  54. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_verticalDatum.rb +20 -8
  55. data/lib/adiwg/mdtranslator/version.rb +11 -1
  56. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geodeticReference.rb +8 -7
  57. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geographicResolution.rb +1 -1
  58. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_localPlanar.rb +63 -0
  59. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_localSystem.rb +30 -15
  60. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_mapProjectionTags.rb +164 -109
  61. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarGrid.rb +60 -61
  62. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarInfo.rb +12 -12
  63. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarMap.rb +87 -99
  64. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarReference.rb +16 -41
  65. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialReference.rb +12 -11
  66. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomy.rb +9 -4
  67. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomySystem.rb +2 -3
  68. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_verticalDatum.rb +8 -7
  69. data/lib/adiwg/mdtranslator/writers/fgdc/fgdc_writer_messages_eng.yml +13 -6
  70. data/lib/adiwg/mdtranslator/writers/html/sections/html_geodeticParameters.rb +16 -30
  71. data/lib/adiwg/mdtranslator/writers/html/sections/html_identifier.rb +8 -0
  72. data/lib/adiwg/mdtranslator/writers/html/sections/html_obliqueLinePoint.rb +4 -4
  73. data/lib/adiwg/mdtranslator/writers/html/sections/html_projectionParameters.rb +68 -57
  74. data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceInfo.rb +11 -6
  75. data/lib/adiwg/mdtranslator/writers/html/sections/html_spatialReference.rb +9 -0
  76. data/lib/adiwg/mdtranslator/writers/html/sections/html_taxonomy.rb +13 -12
  77. data/lib/adiwg/mdtranslator/writers/html/sections/html_usage.rb +3 -3
  78. data/lib/adiwg/mdtranslator/writers/html/sections/html_verticalDatumParameters.rb +9 -15
  79. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_crs.rb +12 -15
  80. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataIdentification.rb +9 -8
  81. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_obliqueLinePoint.rb +6 -6
  82. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_referenceSystem.rb +2 -1
  83. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_taxonomy.rb +21 -10
  84. data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer_messages_eng.yml +4 -0
  85. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_geodeticParameters.rb +2 -3
  86. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_identifier.rb +4 -2
  87. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_localProjection.rb +31 -0
  88. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_obliqueLinePoint.rb +2 -2
  89. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_projectionParameters.rb +5 -9
  90. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_taxonomy.rb +6 -5
  91. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_verticalDatumParameters.rb +2 -2
  92. data/lib/adiwg/mdtranslator/writers/sbJson/sbJson_writer.rb +10 -0
  93. data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_contact.rb +21 -0
  94. metadata +17 -10
  95. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarLocal.rb +0 -42
@@ -18,7 +18,7 @@ module ADIWG
18
18
  @intMetadataClass = InternalMetadata.new
19
19
 
20
20
  # standard parallels
21
- def self.unpackStandParallel(xParams, hProjection, hResponseObj)
21
+ def self.unpackStandParallel(xParams, hProjection)
22
22
  paramCount = 0
23
23
  aStandP = xParams.xpath('./stdparll')
24
24
  unless aStandP.empty?
@@ -39,7 +39,7 @@ module ADIWG
39
39
  end
40
40
 
41
41
  # longitude of central meridian
42
- def self.unpackLongCM(xParams, hProjection, hResponseObj)
42
+ def self.unpackLongCM(xParams, hProjection)
43
43
  longCM = xParams.xpath('./longcm').text
44
44
  unless longCM.empty?
45
45
  hProjection[:longitudeOfCentralMeridian] = longCM.to_f
@@ -49,7 +49,7 @@ module ADIWG
49
49
  end
50
50
 
51
51
  # latitude of projection origin
52
- def self.unpackLatPO(xParams, hProjection, hResponseObj)
52
+ def self.unpackLatPO(xParams, hProjection)
53
53
  latPO = xParams.xpath('./latprjo').text
54
54
  unless latPO.empty?
55
55
  hProjection[:latitudeOfProjectionOrigin] = latPO.to_f
@@ -59,7 +59,7 @@ module ADIWG
59
59
  end
60
60
 
61
61
  # false northing and easting(xParams, hProjection, hResponseObj)
62
- def self.unpackFalseNE(xParams, hProjection, hResponseObj)
62
+ def self.unpackFalseNE(xParams, hProjection)
63
63
  paramCount = 0
64
64
  falseE = xParams.xpath('./feast').text
65
65
  unless falseE.empty?
@@ -75,7 +75,7 @@ module ADIWG
75
75
  end
76
76
 
77
77
  # height of perspective point above surface
78
- def self.unpackHeightAS(xParams, hProjection, hResponseObj)
78
+ def self.unpackHeightAS(xParams, hProjection)
79
79
  heightAS = xParams.xpath('./heightpt').text
80
80
  unless heightAS.empty?
81
81
  hProjection[:heightOfProspectivePointAboveSurface] = heightAS.to_f
@@ -85,7 +85,7 @@ module ADIWG
85
85
  end
86
86
 
87
87
  # longitude of projection center
88
- def self.unpackLongPC(xParams, hProjection, hResponseObj)
88
+ def self.unpackLongPC(xParams, hProjection)
89
89
  longPC = xParams.xpath('./longpc').text
90
90
  unless longPC.empty?
91
91
  hProjection[:longitudeOfProjectionCenter] = longPC.to_f
@@ -95,7 +95,7 @@ module ADIWG
95
95
  end
96
96
 
97
97
  # latitude of projection center
98
- def self.unpackLatPC(xParams, hProjection, hResponseObj)
98
+ def self.unpackLatPC(xParams, hProjection)
99
99
  latPC = xParams.xpath('./latprjc').text
100
100
  unless latPC.empty?
101
101
  hProjection[:latitudeOfProjectionCenter] = latPC.to_f
@@ -105,7 +105,7 @@ module ADIWG
105
105
  end
106
106
 
107
107
  # scale factor at equator
108
- def self.unpackSFEquator(xParams, hProjection, hResponseObj)
108
+ def self.unpackSFEquator(xParams, hProjection)
109
109
  sFEquator = xParams.xpath('./sfequat').text
110
110
  unless sFEquator.empty?
111
111
  hProjection[:scaleFactorAtEquator] = sFEquator.to_f
@@ -115,7 +115,7 @@ module ADIWG
115
115
  end
116
116
 
117
117
  # scale factor at center line
118
- def self.unpackSFCenter(xParams, hProjection, hResponseObj)
118
+ def self.unpackSFCenter(xParams, hProjection)
119
119
  sFCenter = xParams.xpath('./sfctrlin').text
120
120
  unless sFCenter.empty?
121
121
  hProjection[:scaleFactorAtCenterLine] = sFCenter.to_f
@@ -125,7 +125,7 @@ module ADIWG
125
125
  end
126
126
 
127
127
  # scale factor at central meridian
128
- def self.unpackSFCM(xParams, hProjection, hResponseObj)
128
+ def self.unpackSFCM(xParams, hProjection)
129
129
  sFCM = xParams.xpath('./sfctrmer').text
130
130
  unless sFCM.empty?
131
131
  hProjection[:scaleFactorAtCentralMeridian] = sFCM.to_f
@@ -135,7 +135,7 @@ module ADIWG
135
135
  end
136
136
 
137
137
  # scale factor at projection origin
138
- def self.unpackSFPO(xParams, hProjection, hResponseObj)
138
+ def self.unpackSFPO(xParams, hProjection)
139
139
  sFProjectO = xParams.xpath('./sfprjorg').text
140
140
  unless sFProjectO.empty?
141
141
  hProjection[:scaleFactorAtProjectionOrigin] = sFProjectO.to_f
@@ -145,7 +145,7 @@ module ADIWG
145
145
  end
146
146
 
147
147
  # oblique line azimuth
148
- def self.unpackObliqueLA(xParams, hProjection, hResponseObj)
148
+ def self.unpackObliqueLA(xParams, hProjection)
149
149
  xObliqueLA = xParams.xpath('./obqlazim')
150
150
  unless xObliqueLA.empty?
151
151
  paramCount = 0
@@ -165,7 +165,7 @@ module ADIWG
165
165
  end
166
166
 
167
167
  # oblique line point
168
- def self.unpackObliqueLP(xParams, hProjection, hResponseObj)
168
+ def self.unpackObliqueLP(xParams, hProjection)
169
169
  xObliqueLP = xParams.xpath('./obqlpt')
170
170
  unless xObliqueLP.empty?
171
171
  paramCount = 0
@@ -174,23 +174,23 @@ module ADIWG
174
174
 
175
175
  lat1 = xObliqueLP.xpath('./obqllat[1]').text
176
176
  unless lat1.empty?
177
- hPoint1[:azimuthLineLatitude] = lat1.to_f
177
+ hPoint1[:obliqueLineLatitude] = lat1.to_f
178
178
  paramCount += 1
179
179
  end
180
180
  long1 = xObliqueLP.xpath('./obqllong[1]').text
181
181
  unless long1.empty?
182
- hPoint1[:azimuthLineLongitude] = long1.to_f
182
+ hPoint1[:obliqueLineLongitude] = long1.to_f
183
183
  paramCount += 1
184
184
  end
185
185
 
186
186
  lat2 = xObliqueLP.xpath('./obqllat[2]').text
187
187
  unless lat2.empty?
188
- hPoint2[:azimuthLineLatitude] = lat2.to_f
188
+ hPoint2[:obliqueLineLatitude] = lat2.to_f
189
189
  paramCount += 1
190
190
  end
191
191
  long2 = xObliqueLP.xpath('./obqllong[2]').text
192
192
  unless long2.empty?
193
- hPoint2[:azimuthLineLongitude] = long2.to_f
193
+ hPoint2[:obliqueLineLongitude] = long2.to_f
194
194
  paramCount += 1
195
195
  end
196
196
 
@@ -205,7 +205,7 @@ module ADIWG
205
205
  end
206
206
 
207
207
  # straight vertical longitude from pole
208
- def self.unpackVSLong(xParams, hProjection, hResponseObj)
208
+ def self.unpackVSLong(xParams, hProjection)
209
209
  sVLongP = xParams.xpath('./svlong').text
210
210
  unless sVLongP.empty?
211
211
  hProjection[:straightVerticalLongitudeFromPole] = sVLongP.to_f
@@ -215,7 +215,7 @@ module ADIWG
215
215
  end
216
216
 
217
217
  # landsat number
218
- def self.unpackLandSat(xParams, hProjection, hResponseObj)
218
+ def self.unpackLandSat(xParams, hProjection)
219
219
  landsatN = xParams.xpath('./landsat').text
220
220
  unless landsatN.empty?
221
221
  hProjection[:landsatNumber] = landsatN.to_i
@@ -225,7 +225,7 @@ module ADIWG
225
225
  end
226
226
 
227
227
  # landsat path number
228
- def self.unpackLandSatPath(xParams, hProjection, hResponseObj)
228
+ def self.unpackLandSatPath(xParams, hProjection)
229
229
  landsatP = xParams.xpath('./pathnum').text
230
230
  unless landsatP.empty?
231
231
  hProjection[:landsatPath] = landsatP.to_i
@@ -235,10 +235,11 @@ module ADIWG
235
235
  end
236
236
 
237
237
  # other projection
238
- def self.unpackOtherProjection(xParams, hProjection, hResponseObj)
238
+ def self.unpackOtherProjection(xParams, hProjection)
239
239
  other = xParams.xpath('./otherprj').text
240
240
  unless other.empty?
241
- hProjection[:otherProjectionDescription] = other
241
+ hProjection[:projectionIdentifier][:identifier] = 'other'
242
+ hProjection[:projectionIdentifier][:description] = other
242
243
  return 1
243
244
  end
244
245
  return 0
@@ -2,6 +2,7 @@
2
2
  # unpack fgdc map projection - equidistant conic
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-10-03 refactor mdJson projection object
5
6
  # Stan Smith 2017-10-16 original script
6
7
 
7
8
  require 'nokogiri'
@@ -19,28 +20,27 @@ module ADIWG
19
20
  # map projection 4.1.2.1.4 (equicon) - Equidistant Conic
20
21
  unless xParams.empty?
21
22
  paramCount = 0
22
- hProjection[:projection] = 'equidistantConic'
23
- hProjection[:projectionName] = 'Equidistant Conic'
24
23
 
25
24
  # -> ReferenceSystemParameters.projection.standardParallel1
26
25
  # -> ReferenceSystemParameters.projection.standardParallel2
27
- paramCount += ProjectionCommon.unpackStandParallel(xParams, hProjection, hResponseObj)
26
+ paramCount += ProjectionCommon.unpackStandParallel(xParams, hProjection)
28
27
 
29
28
  # -> ReferenceSystemParameters.projection.longitudeOfCentralMeridian
30
- paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection, hResponseObj)
29
+ paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection)
31
30
 
32
31
  # -> ReferenceSystemParameters.projection.latitudeOfProjectionOrigin
33
- paramCount += ProjectionCommon.unpackLatPO(xParams, hProjection, hResponseObj)
32
+ paramCount += ProjectionCommon.unpackLatPO(xParams, hProjection)
34
33
 
35
34
  # -> ReferenceSystemParameters.projection.falseEasting
36
35
  # -> ReferenceSystemParameters.projection.falseNorthing
37
- paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection, hResponseObj)
36
+ paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection)
38
37
 
39
38
  # verify parameter count
40
39
  if paramCount == 6
41
40
  return hProjection
42
41
  else
43
- hResponseObj[:readerExecutionMessages] << 'WARNING: Equidistant Conic projection is missing one or more parameters'
42
+ hResponseObj[:readerExecutionMessages] <<
43
+ 'WARNING: Equidistant Conic projection is missing one or more parameters'
44
44
  end
45
45
  end
46
46
 
@@ -2,6 +2,7 @@
2
2
  # unpack fgdc map projection - equirectangular
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-10-03 refactor mdJson projection object
5
6
  # Stan Smith 2017-10-16 original script
6
7
 
7
8
  require 'nokogiri'
@@ -19,25 +20,24 @@ module ADIWG
19
20
  # map projection 4.1.2.1.5 (equirect) - Equirectangular
20
21
  unless xParams.empty?
21
22
  paramCount = 0
22
- hProjection[:projection] = 'equirectangular'
23
- hProjection[:projectionName] = 'Equirectangular'
24
23
 
25
24
  # -> ReferenceSystemParameters.projection.standardParallel1
26
- paramCount += ProjectionCommon.unpackStandParallel(xParams, hProjection, hResponseObj)
25
+ paramCount += ProjectionCommon.unpackStandParallel(xParams, hProjection)
27
26
 
28
27
  # -> ReferenceSystemParameters.projection.longitudeOfCentralMeridian
29
- paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection, hResponseObj)
28
+ paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection)
30
29
 
31
30
  # -> ReferenceSystemParameters.projection.falseEasting
32
31
  # -> ReferenceSystemParameters.projection.falseNorthing
33
- paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection, hResponseObj)
32
+ paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection)
34
33
 
35
34
  # add distance units
36
35
  # verify parameter count
37
36
  if paramCount == 4
38
37
  return hProjection
39
38
  else
40
- hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: Equirectangular projection is missing one or more parameters'
39
+ hResponseObj[:readerExecutionMessages] <<
40
+ 'WARNING: FGDC reader: Equirectangular projection is missing one or more parameters'
41
41
  end
42
42
  end
43
43
 
@@ -2,6 +2,7 @@
2
2
  # unpack fgdc map projection - general vertical near-side perspective projection
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-10-03 refactor mdJson projection object
5
6
  # Stan Smith 2017-10-16 original script
6
7
 
7
8
  require 'nokogiri'
@@ -20,28 +21,27 @@ module ADIWG
20
21
  # map projection 4.1.2.1.6 (gvnsp) - General Vertical Near-sided Perspective
21
22
  unless xParams.empty?
22
23
  paramCount = 0
23
- hProjection[:projection] = 'generalVertical'
24
- hProjection[:projectionName] = 'General Vertical Near-sided Perspective'
25
24
 
26
25
  # -> ReferenceSystemParameters.projection.heightOfProspectivePointAboveSurface
27
- paramCount += ProjectionCommon.unpackHeightAS(xParams, hProjection, hResponseObj)
26
+ paramCount += ProjectionCommon.unpackHeightAS(xParams, hProjection)
28
27
 
29
28
  # -> ReferenceSystemParameters.projection.longitudeOfProjectionCenter
30
- paramCount += ProjectionCommon.unpackLongPC(xParams, hProjection, hResponseObj)
29
+ paramCount += ProjectionCommon.unpackLongPC(xParams, hProjection)
31
30
 
32
31
  # -> ReferenceSystemParameters.projection.latitudeOfProjectionCenter
33
- paramCount += ProjectionCommon.unpackLatPC(xParams, hProjection, hResponseObj)
32
+ paramCount += ProjectionCommon.unpackLatPC(xParams, hProjection)
34
33
 
35
34
  # -> ReferenceSystemParameters.projection.falseEasting
36
35
  # -> ReferenceSystemParameters.projection.falseNorthing
37
- paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection, hResponseObj)
36
+ paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection)
38
37
 
39
38
  # add distance units
40
39
  # verify parameter count
41
40
  if paramCount == 5
42
41
  return hProjection
43
42
  else
44
- hResponseObj[:readerExecutionMessages] << 'WARNING: General Vertical Near-side perspective projection is missing one or more parameters'
43
+ hResponseObj[:readerExecutionMessages] <<
44
+ 'WARNING: General Vertical Near-side perspective projection is missing one or more parameters'
45
45
  end
46
46
  end
47
47
 
@@ -2,6 +2,7 @@
2
2
  # unpack fgdc map projection - gnomonic projection
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-10-03 refactor mdJson projection object
5
6
  # Stan Smith 2017-10-16 original script
6
7
 
7
8
  require 'nokogiri'
@@ -20,24 +21,23 @@ module ADIWG
20
21
  # map projection 4.1.2.1.7 (gnomonic) - Gnomonic
21
22
  unless xParams.empty?
22
23
  paramCount = 0
23
- hProjection[:projection] = 'gnomonic'
24
- hProjection[:projectionName] = 'Gnomonic'
25
24
 
26
25
  # -> ReferenceSystemParameters.projection.longitudeOfProjectionCenter
27
- paramCount += ProjectionCommon.unpackLongPC(xParams, hProjection, hResponseObj)
26
+ paramCount += ProjectionCommon.unpackLongPC(xParams, hProjection)
28
27
 
29
28
  # -> ReferenceSystemParameters.projection.latitudeOfProjectionCenter
30
- paramCount += ProjectionCommon.unpackLatPC(xParams, hProjection, hResponseObj)
29
+ paramCount += ProjectionCommon.unpackLatPC(xParams, hProjection)
31
30
 
32
31
  # -> ReferenceSystemParameters.projection.falseEasting
33
32
  # -> ReferenceSystemParameters.projection.falseNorthing
34
- paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection, hResponseObj)
33
+ paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection)
35
34
 
36
35
  # verify parameter count
37
36
  if paramCount == 4
38
37
  return hProjection
39
38
  else
40
- hResponseObj[:readerExecutionMessages] << 'WARNING: Gnomonic projection is missing one or more parameters'
39
+ hResponseObj[:readerExecutionMessages] <<
40
+ 'WARNING: Gnomonic projection is missing one or more parameters'
41
41
  end
42
42
  end
43
43
 
@@ -2,6 +2,7 @@
2
2
  # unpack fgdc map projection - lambert conformal conic
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-10-03 refactor mdJson projection object
5
6
  # Stan Smith 2017-10-16 original script
6
7
 
7
8
  require 'nokogiri'
@@ -20,28 +21,27 @@ module ADIWG
20
21
  # map projection 4.1.2.1.9 (lambertc) - Lambert Conformal Conic
21
22
  unless xParams.empty?
22
23
  paramCount = 0
23
- hProjection[:projection] = 'lambertConic'
24
- hProjection[:projectionName] = 'Lambert Conformal Conic'
25
24
 
26
25
  # -> ReferenceSystemParameters.projection.standardParallel1
27
26
  # -> ReferenceSystemParameters.projection.standardParallel2
28
- paramCount += ProjectionCommon.unpackStandParallel(xParams, hProjection, hResponseObj)
27
+ paramCount += ProjectionCommon.unpackStandParallel(xParams, hProjection)
29
28
 
30
29
  # -> ReferenceSystemParameters.projection.longitudeOfCentralMeridian
31
- paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection, hResponseObj)
30
+ paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection)
32
31
 
33
32
  # -> ReferenceSystemParameters.projection.latitudeOfProjectionOrigin
34
- paramCount += ProjectionCommon.unpackLatPO(xParams, hProjection, hResponseObj)
33
+ paramCount += ProjectionCommon.unpackLatPO(xParams, hProjection)
35
34
 
36
35
  # -> ReferenceSystemParameters.projection.falseEasting
37
36
  # -> ReferenceSystemParameters.projection.falseNorthing
38
- paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection, hResponseObj)
37
+ paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection)
39
38
 
40
39
  # verify parameter count
41
40
  if paramCount == 6
42
41
  return hProjection
43
42
  else
44
- hResponseObj[:readerExecutionMessages] << 'WARNING: Lambert Conformal Conic projection is missing one or more parameters'
43
+ hResponseObj[:readerExecutionMessages] <<
44
+ 'WARNING: Lambert Conformal Conic projection is missing one or more parameters'
45
45
  end
46
46
  end
47
47
 
@@ -2,6 +2,7 @@
2
2
  # unpack fgdc map projection - lambert equal area projection
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-10-03 refactor mdJson projection object
5
6
  # Stan Smith 2017-10-16 original script
6
7
 
7
8
  require 'nokogiri'
@@ -20,24 +21,23 @@ module ADIWG
20
21
  # map projection 4.1.2.1.8 (lamberta) - Lambert Azimuthal Equal Area
21
22
  unless xParams.empty?
22
23
  paramCount = 0
23
- hProjection[:projection] = 'lambertEqualArea'
24
- hProjection[:projectionName] = 'Lambert Azimuthal Equal Area'
25
24
 
26
25
  # -> ReferenceSystemParameters.projection.longitudeOfProjectionCenter
27
- paramCount += ProjectionCommon.unpackLongPC(xParams, hProjection, hResponseObj)
26
+ paramCount += ProjectionCommon.unpackLongPC(xParams, hProjection)
28
27
 
29
28
  # -> ReferenceSystemParameters.projection.latitudeOfProjectionCenter
30
- paramCount += ProjectionCommon.unpackLatPC(xParams, hProjection, hResponseObj)
29
+ paramCount += ProjectionCommon.unpackLatPC(xParams, hProjection)
31
30
 
32
31
  # -> ReferenceSystemParameters.projection.falseEasting
33
32
  # -> ReferenceSystemParameters.projection.falseNorthing
34
- paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection, hResponseObj)
33
+ paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection)
35
34
 
36
35
  # verify parameter count
37
36
  if paramCount == 4
38
37
  return hProjection
39
38
  else
40
- hResponseObj[:readerExecutionMessages] << 'WARNING: Lambert Azimuthal Equal Area projection is missing one or more parameters'
39
+ hResponseObj[:readerExecutionMessages] <<
40
+ 'WARNING: Lambert Azimuthal Equal Area projection is missing one or more parameters'
41
41
  end
42
42
  end
43
43
 
@@ -2,6 +2,7 @@
2
2
  # unpack fgdc map projection - mercator
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-10-03 refactor mdJson projection object
5
6
  # Stan Smith 2017-10-16 original script
6
7
 
7
8
  require 'nokogiri'
@@ -21,28 +22,27 @@ module ADIWG
21
22
  # -> ReferenceSystemParameters.projection.[ standardParallel1 | scaleFactorAtEquator ]
22
23
  unless xParams.empty?
23
24
  paramCount = 0
24
- hProjection[:projection] = 'mercator'
25
- hProjection[:projectionName] = 'Mercator'
26
25
 
27
26
  # -> ReferenceSystemParameters.projection.standardParallel1
28
27
  # -> ReferenceSystemParameters.projection.standardParallel2
29
- paramCount += ProjectionCommon.unpackStandParallel(xParams, hProjection, hResponseObj)
28
+ paramCount += ProjectionCommon.unpackStandParallel(xParams, hProjection)
30
29
 
31
30
  # -> ReferenceSystemParameters.projection.scaleFactorAtEquator
32
- paramCount += ProjectionCommon.unpackSFEquator(xParams, hProjection, hResponseObj)
31
+ paramCount += ProjectionCommon.unpackSFEquator(xParams, hProjection)
33
32
 
34
33
  # -> ReferenceSystemParameters.projection.longitudeOfCentralMeridian
35
- paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection, hResponseObj)
34
+ paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection)
36
35
 
37
36
  # -> ReferenceSystemParameters.projection.falseEasting
38
37
  # -> ReferenceSystemParameters.projection.falseNorthing
39
- paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection, hResponseObj)
38
+ paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection)
40
39
 
41
40
  # verify parameter count
42
41
  if paramCount == 4
43
42
  return hProjection
44
43
  else
45
- hResponseObj[:readerExecutionMessages] << 'WARNING: Mercator projection is missing one or more parameters'
44
+ hResponseObj[:readerExecutionMessages] <<
45
+ 'WARNING: Mercator projection is missing one or more parameters'
46
46
  end
47
47
  end
48
48
 
@@ -2,6 +2,7 @@
2
2
  # unpack fgdc map projection - miller cylindrical
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-10-03 refactor mdJson projection object
5
6
  # Stan Smith 2017-10-16 original script
6
7
 
7
8
  require 'nokogiri'
@@ -20,21 +21,20 @@ module ADIWG
20
21
  # map projection 4.1.2.1.12 (miller) - Miller Cylindrical
21
22
  unless xParams.empty?
22
23
  paramCount = 0
23
- hProjection[:projection] = 'miller'
24
- hProjection[:projectionName] = 'Miller Cylindrical'
25
24
 
26
25
  # -> ReferenceSystemParameters.projection.longitudeOfCentralMeridian
27
- paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection, hResponseObj)
26
+ paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection)
28
27
 
29
28
  # -> ReferenceSystemParameters.projection.falseEasting
30
29
  # -> ReferenceSystemParameters.projection.falseNorthing
31
- paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection, hResponseObj)
30
+ paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection)
32
31
 
33
32
  # verify parameter count
34
33
  if paramCount == 3
35
34
  return hProjection
36
35
  else
37
- hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: Miller Cylindrical projection is missing one or more parameters'
36
+ hResponseObj[:readerExecutionMessages] <<
37
+ 'WARNING: FGDC reader: Miller Cylindrical projection is missing one or more parameters'
38
38
  end
39
39
  end
40
40
 
@@ -2,6 +2,7 @@
2
2
  # unpack fgdc map projection - modified stereographic for alaska
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-10-03 refactor mdJson projection object
5
6
  # Stan Smith 2017-10-16 original script
6
7
 
7
8
  require 'nokogiri'
@@ -20,18 +21,17 @@ module ADIWG
20
21
  # map projection 4.1.2.1.11 (modsak) - Modified Stereographic for Alaska
21
22
  unless xParams.empty?
22
23
  paramCount = 0
23
- hProjection[:projection] = 'alaska'
24
- hProjection[:projectionName] = 'Modified Stereographic for Alaska'
25
24
 
26
25
  # -> ReferenceSystemParameters.projection.falseEasting
27
26
  # -> ReferenceSystemParameters.projection.falseNorthing
28
- paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection, hResponseObj)
27
+ paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection,)
29
28
 
30
29
  # verify parameter count
31
30
  if paramCount == 2
32
31
  return hProjection
33
32
  else
34
- hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: Alaska Modified Stereographic projection is missing one or more parameters'
33
+ hResponseObj[:readerExecutionMessages] <<
34
+ 'WARNING: FGDC reader: Alaska Modified Stereographic projection is missing one or more parameters'
35
35
  end
36
36
  end
37
37
 
@@ -2,6 +2,7 @@
2
2
  # unpack fgdc map projection - oblique mercator
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-10-03 refactor mdJson projection object
5
6
  # Stan Smith 2017-10-17 original script
6
7
 
7
8
  require 'nokogiri'
@@ -20,32 +21,31 @@ module ADIWG
20
21
  # map projection 4.1.2.1.13 (obqmerc) - Oblique Mercator
21
22
  unless xParams.empty?
22
23
  paramCount = 0
23
- hProjection[:projection] = 'obliqueMercator'
24
- hProjection[:projectionName] = 'Oblique Mercator'
25
24
 
26
25
  # -> ReferenceSystemParameters.projection.scaleFactorAtCenterLine
27
- paramCount += ProjectionCommon.unpackSFCenter(xParams, hProjection, hResponseObj)
26
+ paramCount += ProjectionCommon.unpackSFCenter(xParams, hProjection)
28
27
 
29
28
  # -> oblique line azimuth ( azimuthAngle && azimuthMeasurePointLongitude )
30
29
  # -> ReferenceSystemParameters.projection.azimuthAngle
31
30
  # -> ReferenceSystemParameters.projection.azimuthMeasurePointLongitude
32
- paramCount += ProjectionCommon.unpackObliqueLA(xParams, hProjection, hResponseObj)
31
+ paramCount += ProjectionCommon.unpackObliqueLA(xParams, hProjection)
33
32
 
34
33
  # -> oblique line point 2( obliqueLinePoint{} )
35
- paramCount += ProjectionCommon.unpackObliqueLP(xParams, hProjection, hResponseObj)
34
+ paramCount += ProjectionCommon.unpackObliqueLP(xParams, hProjection)
36
35
 
37
36
  # -> ReferenceSystemParameters.projection.latitudeOfProjectionOrigin
38
- paramCount += ProjectionCommon.unpackLatPO(xParams, hProjection, hResponseObj)
37
+ paramCount += ProjectionCommon.unpackLatPO(xParams, hProjection)
39
38
 
40
39
  # -> ReferenceSystemParameters.projection.falseEasting
41
40
  # -> ReferenceSystemParameters.projection.falseNorthing
42
- paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection, hResponseObj)
41
+ paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection)
43
42
 
44
43
  # verify parameter count
45
44
  if paramCount == 6
46
45
  return hProjection
47
46
  else
48
- hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: Oblique Mercator projection is missing one or more parameters'
47
+ hResponseObj[:readerExecutionMessages] <<
48
+ 'WARNING: FGDC reader: Oblique Mercator projection is missing one or more parameters'
49
49
  end
50
50
  end
51
51
 
@@ -2,6 +2,7 @@
2
2
  # unpack fgdc map projection - orthographic
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-10-03 refactor mdJson projection object
5
6
  # Stan Smith 2017-10-17 original script
6
7
 
7
8
  require 'nokogiri'
@@ -20,24 +21,23 @@ module ADIWG
20
21
  # map projection 4.1.2.1.14 (orthogr) - Orthographic
21
22
  unless xParams.empty?
22
23
  paramCount = 0
23
- hProjection[:projection] = 'orthographic'
24
- hProjection[:projectionName] = 'Orthographic'
25
24
 
26
25
  # -> ReferenceSystemParameters.projection.longitudeOfProjectionCenter
27
- paramCount += ProjectionCommon.unpackLongPC(xParams, hProjection, hResponseObj)
26
+ paramCount += ProjectionCommon.unpackLongPC(xParams, hProjection)
28
27
 
29
28
  # -> ReferenceSystemParameters.projection.latitudeOfProjectionCenter
30
- paramCount += ProjectionCommon.unpackLatPC(xParams, hProjection, hResponseObj)
29
+ paramCount += ProjectionCommon.unpackLatPC(xParams, hProjection)
31
30
 
32
31
  # -> ReferenceSystemParameters.projection.falseEasting
33
32
  # -> ReferenceSystemParameters.projection.falseNorthing
34
- paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection, hResponseObj)
33
+ paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection)
35
34
 
36
35
  # verify parameter count
37
36
  if paramCount == 4
38
37
  return hProjection
39
38
  else
40
- hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: Orthographic projection is missing one or more parameters'
39
+ hResponseObj[:readerExecutionMessages] <<
40
+ 'WARNING: FGDC reader: Orthographic projection is missing one or more parameters'
41
41
  end
42
42
  end
43
43