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
@@ -2,10 +2,12 @@
2
2
  # unpack fgdc map projection - parameter set
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-10-03 refactor mdJson projection object
5
6
  # Stan Smith 2017-10-18 original script
6
7
 
7
8
  require 'nokogiri'
8
9
  require 'adiwg/mdtranslator/internal/internal_metadata_obj'
10
+ require_relative 'projection_common'
9
11
 
10
12
  module ADIWG
11
13
  module Mdtranslator
@@ -18,63 +20,61 @@ module ADIWG
18
20
 
19
21
  # map projection 4.1.2.1.23 (mapprojp) - projection parameter set
20
22
  unless xParams.empty?
21
- hProjection[:projection] = 'parameters'
22
- hProjection[:projectionName] = 'Projection Parameter Set'
23
23
 
24
24
  # -> ReferenceSystemParameters.projection.standardParallel1
25
25
  # -> ReferenceSystemParameters.projection.standardParallel2
26
- ProjectionCommon.unpackStandParallel(xParams, hProjection, hResponseObj)
26
+ ProjectionCommon.unpackStandParallel(xParams, hProjection)
27
27
 
28
28
  # -> ReferenceSystemParameters.projection.longitudeOfCentralMeridian
29
- ProjectionCommon.unpackLongCM(xParams, hProjection, hResponseObj)
29
+ ProjectionCommon.unpackLongCM(xParams, hProjection)
30
30
 
31
31
  # -> ReferenceSystemParameters.projection.latitudeOfProjectionOrigin
32
- ProjectionCommon.unpackLatPO(xParams, hProjection, hResponseObj)
32
+ ProjectionCommon.unpackLatPO(xParams, hProjection)
33
33
 
34
34
  # -> ReferenceSystemParameters.projection.falseEasting
35
35
  # -> ReferenceSystemParameters.projection.falseNorthing
36
- ProjectionCommon.unpackFalseNE(xParams, hProjection, hResponseObj)
36
+ ProjectionCommon.unpackFalseNE(xParams, hProjection)
37
37
 
38
38
  # -> ReferenceSystemParameters.projection.heightOfProspectivePointAboveSurface
39
- ProjectionCommon.unpackHeightAS(xParams, hProjection, hResponseObj)
39
+ ProjectionCommon.unpackHeightAS(xParams, hProjection)
40
40
 
41
41
  # -> ReferenceSystemParameters.projection.longitudeOfProjectionCenter
42
- ProjectionCommon.unpackLongPC(xParams, hProjection, hResponseObj)
42
+ ProjectionCommon.unpackLongPC(xParams, hProjection)
43
43
 
44
44
  # -> ReferenceSystemParameters.projection.latitudeOfProjectionCenter
45
- ProjectionCommon.unpackLatPC(xParams, hProjection, hResponseObj)
45
+ ProjectionCommon.unpackLatPC(xParams, hProjection)
46
46
 
47
47
  # -> ReferenceSystemParameters.projection.scaleFactorAtEquator
48
- ProjectionCommon.unpackSFEquator(xParams, hProjection, hResponseObj)
48
+ ProjectionCommon.unpackSFEquator(xParams, hProjection)
49
49
 
50
50
  # -> ReferenceSystemParameters.projection.scaleFactorAtCenterLine
51
- ProjectionCommon.unpackSFCenter(xParams, hProjection, hResponseObj)
51
+ ProjectionCommon.unpackSFCenter(xParams, hProjection)
52
52
 
53
53
  # -> ReferenceSystemParameters.projection.scaleFactorAtCentralMeridian
54
- ProjectionCommon.unpackSFCM(xParams, hProjection, hResponseObj)
54
+ ProjectionCommon.unpackSFCM(xParams, hProjection)
55
55
 
56
56
  # -> ReferenceSystemParameters.projection.scaleFactorAtProjectionOrigin
57
- ProjectionCommon.unpackSFPO(xParams, hProjection, hResponseObj)
57
+ ProjectionCommon.unpackSFPO(xParams, hProjection)
58
58
 
59
59
  # -> oblique line azimuth ( azimuthAngle && azimuthMeasurePointLongitude )
60
60
  # -> ReferenceSystemParameters.projection.azimuthAngle
61
61
  # -> ReferenceSystemParameters.projection.azimuthMeasurePointLongitude
62
- ProjectionCommon.unpackObliqueLA(xParams, hProjection, hResponseObj)
62
+ ProjectionCommon.unpackObliqueLA(xParams, hProjection)
63
63
 
64
64
  # -> oblique line point 2( obliqueLinePoint{} )
65
- ProjectionCommon.unpackObliqueLP(xParams, hProjection, hResponseObj)
65
+ ProjectionCommon.unpackObliqueLP(xParams, hProjection)
66
66
 
67
67
  # -> ReferenceSystemParameters.projection.straightVerticalLongitudeFromPole
68
- ProjectionCommon.unpackVSLong(xParams, hProjection, hResponseObj)
68
+ ProjectionCommon.unpackVSLong(xParams, hProjection)
69
69
 
70
70
  # -> ReferenceSystemParameters.projection.landsatNumber
71
- ProjectionCommon.unpackLandSat(xParams, hProjection, hResponseObj)
71
+ ProjectionCommon.unpackLandSat(xParams, hProjection)
72
72
 
73
73
  # -> ReferenceSystemParameters.projection.landsatPath
74
- ProjectionCommon.unpackLandSatPath(xParams, hProjection, hResponseObj)
74
+ ProjectionCommon.unpackLandSatPath(xParams, hProjection)
75
75
 
76
- # -> ReferenceSystemParameters.projection.otherProjectionDescription
77
- ProjectionCommon.unpackOtherProjection(xParams, hProjection, hResponseObj)
76
+ # -> ReferenceSystemParameters.projection.projectionIdentifier.description
77
+ ProjectionCommon.unpackOtherProjection(xParams, hProjection)
78
78
 
79
79
  return hProjection
80
80
 
@@ -2,6 +2,7 @@
2
2
  # unpack fgdc map projection - polar stereographic
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,31 +21,30 @@ module ADIWG
20
21
  # map projection 4.1.2.1.15 (polarst) - Polar Stereographic
21
22
  unless xParams.empty?
22
23
  paramCount = 0
23
- hProjection[:projection] = 'polarStereo'
24
- hProjection[:projectionName] = 'Polar Stereographic'
25
24
 
26
25
  # -> ReferenceSystemParameters.projection.straightVerticalLongitudeFromPole
27
- paramCount += ProjectionCommon.unpackVSLong(xParams, hProjection, hResponseObj)
26
+ paramCount += ProjectionCommon.unpackVSLong(xParams, hProjection)
28
27
 
29
28
  # -> [ standardParallel1 | scaleFactorAtProjectionOrigin ]
30
29
  # -> ReferenceSystemParameters.projection.standardParallel1
31
- paramCount += ProjectionCommon.unpackStandParallel(xParams, hProjection, hResponseObj)
30
+ paramCount += ProjectionCommon.unpackStandParallel(xParams, hProjection)
32
31
 
33
32
  # -> ReferenceSystemParameters.projection.scaleFactorAtProjectionOrigin
34
- paramCount += ProjectionCommon.unpackSFPO(xParams, hProjection, hResponseObj)
33
+ paramCount += ProjectionCommon.unpackSFPO(xParams, hProjection)
35
34
 
36
35
  # -> ReferenceSystemParameters.projection.latitudeOfProjectionCenter
37
- paramCount += ProjectionCommon.unpackLatPC(xParams, hProjection, hResponseObj)
36
+ paramCount += ProjectionCommon.unpackLatPC(xParams, hProjection)
38
37
 
39
38
  # -> ReferenceSystemParameters.projection.falseEasting
40
39
  # -> ReferenceSystemParameters.projection.falseNorthing
41
- paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection, hResponseObj)
40
+ paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection)
42
41
 
43
42
  # verify parameter count
44
43
  if paramCount == 4
45
44
  return hProjection
46
45
  else
47
- hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: Polar Stereographic projection is missing one or more parameters'
46
+ hResponseObj[:readerExecutionMessages] <<
47
+ 'WARNING: FGDC reader: Polar Stereographic projection is missing one or more parameters'
48
48
  end
49
49
  end
50
50
 
@@ -2,6 +2,7 @@
2
2
  # unpack fgdc map projection - polyconic
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.16 (polycon) - Polyconic
21
22
  unless xParams.empty?
22
23
  paramCount = 0
23
- hProjection[:projection] = 'polyconic'
24
- hProjection[:projectionName] = 'Polyconic'
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.latitudeOfProjectionOrigin
30
- paramCount += ProjectionCommon.unpackLatPO(xParams, hProjection, hResponseObj)
29
+ paramCount += ProjectionCommon.unpackLatPO(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: Polyconic projection is missing one or more parameters'
39
+ hResponseObj[:readerExecutionMessages] <<
40
+ 'WARNING: FGDC reader: Polyconic 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 - robinson
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-10-03 refactor mdJson projection object
5
6
  # Stan Smith 2017-10-18 original script
6
7
 
7
8
  require 'nokogiri'
@@ -20,21 +21,20 @@ module ADIWG
20
21
  # map projection 4.1.2.1.17 (robinson) - Robinson
21
22
  unless xParams.empty?
22
23
  paramCount = 0
23
- hProjection[:projection] = 'robinson'
24
- hProjection[:projectionName] = 'Robinson'
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.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: Robinson projection is missing one or more parameters'
36
+ hResponseObj[:readerExecutionMessages] <<
37
+ 'WARNING: FGDC reader: Robinson 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 - sinusoidal
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-10-03 refactor mdJson projection object
5
6
  # Stan Smith 2017-10-18 original script
6
7
 
7
8
  require 'nokogiri'
@@ -20,21 +21,20 @@ module ADIWG
20
21
  # map projection 4.1.2.1.18 (sinusoid) - Sinusoidal
21
22
  unless xParams.empty?
22
23
  paramCount = 0
23
- hProjection[:projection] = 'sinusoidal'
24
- hProjection[:projectionName] = 'Sinusoidal'
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: Sinusoidal projection is missing one or more parameters'
36
+ hResponseObj[:readerExecutionMessages] <<
37
+ 'WARNING: Sinusoidal 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 - space oblique
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-10-03 refactor mdJson projection object
5
6
  # Stan Smith 2017-10-18 original script
6
7
 
7
8
  require 'nokogiri'
@@ -20,24 +21,23 @@ module ADIWG
20
21
  # map projection 4.1.2.1.19 (spaceobq) - Space Oblique Mercator (Landsat)
21
22
  unless xParams.empty?
22
23
  paramCount = 0
23
- hProjection[:projection] = 'spaceOblique'
24
- hProjection[:projectionName] = 'Space Oblique Mercator (Landsat)'
25
24
 
26
25
  # -> ReferenceSystemParameters.projection.landsatNumber
27
- paramCount += ProjectionCommon.unpackLandSat(xParams, hProjection, hResponseObj)
26
+ paramCount += ProjectionCommon.unpackLandSat(xParams, hProjection)
28
27
 
29
28
  # -> ReferenceSystemParameters.projection.landsatPath
30
- paramCount += ProjectionCommon.unpackLandSatPath(xParams, hProjection, hResponseObj)
29
+ paramCount += ProjectionCommon.unpackLandSatPath(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: Space Oblique projection is missing one or more parameters'
39
+ hResponseObj[:readerExecutionMessages] <<
40
+ 'WARNING: Space Oblique 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 - stereographic
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-10-03 refactor mdJson projection object
5
6
  # Stan Smith 2017-10-18 original script
6
7
 
7
8
  require 'nokogiri'
@@ -20,24 +21,23 @@ module ADIWG
20
21
  # map projection 4.1.2.1.20 (stereo) - Stereographic
21
22
  unless xParams.empty?
22
23
  paramCount = 0
23
- hProjection[:projection] = 'stereographic'
24
- hProjection[:projectionName] = 'Stereographic'
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: Stereographic projection is missing one or more parameters'
39
+ hResponseObj[:readerExecutionMessages] <<
40
+ 'WARNING: FGDC reader: Stereographic 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 - transverse mercator
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-10-03 refactor mdJson projection object
5
6
  # Stan Smith 2017-10-04 original script
6
7
 
7
8
  require 'nokogiri'
@@ -19,26 +20,25 @@ module ADIWG
19
20
  # map projection 4.1.2.1.21 (transmer) - Transverse Mercator
20
21
  unless xParams.empty?
21
22
  paramCount = 0
22
- hProjection[:projection] = 'transverseMercator'
23
- hProjection[:projectionName] = 'Transverse Mercator'
24
23
 
25
24
  # -> ReferenceSystemParameters.projection.scaleFactorAtCentralMeridian
26
- paramCount += ProjectionCommon.unpackSFCM(xParams, hProjection, hResponseObj)
25
+ paramCount += ProjectionCommon.unpackSFCM(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.latitudeOfProjectionOrigin
32
- paramCount += ProjectionCommon.unpackLatPO(xParams, hProjection, hResponseObj)
31
+ paramCount += ProjectionCommon.unpackLatPO(xParams, hProjection)
33
32
 
34
33
  # -> ReferenceSystemParameters.projection.falseEasting
35
34
  # -> ReferenceSystemParameters.projection.falseNorthing
36
- paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection, hResponseObj)
35
+ paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection)
37
36
 
38
37
  if paramCount == 5
39
38
  return hProjection
40
39
  else
41
- hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: Transverse Mercator projection is missing one or more parameters'
40
+ hResponseObj[:readerExecutionMessages] <<
41
+ 'WARNING: FGDC reader: Transverse Mercator projection is missing one or more parameters'
42
42
  end
43
43
  end
44
44
 
@@ -2,6 +2,7 @@
2
2
  # unpack fgdc map projection - van der grinten
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-10-03 refactor mdJson projection object
5
6
  # Stan Smith 2017-10-18 original script
6
7
 
7
8
  require 'nokogiri'
@@ -19,20 +20,19 @@ module ADIWG
19
20
  # map projection 4.1.2.1.22 (vdgrin) - van der Grinten
20
21
  unless xParams.empty?
21
22
  paramCount = 0
22
- hProjection[:projection] = 'grinten'
23
- hProjection[:projectionName] = 'van der Grinten'
24
23
 
25
24
  # -> ReferenceSystemParameters.projection.longitudeOfCentralMeridian
26
- paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection, hResponseObj)
25
+ paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection)
27
26
 
28
27
  # -> ReferenceSystemParameters.projection.falseEasting
29
28
  # -> ReferenceSystemParameters.projection.falseNorthing
30
- paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection, hResponseObj)
29
+ paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection)
31
30
 
32
31
  if paramCount == 3
33
32
  return hProjection
34
33
  else
35
- hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: Van Der Grinten projection is missing one or more parameters'
34
+ hResponseObj[:readerExecutionMessages] <<
35
+ 'WARNING: FGDC reader: Van Der Grinten projection is missing one or more parameters'
36
36
  end
37
37
  end
38
38
 
@@ -2,6 +2,7 @@
2
2
  # unpack fgdc horizontal data geodetic reference
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-09-26 deprecate datumName and ellipsoidName from mdJSON
5
6
  # Stan Smith 2017-12-29 original script
6
7
 
7
8
  require 'nokogiri'
@@ -23,20 +24,25 @@ module ADIWG
23
24
  xGeodetic = xHorizontalRef.xpath('./geodetic')
24
25
 
25
26
  # geodetic model 4.1.4.1 (horizdn) - horizontal datum name
26
- # -> referenceSystemParameters.geodetic.datumName
27
+ # -> referenceSystemParameters.geodetic.datumIdentifier.identifier
27
28
  datumName = xGeodetic.xpath('./horizdn').text
28
29
  unless datumName.empty?
29
- hGeodetic[:datumName] = datumName
30
+ hGeodetic[:datumIdentifier] = intMetadataClass.newIdentifier
31
+ hGeodetic[:datumIdentifier][:identifier] = datumName
32
+ hGeodetic[:datumIdentifier][:name] = datumName
30
33
  end
31
34
 
32
35
  # geodetic model 4.1.4.2 (ellips) - ellipsoid name (required)
33
- # -> referenceSystemParameters.geodetic.ellipsoidName
36
+ # -> referenceSystemParameters.geodetic.ellipsoidIdentifier.identifier
34
37
  ellipsoidName = xGeodetic.xpath('./ellips').text
35
38
  unless ellipsoidName.empty?
36
- hGeodetic[:ellipsoidName] = ellipsoidName
39
+ hGeodetic[:ellipsoidIdentifier] = intMetadataClass.newIdentifier
40
+ hGeodetic[:ellipsoidIdentifier][:identifier] = ellipsoidName
41
+ hGeodetic[:ellipsoidIdentifier][:name] = ellipsoidName
37
42
  end
38
43
  if ellipsoidName.empty?
39
- hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: geodetic reference ellipsoid name is missing'
44
+ hResponseObj[:readerExecutionMessages] <<
45
+ 'WARNING: FGDC reader: geodetic reference ellipsoid name is missing'
40
46
  end
41
47
 
42
48
  # geodetic model 4.1.4.3 (semiaxis) - semi-major axis (required)
@@ -46,7 +52,8 @@ module ADIWG
46
52
  hGeodetic[:semiMajorAxis] = semiAxis.to_f
47
53
  end
48
54
  if semiAxis.empty?
49
- hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: geodetic reference semi-major axis is missing'
55
+ hResponseObj[:readerExecutionMessages] <<
56
+ 'WARNING: FGDC reader: geodetic reference radius of semi-major axis is missing'
50
57
  end
51
58
 
52
59
  # geodetic model 4.1.2.4.4 (plandu) - distance units
@@ -71,7 +78,8 @@ module ADIWG
71
78
  hGeodetic[:denominatorOfFlatteningRatio] = flattening.to_f
72
79
  end
73
80
  if flattening.empty?
74
- hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: geodetic reference flattening ratio is missing'
81
+ hResponseObj[:readerExecutionMessages] <<
82
+ 'WARNING: FGDC reader: geodetic reference denominator flattening ratio is missing'
75
83
  end
76
84
 
77
85
  hReferenceSystem = intMetadataClass.newSpatialReferenceSystem
@@ -29,7 +29,8 @@ module ADIWG
29
29
  hGeoResolution[:latitudeResolution] = latResolution.to_f
30
30
  end
31
31
  if latResolution.empty?
32
- hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: geographic latitude resolution is missing'
32
+ hResponseObj[:readerExecutionMessages] <<
33
+ 'WARNING: FGDC reader: geographic latitude resolution is missing'
33
34
  end
34
35
 
35
36
  # geographic reference 4.1.1.2 (longres) - longitude resolution (required)
@@ -39,7 +40,8 @@ module ADIWG
39
40
  hGeoResolution[:longitudeResolution] = longResolution.to_f
40
41
  end
41
42
  if longResolution.empty?
42
- hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: geographic longitude resolution is missing'
43
+ hResponseObj[:readerExecutionMessages] <<
44
+ 'WARNING: FGDC reader: geographic longitude resolution is missing'
43
45
  end
44
46
 
45
47
  # geographic reference 4.1.1.3 (geogunit) - latitude/longitude units (required)
@@ -49,7 +51,8 @@ module ADIWG
49
51
  hGeoResolution[:unitOfMeasure] = unitMeasure
50
52
  end
51
53
  if unitMeasure.empty?
52
- hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: geographic latitude/longitude units are missing'
54
+ hResponseObj[:readerExecutionMessages] <<
55
+ 'WARNING: FGDC reader: geographic latitude/longitude units are missing'
53
56
  end
54
57
 
55
58
  hResolution[:geographicResolution] = hGeoResolution
@@ -2,14 +2,15 @@
2
2
  # unpack fgdc horizontal planar data reference
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-10-04 refactor mdJson projection object
5
6
  # Stan Smith 2017-10-03 original script
6
7
 
7
8
  require 'nokogiri'
8
9
  require 'adiwg/mdtranslator/internal/internal_metadata_obj'
9
10
  require_relative 'module_mapProjection'
10
11
  require_relative 'module_mapGridSystem'
11
- require_relative 'module_mapLocalPlanar'
12
- require_relative 'module_mapCoordinateInfo'
12
+ require_relative 'module_localPlanar'
13
+ require_relative 'module_planarCoordinateInfo'
13
14
 
14
15
  module ADIWG
15
16
  module Mdtranslator
@@ -22,7 +23,9 @@ module ADIWG
22
23
 
23
24
  # instance classes needed in script
24
25
  intMetadataClass = InternalMetadata.new
25
- hProjection = nil
26
+ hReferenceSystem = intMetadataClass.newSpatialReferenceSystem
27
+ hSystemParameters = intMetadataClass.newReferenceSystemParameterSet
28
+ hProjection = {}
26
29
 
27
30
  # get distance unit of measure for use in map projections and grid systems
28
31
  distanceUnits = nil
@@ -52,9 +55,8 @@ module ADIWG
52
55
  hProjection = MapLocalPlanar.unpack(xMapLocal, hResponseObj)
53
56
  end
54
57
 
55
- unless hProjection.nil?
56
- hReferenceSystem = intMetadataClass.newSpatialReferenceSystem
57
- hSystemParameters = intMetadataClass.newReferenceSystemParameterSet
58
+ # packing
59
+ unless hProjection.empty?
58
60
  unless distanceUnits.nil?
59
61
  hProjection[:falseEastingNorthingUnits] = distanceUnits
60
62
  end
@@ -39,7 +39,7 @@ module ADIWG
39
39
  # horizontal reference 4.1.3 (local) - local coordinate system
40
40
  xLocal = xHorizontalRef.xpath('./local')
41
41
  unless xLocal.empty?
42
- hReferenceSystem = LocalSystem.unpack(xLocal, hResponseObj)
42
+ hReferenceSystem = MapLocalSystem.unpack(xLocal, hResponseObj)
43
43
  unless hReferenceSystem.nil?
44
44
  hResourceInfo[:spatialReferenceSystems] << hReferenceSystem
45
45
  end
@@ -2,6 +2,7 @@
2
2
  # unpack fgdc map grid coordinate system
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-10-04 refactor mdJson projection object
5
6
  # Stan Smith 2017-10-04 original script
6
7
 
7
8
  require 'nokogiri'
@@ -18,28 +19,35 @@ module ADIWG
18
19
  # instance classes needed in script
19
20
  intMetadataClass = InternalMetadata.new
20
21
  hProjection = intMetadataClass.newProjection
22
+ hIdentifier = intMetadataClass.newIdentifier
23
+ hLocal = intMetadataClass.newLocal
24
+ hProjection[:projectionIdentifier] = hIdentifier
25
+ hProjection[:local] = hLocal
21
26
 
22
- hProjection[:projection] = 'localPlanar'
23
- hProjection[:projectionName] = 'local planar coordinate system'
27
+ hIdentifier[:identifier] = 'localPlanar'
28
+ hIdentifier[:name] = 'Local Planar Coordinate System'
29
+ hLocal[:fixedToEarth] = true
24
30
 
25
31
  # local planar 4.1.2.3.1 (localpd) - local planar description (required)
26
- # -> ReferenceSystemParameters.projection.localPlanarDescription
32
+ # -> ReferenceSystemParameters.projection.local.description
27
33
  description = xMapLocal.xpath('./localpd').text
28
34
  unless description.empty?
29
- hProjection[:localPlanarDescription] = description
35
+ hLocal[:description] = description
30
36
  end
31
37
  if description.empty?
32
- hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: local planar coordinate system description is missing'
38
+ hResponseObj[:readerExecutionMessages] <<
39
+ 'WARNING: FGDC reader: local planar coordinate system description is missing'
33
40
  end
34
41
 
35
42
  # local planar 4.1.2.3.2 (localpgi) - local planar georeference information (required)
36
- # -> ReferenceSystemParameters.projection.localPlanarGeoreference
43
+ # -> ReferenceSystemParameters.projection.local.georeference
37
44
  georeference = xMapLocal.xpath('./localpgi').text
38
45
  unless georeference.empty?
39
- hProjection[:localPlanarGeoreference] = georeference
46
+ hLocal[:georeference] = georeference
40
47
  end
41
48
  if georeference.empty?
42
- hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: local planar coordinate system georeference information is missing'
49
+ hResponseObj[:readerExecutionMessages] <<
50
+ 'WARNING: FGDC reader: local planar coordinate system georeference information is missing'
43
51
  end
44
52
 
45
53
  return hProjection