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,56 @@
1
+ # Reader - fgdc to internal data structure
2
+ # unpack fgdc map projection - equidistant conic
3
+
4
+ # History:
5
+ # Stan Smith 2017-10-16 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 EquidistantConicProjection
16
+
17
+ def self.unpack(xParams, hProjection, hResponseObj)
18
+
19
+ # map projection 4.1.2.1.4 (equicon) - Equidistant Conic
20
+ unless xParams.empty?
21
+ paramCount = 0
22
+ hProjection[:projectionName] = 'equidistant conic'
23
+
24
+ # -> ReferenceSystemParameters.projection.standardParallel1
25
+ # -> ReferenceSystemParameters.projection.standardParallel2
26
+ paramCount += ProjectionCommon.unpackStandParallel(xParams, hProjection, hResponseObj)
27
+
28
+ # -> ReferenceSystemParameters.projection.longitudeOfCentralMeridian
29
+ paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection, hResponseObj)
30
+
31
+ # -> ReferenceSystemParameters.projection.latitudeOfProjectionOrigin
32
+ paramCount += ProjectionCommon.unpackLatPO(xParams, hProjection, hResponseObj)
33
+
34
+ # -> ReferenceSystemParameters.projection.falseEasting
35
+ # -> ReferenceSystemParameters.projection.falseNorthing
36
+ paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection, hResponseObj)
37
+
38
+ # verify parameter count
39
+ if paramCount == 6
40
+ return hProjection
41
+ else
42
+ hResponseObj[:readerExecutionMessages] << 'equidistant conic projection is missing one or more parameters'
43
+ return nil
44
+ end
45
+ end
46
+
47
+ return nil
48
+
49
+ end
50
+
51
+ end
52
+
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,53 @@
1
+ # Reader - fgdc to internal data structure
2
+ # unpack fgdc map projection - equirectangular
3
+
4
+ # History:
5
+ # Stan Smith 2017-10-16 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 EquirectangularProjection
16
+
17
+ def self.unpack(xParams, hProjection, hResponseObj)
18
+
19
+ # map projection 4.1.2.1.5 (equirect) - Equirectangular
20
+ unless xParams.empty?
21
+ paramCount = 0
22
+ hProjection[:projectionName] = 'equirectangular'
23
+
24
+ # -> ReferenceSystemParameters.projection.standardParallel1
25
+ paramCount += ProjectionCommon.unpackStandParallel(xParams, hProjection, hResponseObj)
26
+
27
+ # -> ReferenceSystemParameters.projection.longitudeOfCentralMeridian
28
+ paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection, hResponseObj)
29
+
30
+ # -> ReferenceSystemParameters.projection.falseEasting
31
+ # -> ReferenceSystemParameters.projection.falseNorthing
32
+ paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection, hResponseObj)
33
+
34
+ # add distance units
35
+ # verify parameter count
36
+ if paramCount == 4
37
+ return hProjection
38
+ else
39
+ hResponseObj[:readerExecutionMessages] << 'equirectangular 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,57 @@
1
+ # Reader - fgdc to internal data structure
2
+ # unpack fgdc map projection - general vertical near-side perspective projection
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 GeneralVerticalProjection
17
+
18
+ def self.unpack(xParams, hProjection, hResponseObj)
19
+
20
+ # map projection 4.1.2.1.6 (gvnsp) - General Vertical Near-sided Perspective
21
+ unless xParams.empty?
22
+ paramCount = 0
23
+ hProjection[:projectionName] = 'general vertical near-side perspective'
24
+
25
+ # -> ReferenceSystemParameters.projection.heightOfProspectivePointAboveSurface
26
+ paramCount += ProjectionCommon.unpackHeightAS(xParams, hProjection, hResponseObj)
27
+
28
+ # -> ReferenceSystemParameters.projection.longitudeOfProjectionCenter
29
+ paramCount += ProjectionCommon.unpackLongPC(xParams, hProjection, hResponseObj)
30
+
31
+ # -> ReferenceSystemParameters.projection.latitudeOfProjectionCenter
32
+ paramCount += ProjectionCommon.unpackLatPC(xParams, hProjection, hResponseObj)
33
+
34
+ # -> ReferenceSystemParameters.projection.falseEasting
35
+ # -> ReferenceSystemParameters.projection.falseNorthing
36
+ paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection, hResponseObj)
37
+
38
+ # add distance units
39
+ # verify parameter count
40
+ if paramCount == 5
41
+ return hProjection
42
+ else
43
+ hResponseObj[:readerExecutionMessages] << 'general vertical near-side perspective projection is missing one or more parameters'
44
+ return nil
45
+ end
46
+ end
47
+
48
+ return nil
49
+
50
+ end
51
+
52
+ end
53
+
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,53 @@
1
+ # Reader - fgdc to internal data structure
2
+ # unpack fgdc map projection - gnomonic projection
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 GnomonicProjection
17
+
18
+ def self.unpack(xParams, hProjection, hResponseObj)
19
+
20
+ # map projection 4.1.2.1.7 (gnomonic) - Gnomonic
21
+ unless xParams.empty?
22
+ paramCount = 0
23
+ hProjection[:projectionName] = 'gnomonic'
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] << 'gnomonic 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,57 @@
1
+ # Reader - fgdc to internal data structure
2
+ # unpack fgdc map projection - lambert conformal conic
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 LambertConicProjection
17
+
18
+ def self.unpack(xParams, hProjection, hResponseObj)
19
+
20
+ # map projection 4.1.2.1.9 (lambertc) - Lambert Conformal Conic
21
+ unless xParams.empty?
22
+ paramCount = 0
23
+ hProjection[:projectionName] = 'lambert conformal conic'
24
+
25
+ # -> ReferenceSystemParameters.projection.standardParallel1
26
+ # -> ReferenceSystemParameters.projection.standardParallel2
27
+ paramCount += ProjectionCommon.unpackStandParallel(xParams, hProjection, hResponseObj)
28
+
29
+ # -> ReferenceSystemParameters.projection.longitudeOfCentralMeridian
30
+ paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection, hResponseObj)
31
+
32
+ # -> ReferenceSystemParameters.projection.latitudeOfProjectionOrigin
33
+ paramCount += ProjectionCommon.unpackLatPO(xParams, hProjection, hResponseObj)
34
+
35
+ # -> ReferenceSystemParameters.projection.falseEasting
36
+ # -> ReferenceSystemParameters.projection.falseNorthing
37
+ paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection, hResponseObj)
38
+
39
+ # verify parameter count
40
+ if paramCount == 6
41
+ return hProjection
42
+ else
43
+ hResponseObj[:readerExecutionMessages] << 'lambert conformal conic projection is missing one or more parameters'
44
+ return nil
45
+ end
46
+ end
47
+
48
+ return nil
49
+
50
+ end
51
+
52
+ end
53
+
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,53 @@
1
+ # Reader - fgdc to internal data structure
2
+ # unpack fgdc map projection - lambert equal area projection
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 LambertEqualAreaProjection
17
+
18
+ def self.unpack(xParams, hProjection, hResponseObj)
19
+
20
+ # map projection 4.1.2.1.8 (lamberta) - Lambert Azimuthal Equal Area
21
+ unless xParams.empty?
22
+ paramCount = 0
23
+ hProjection[:projectionName] = 'lambert azimuthal equal area'
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] << 'Lambert azimuthal equal area 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,58 @@
1
+ # Reader - fgdc to internal data structure
2
+ # unpack fgdc map projection - mercator
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 MercatorProjection
17
+
18
+ def self.unpack(xParams, hProjection, hResponseObj)
19
+
20
+ # map projection 4.1.2.1.10 (mercator) - Mercator
21
+ # -> ReferenceSystemParameters.projection.[ standardParallel1 | scaleFactorAtEquator ]
22
+ unless xParams.empty?
23
+ paramCount = 0
24
+ hProjection[:projectionName] = 'mercator'
25
+
26
+ # -> ReferenceSystemParameters.projection.standardParallel1
27
+ # -> ReferenceSystemParameters.projection.standardParallel2
28
+ paramCount += ProjectionCommon.unpackStandParallel(xParams, hProjection, hResponseObj)
29
+
30
+ # -> ReferenceSystemParameters.projection.scaleFactorAtEquator
31
+ paramCount += ProjectionCommon.unpackSFEquator(xParams, hProjection, hResponseObj)
32
+
33
+ # -> ReferenceSystemParameters.projection.longitudeOfCentralMeridian
34
+ paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection, hResponseObj)
35
+
36
+ # -> ReferenceSystemParameters.projection.falseEasting
37
+ # -> ReferenceSystemParameters.projection.falseNorthing
38
+ paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection, hResponseObj)
39
+
40
+ # verify parameter count
41
+ if paramCount == 4
42
+ return hProjection
43
+ else
44
+ hResponseObj[:readerExecutionMessages] << 'mercator projection is missing one or more parameters'
45
+ return nil
46
+ end
47
+ end
48
+
49
+ return nil
50
+
51
+ end
52
+
53
+ end
54
+
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,50 @@
1
+ # Reader - fgdc to internal data structure
2
+ # unpack fgdc map projection - miller cylindrical
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 MillerCylinderProjection
17
+
18
+ def self.unpack(xParams, hProjection, hResponseObj)
19
+
20
+ # map projection 4.1.2.1.12 (miller) - Miller Cylindrical
21
+ unless xParams.empty?
22
+ paramCount = 0
23
+ hProjection[:projectionName] = 'miller cylindrical'
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] << 'miller cylindrical 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