adiwg-mdtranslator 2.3.5 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +49 -8
  3. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_albers.rb +57 -0
  4. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_azimuthEquidistant.rb +53 -0
  5. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_common.rb +252 -0
  6. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_equidistantConic.rb +56 -0
  7. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_equirectangular.rb +53 -0
  8. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_generalVertical.rb +57 -0
  9. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_gnomonic.rb +53 -0
  10. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_lambertConic.rb +57 -0
  11. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_lambertEqualArea.rb +53 -0
  12. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_mercator.rb +58 -0
  13. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_millerCylinder.rb +50 -0
  14. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_modifiedAlaska.rb +47 -0
  15. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_obliqueMercator.rb +61 -0
  16. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_orthographic.rb +53 -0
  17. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_parameters.rb +91 -0
  18. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_polarStereo.rb +60 -0
  19. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_polyconic.rb +53 -0
  20. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_robinson.rb +50 -0
  21. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_sinusoidal.rb +50 -0
  22. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_spaceOblique.rb +53 -0
  23. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_stereographic.rb +53 -0
  24. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_transverseMercator.rb +54 -0
  25. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_vanDerGrinten.rb +48 -0
  26. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_fgdc.rb +4 -4
  27. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_horizontalPlanar.rb +81 -0
  28. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_horizontalReference.rb +167 -0
  29. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapCoordinateInfo.rb +128 -0
  30. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapGridSystem.rb +159 -0
  31. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapLocalSystem.rb +59 -0
  32. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapProjection.rb +195 -0
  33. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_spatialReference.rb +15 -1
  34. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_verticalAltitude.rb +68 -0
  35. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_verticalDepth.rb +68 -0
  36. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_verticalReference.rb +48 -0
  37. data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_reader.rb +5 -3
  38. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_bearingDistanceResolution.rb +96 -0
  39. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_citation.rb +126 -126
  40. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_coordinateResolution.rb +66 -0
  41. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_ellipsoid.rb +78 -0
  42. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geographicResolution.rb +66 -0
  43. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_obliqueLinePoint.rb +55 -0
  44. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_projectionParameters.rb +237 -0
  45. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_referenceSystemParameters.rb +69 -0
  46. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_spatialReference.rb +57 -42
  47. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_spatialResolution.rb +101 -51
  48. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_verticalDatum.rb +89 -0
  49. data/lib/adiwg/mdtranslator/version.rb +7 -1
  50. data/lib/adiwg/mdtranslator/writers/html/sections/html_bearingDistanceResolution.rb +68 -0
  51. data/lib/adiwg/mdtranslator/writers/html/sections/html_coordinateResolution.rb +47 -0
  52. data/lib/adiwg/mdtranslator/writers/html/sections/html_geographicResolution.rb +47 -0
  53. data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceInfo.rb +48 -7
  54. data/lib/adiwg/mdtranslator/writers/html/sections/html_source.rb +2 -2
  55. data/lib/adiwg/mdtranslator/writers/html/sections/html_spatialResolution.rb +95 -0
  56. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_bearingDistanceResolution.rb +32 -0
  57. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_coordinateResolution.rb +29 -0
  58. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_ellipsoidParameters.rb +32 -0
  59. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_geographicResolution.rb +29 -0
  60. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_obliqueLinePoint.rb +28 -0
  61. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_projectionParameters.rb +57 -0
  62. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_spatialReference.rb +2 -0
  63. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_spatialReferenceParameters.rb +32 -0
  64. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_spatialResolution.rb +16 -1
  65. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_verticalDatumParameters.rb +32 -0
  66. data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_parentId.rb +5 -8
  67. metadata +55 -4
  68. data/lib/adiwg/mdtranslator/writers/html/sections/html_resolution.rb +0 -54
@@ -0,0 +1,47 @@
1
+ # Reader - fgdc to internal data structure
2
+ # unpack fgdc map projection - modified stereographic for alaska
3
+
4
+ # History:
5
+ # Stan Smith 2017-10-16 original script
6
+
7
+ require 'nokogiri'
8
+ require 'adiwg/mdtranslator/internal/internal_metadata_obj'
9
+ require_relative 'projection_common'
10
+
11
+ module ADIWG
12
+ module Mdtranslator
13
+ module Readers
14
+ module Fgdc
15
+
16
+ module ModifiedAlaskaProjection
17
+
18
+ def self.unpack(xParams, hProjection, hResponseObj)
19
+
20
+ # map projection 4.1.2.1.11 (modsak) - Modified Stereographic for Alaska
21
+ unless xParams.empty?
22
+ paramCount = 0
23
+ hProjection[:projectionName] = 'alaska modified stereographic'
24
+
25
+ # -> ReferenceSystemParameters.projection.falseEasting
26
+ # -> ReferenceSystemParameters.projection.falseNorthing
27
+ paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection, hResponseObj)
28
+
29
+ # verify parameter count
30
+ if paramCount == 2
31
+ return hProjection
32
+ else
33
+ hResponseObj[:readerExecutionMessages] << 'alaska modified stereographic projection is missing one or more parameters'
34
+ return nil
35
+ end
36
+ end
37
+
38
+ return nil
39
+
40
+ end
41
+
42
+ end
43
+
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,61 @@
1
+ # Reader - fgdc to internal data structure
2
+ # unpack fgdc map projection - oblique mercator
3
+
4
+ # History:
5
+ # Stan Smith 2017-10-17 original script
6
+
7
+ require 'nokogiri'
8
+ require 'adiwg/mdtranslator/internal/internal_metadata_obj'
9
+ require_relative 'projection_common'
10
+
11
+ module ADIWG
12
+ module Mdtranslator
13
+ module Readers
14
+ module Fgdc
15
+
16
+ module ObliqueMercatorProjection
17
+
18
+ def self.unpack(xParams, hProjection, hResponseObj)
19
+
20
+ # map projection 4.1.2.1.13 (obqmerc) - Oblique Mercator
21
+ unless xParams.empty?
22
+ paramCount = 0
23
+ hProjection[:projectionName] = 'oblique mercator'
24
+
25
+ # -> ReferenceSystemParameters.projection.scaleFactorAtCenterLine
26
+ paramCount += ProjectionCommon.unpackSFCenter(xParams, hProjection, hResponseObj)
27
+
28
+ # -> oblique line azimuth ( azimuthAngle && azimuthMeasurePointLongitude )
29
+ # -> ReferenceSystemParameters.projection.azimuthAngle
30
+ # -> ReferenceSystemParameters.projection.azimuthMeasurePointLongitude
31
+ paramCount += ProjectionCommon.unpackObliqueLA(xParams, hProjection, hResponseObj)
32
+
33
+ # -> oblique line point 2( obliqueLinePoint{} )
34
+ paramCount += ProjectionCommon.unpackObliqueLP(xParams, hProjection, hResponseObj)
35
+
36
+ # -> ReferenceSystemParameters.projection.latitudeOfProjectionOrigin
37
+ paramCount += ProjectionCommon.unpackLatPO(xParams, hProjection, hResponseObj)
38
+
39
+ # -> ReferenceSystemParameters.projection.falseEasting
40
+ # -> ReferenceSystemParameters.projection.falseNorthing
41
+ paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection, hResponseObj)
42
+
43
+ # verify parameter count
44
+ if paramCount == 6
45
+ return hProjection
46
+ else
47
+ hResponseObj[:readerExecutionMessages] << 'oblique mercator projection is missing one or more parameters'
48
+ return nil
49
+ end
50
+ end
51
+
52
+ return nil
53
+
54
+ end
55
+
56
+ end
57
+
58
+ end
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,53 @@
1
+ # Reader - fgdc to internal data structure
2
+ # unpack fgdc map projection - orthographic
3
+
4
+ # History:
5
+ # Stan Smith 2017-10-17 original script
6
+
7
+ require 'nokogiri'
8
+ require 'adiwg/mdtranslator/internal/internal_metadata_obj'
9
+ require_relative 'projection_common'
10
+
11
+ module ADIWG
12
+ module Mdtranslator
13
+ module Readers
14
+ module Fgdc
15
+
16
+ module OrthographicProjection
17
+
18
+ def self.unpack(xParams, hProjection, hResponseObj)
19
+
20
+ # map projection 4.1.2.1.14 (orthogr) - Orthographic
21
+ unless xParams.empty?
22
+ paramCount = 0
23
+ hProjection[:projectionName] = 'orthographic'
24
+
25
+ # -> ReferenceSystemParameters.projection.longitudeOfProjectionCenter
26
+ paramCount += ProjectionCommon.unpackLongPC(xParams, hProjection, hResponseObj)
27
+
28
+ # -> ReferenceSystemParameters.projection.latitudeOfProjectionCenter
29
+ paramCount += ProjectionCommon.unpackLatPC(xParams, hProjection, hResponseObj)
30
+
31
+ # -> ReferenceSystemParameters.projection.falseEasting
32
+ # -> ReferenceSystemParameters.projection.falseNorthing
33
+ paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection, hResponseObj)
34
+
35
+ # verify parameter count
36
+ if paramCount == 4
37
+ return hProjection
38
+ else
39
+ hResponseObj[:readerExecutionMessages] << 'orthographic projection is missing one or more parameters'
40
+ return nil
41
+ end
42
+ end
43
+
44
+ return nil
45
+
46
+ end
47
+
48
+ end
49
+
50
+ end
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,91 @@
1
+ # Reader - fgdc to internal data structure
2
+ # unpack fgdc map projection - parameter set
3
+
4
+ # History:
5
+ # Stan Smith 2017-10-18 original script
6
+
7
+ require 'nokogiri'
8
+ require 'adiwg/mdtranslator/internal/internal_metadata_obj'
9
+
10
+ module ADIWG
11
+ module Mdtranslator
12
+ module Readers
13
+ module Fgdc
14
+
15
+ module ProjectionParameters
16
+
17
+ def self.unpack(xParams, hProjection, hResponseObj)
18
+
19
+ # map projection 4.1.2.1.23 (mapprojp) - projection parameter set
20
+ unless xParams.empty?
21
+ hProjection[:projectionName] = 'projection parameters'
22
+
23
+ # -> ReferenceSystemParameters.projection.standardParallel1
24
+ # -> ReferenceSystemParameters.projection.standardParallel2
25
+ ProjectionCommon.unpackStandParallel(xParams, hProjection, hResponseObj)
26
+
27
+ # -> ReferenceSystemParameters.projection.longitudeOfCentralMeridian
28
+ ProjectionCommon.unpackLongCM(xParams, hProjection, hResponseObj)
29
+
30
+ # -> ReferenceSystemParameters.projection.latitudeOfProjectionOrigin
31
+ ProjectionCommon.unpackLatPO(xParams, hProjection, hResponseObj)
32
+
33
+ # -> ReferenceSystemParameters.projection.falseEasting
34
+ # -> ReferenceSystemParameters.projection.falseNorthing
35
+ ProjectionCommon.unpackFalseNE(xParams, hProjection, hResponseObj)
36
+
37
+ # -> ReferenceSystemParameters.projection.heightOfProspectivePointAboveSurface
38
+ ProjectionCommon.unpackHeightAS(xParams, hProjection, hResponseObj)
39
+
40
+ # -> ReferenceSystemParameters.projection.longitudeOfProjectionCenter
41
+ ProjectionCommon.unpackLongPC(xParams, hProjection, hResponseObj)
42
+
43
+ # -> ReferenceSystemParameters.projection.latitudeOfProjectionCenter
44
+ ProjectionCommon.unpackLatPC(xParams, hProjection, hResponseObj)
45
+
46
+ # -> ReferenceSystemParameters.projection.scaleFactorAtEquator
47
+ ProjectionCommon.unpackSFEquator(xParams, hProjection, hResponseObj)
48
+
49
+ # -> ReferenceSystemParameters.projection.scaleFactorAtCenterLine
50
+ ProjectionCommon.unpackSFCenter(xParams, hProjection, hResponseObj)
51
+
52
+ # -> ReferenceSystemParameters.projection.scaleFactorAtCentralMeridian
53
+ ProjectionCommon.unpackSFCM(xParams, hProjection, hResponseObj)
54
+
55
+ # -> ReferenceSystemParameters.projection.scaleFactorAtProjectionOrigin
56
+ ProjectionCommon.unpackSFPO(xParams, hProjection, hResponseObj)
57
+
58
+ # -> oblique line azimuth ( azimuthAngle && azimuthMeasurePointLongitude )
59
+ # -> ReferenceSystemParameters.projection.azimuthAngle
60
+ # -> ReferenceSystemParameters.projection.azimuthMeasurePointLongitude
61
+ ProjectionCommon.unpackObliqueLA(xParams, hProjection, hResponseObj)
62
+
63
+ # -> oblique line point 2( obliqueLinePoint{} )
64
+ ProjectionCommon.unpackObliqueLP(xParams, hProjection, hResponseObj)
65
+
66
+ # -> ReferenceSystemParameters.projection.straightVerticalLongitudeFromPole
67
+ ProjectionCommon.unpackVSLong(xParams, hProjection, hResponseObj)
68
+
69
+ # -> ReferenceSystemParameters.projection.landsatNumber
70
+ ProjectionCommon.unpackLandSat(xParams, hProjection, hResponseObj)
71
+
72
+ # -> ReferenceSystemParameters.projection.landsatPath
73
+ ProjectionCommon.unpackLandSatPath(xParams, hProjection, hResponseObj)
74
+
75
+ # -> ReferenceSystemParameters.projection.otherProjectionDescription
76
+ ProjectionCommon.unpackOtherProjection(xParams, hProjection, hResponseObj)
77
+
78
+ return hProjection
79
+
80
+ end
81
+
82
+ return nil
83
+
84
+ end
85
+
86
+ end
87
+
88
+ end
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,60 @@
1
+ # Reader - fgdc to internal data structure
2
+ # unpack fgdc map projection - polar stereographic
3
+
4
+ # History:
5
+ # Stan Smith 2017-10-17 original script
6
+
7
+ require 'nokogiri'
8
+ require 'adiwg/mdtranslator/internal/internal_metadata_obj'
9
+ require_relative 'projection_common'
10
+
11
+ module ADIWG
12
+ module Mdtranslator
13
+ module Readers
14
+ module Fgdc
15
+
16
+ module PolarStereoProjection
17
+
18
+ def self.unpack(xParams, hProjection, hResponseObj)
19
+
20
+ # map projection 4.1.2.1.15 (polarst) - Polar Stereographic
21
+ unless xParams.empty?
22
+ paramCount = 0
23
+ hProjection[:projectionName] = 'polar stereographic'
24
+
25
+ # -> ReferenceSystemParameters.projection.straightVerticalLongitudeFromPole
26
+ paramCount += ProjectionCommon.unpackVSLong(xParams, hProjection, hResponseObj)
27
+
28
+ # -> [ standardParallel1 | scaleFactorAtProjectionOrigin ]
29
+ # -> ReferenceSystemParameters.projection.standardParallel1
30
+ paramCount += ProjectionCommon.unpackStandParallel(xParams, hProjection, hResponseObj)
31
+
32
+ # -> ReferenceSystemParameters.projection.scaleFactorAtProjectionOrigin
33
+ paramCount += ProjectionCommon.unpackSFPO(xParams, hProjection, hResponseObj)
34
+
35
+ # -> ReferenceSystemParameters.projection.latitudeOfProjectionCenter
36
+ paramCount += ProjectionCommon.unpackLatPC(xParams, hProjection, hResponseObj)
37
+
38
+ # -> ReferenceSystemParameters.projection.falseEasting
39
+ # -> ReferenceSystemParameters.projection.falseNorthing
40
+ paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection, hResponseObj)
41
+
42
+ # verify parameter count
43
+ if paramCount == 4
44
+ return hProjection
45
+ else
46
+ hResponseObj[:readerExecutionMessages] << 'polar stereographic projection is missing one or more parameters'
47
+ return nil
48
+ end
49
+ end
50
+
51
+ return nil
52
+
53
+ end
54
+
55
+ end
56
+
57
+ end
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,53 @@
1
+ # Reader - fgdc to internal data structure
2
+ # unpack fgdc map projection - polyconic
3
+
4
+ # History:
5
+ # Stan Smith 2017-10-17 original script
6
+
7
+ require 'nokogiri'
8
+ require 'adiwg/mdtranslator/internal/internal_metadata_obj'
9
+ require_relative 'projection_common'
10
+
11
+ module ADIWG
12
+ module Mdtranslator
13
+ module Readers
14
+ module Fgdc
15
+
16
+ module PolyconicProjection
17
+
18
+ def self.unpack(xParams, hProjection, hResponseObj)
19
+
20
+ # map projection 4.1.2.1.16 (polycon) - Polyconic
21
+ unless xParams.empty?
22
+ paramCount = 0
23
+ hProjection[:projectionName] = 'polyconic'
24
+
25
+ # -> ReferenceSystemParameters.projection.longitudeOfCentralMeridian
26
+ paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection, hResponseObj)
27
+
28
+ # -> ReferenceSystemParameters.projection.latitudeOfProjectionOrigin
29
+ paramCount += ProjectionCommon.unpackLatPO(xParams, hProjection, hResponseObj)
30
+
31
+ # -> ReferenceSystemParameters.projection.falseEasting
32
+ # -> ReferenceSystemParameters.projection.falseNorthing
33
+ paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection, hResponseObj)
34
+
35
+ # verify parameter count
36
+ if paramCount == 4
37
+ return hProjection
38
+ else
39
+ hResponseObj[:readerExecutionMessages] << 'polyconic projection is missing one or more parameters'
40
+ return nil
41
+ end
42
+ end
43
+
44
+ return nil
45
+
46
+ end
47
+
48
+ end
49
+
50
+ end
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,50 @@
1
+ # Reader - fgdc to internal data structure
2
+ # unpack fgdc map projection - robinson
3
+
4
+ # History:
5
+ # Stan Smith 2017-10-18 original script
6
+
7
+ require 'nokogiri'
8
+ require 'adiwg/mdtranslator/internal/internal_metadata_obj'
9
+ require_relative 'projection_common'
10
+
11
+ module ADIWG
12
+ module Mdtranslator
13
+ module Readers
14
+ module Fgdc
15
+
16
+ module RobinsonProjection
17
+
18
+ def self.unpack(xParams, hProjection, hResponseObj)
19
+
20
+ # map projection 4.1.2.1.17 (robinson) - Robinson
21
+ unless xParams.empty?
22
+ paramCount = 0
23
+ hProjection[:projectionName] = 'robinson'
24
+
25
+ # -> ReferenceSystemParameters.projection.longitudeOfProjectionCenter
26
+ paramCount += ProjectionCommon.unpackLongPC(xParams, hProjection, hResponseObj)
27
+
28
+ # -> ReferenceSystemParameters.projection.falseEasting
29
+ # -> ReferenceSystemParameters.projection.falseNorthing
30
+ paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection, hResponseObj)
31
+
32
+ # verify parameter count
33
+ if paramCount == 3
34
+ return hProjection
35
+ else
36
+ hResponseObj[:readerExecutionMessages] << 'robinson projection is missing one or more parameters'
37
+ return nil
38
+ end
39
+ end
40
+
41
+ return nil
42
+
43
+ end
44
+
45
+ end
46
+
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,50 @@
1
+ # Reader - fgdc to internal data structure
2
+ # unpack fgdc map projection - sinusoidal
3
+
4
+ # History:
5
+ # Stan Smith 2017-10-18 original script
6
+
7
+ require 'nokogiri'
8
+ require 'adiwg/mdtranslator/internal/internal_metadata_obj'
9
+ require_relative 'projection_common'
10
+
11
+ module ADIWG
12
+ module Mdtranslator
13
+ module Readers
14
+ module Fgdc
15
+
16
+ module SinusoidalProjection
17
+
18
+ def self.unpack(xParams, hProjection, hResponseObj)
19
+
20
+ # map projection 4.1.2.1.18 (sinusoid) - Sinusoidal
21
+ unless xParams.empty?
22
+ paramCount = 0
23
+ hProjection[:projectionName] = 'sinusoidal'
24
+
25
+ # -> ReferenceSystemParameters.projection.longitudeOfCentralMeridian
26
+ paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection, hResponseObj)
27
+
28
+ # -> ReferenceSystemParameters.projection.falseEasting
29
+ # -> ReferenceSystemParameters.projection.falseNorthing
30
+ paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection, hResponseObj)
31
+
32
+ # verify parameter count
33
+ if paramCount == 3
34
+ return hProjection
35
+ else
36
+ hResponseObj[:readerExecutionMessages] << 'sinusoidal projection is missing one or more parameters'
37
+ return nil
38
+ end
39
+ end
40
+
41
+ return nil
42
+
43
+ end
44
+
45
+ end
46
+
47
+ end
48
+ end
49
+ end
50
+ end