adiwg-mdtranslator 2.7.0 → 2.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -1
  3. data/adiwg-mdtranslator.gemspec +1 -1
  4. data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +12 -6
  5. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_albers.rb +2 -1
  6. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_azimuthEquidistant.rb +2 -1
  7. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_common.rb +2 -2
  8. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_equidistantConic.rb +2 -1
  9. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_equirectangular.rb +2 -1
  10. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_generalVertical.rb +2 -1
  11. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_gnomonic.rb +2 -1
  12. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_lambertConic.rb +2 -1
  13. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_lambertEqualArea.rb +2 -1
  14. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_mercator.rb +2 -1
  15. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_millerCylinder.rb +2 -1
  16. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_modifiedAlaska.rb +2 -1
  17. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_obliqueMercator.rb +2 -1
  18. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_orthographic.rb +2 -1
  19. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_parameters.rb +2 -1
  20. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_polarStereo.rb +2 -1
  21. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_polyconic.rb +2 -1
  22. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_robinson.rb +2 -1
  23. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_sinusoidal.rb +2 -1
  24. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_spaceOblique.rb +2 -1
  25. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_stereographic.rb +2 -1
  26. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_transverseMercator.rb +2 -1
  27. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_vanDerGrinten.rb +2 -1
  28. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_geodeticReference.rb +82 -0
  29. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_geographicResolution.rb +57 -0
  30. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_horizontalPlanar.rb +2 -2
  31. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_horizontalReference.rb +12 -113
  32. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_keyword.rb +9 -27
  33. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_localSystem.rb +53 -0
  34. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapCoordinateInfo.rb +1 -0
  35. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapGridSystem.rb +27 -15
  36. data/lib/adiwg/mdtranslator/readers/fgdc/modules/{module_mapLocalSystem.rb → module_mapLocalPlanar.rb} +3 -14
  37. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_spatialReference.rb +1 -1
  38. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonSystem.rb +1 -1
  39. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_verticalAltitude.rb +4 -6
  40. data/lib/adiwg/mdtranslator/readers/fgdc/modules/{module_verticalReference.rb → module_verticalDatum.rb} +0 -0
  41. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_verticalDepth.rb +4 -7
  42. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geodetic.rb +95 -0
  43. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_keyword.rb +1 -14
  44. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_projectionParameters.rb +29 -8
  45. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_referenceSystemParameters.rb +5 -5
  46. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceInfo.rb +15 -3
  47. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_spatialReference.rb +16 -4
  48. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_verticalDatum.rb +8 -23
  49. data/lib/adiwg/mdtranslator/readers/sbJson/modules/module_tag.rb +2 -2
  50. data/lib/adiwg/mdtranslator/version.rb +4 -1
  51. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_citation.rb +1 -0
  52. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dateRange.rb +6 -1
  53. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dateSingle.rb +5 -1
  54. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_fgdc.rb +18 -5
  55. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geodeticReference.rb +62 -0
  56. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geographicResolution.rb +56 -0
  57. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_keyword.rb +1 -0
  58. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_localSystem.rb +45 -0
  59. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_mapCoordinateInfo.rb +167 -0
  60. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_mapProjection.rb +374 -0
  61. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarReference.rb +372 -0
  62. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_process.rb +1 -0
  63. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialReference.rb +134 -0
  64. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomySystem.rb +8 -11
  65. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_timePeriod.rb +8 -8
  66. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_verticalDatum.rb +120 -0
  67. data/lib/adiwg/mdtranslator/writers/html/sections/html_body.rb +12 -2
  68. data/lib/adiwg/mdtranslator/writers/html/sections/html_geodeticParameters.rb +85 -0
  69. data/lib/adiwg/mdtranslator/writers/html/sections/html_keyword.rb +5 -1
  70. data/lib/adiwg/mdtranslator/writers/html/sections/html_projectionParameters.rb +36 -15
  71. data/lib/adiwg/mdtranslator/writers/html/sections/html_referenceSystemParameters.rb +6 -6
  72. data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceInfo.rb +1 -2
  73. data/lib/adiwg/mdtranslator/writers/html/sections/html_verticalDatumParameters.rb +7 -0
  74. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_crs.rb +21 -8
  75. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataIdentification.rb +332 -321
  76. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_keyword.rb +8 -8
  77. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_projectionParameters.rb +1 -1
  78. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_geodeticParameters.rb +34 -0
  79. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_projectionParameters.rb +5 -2
  80. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_spatialReference.rb +1 -0
  81. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_spatialReferenceParameters.rb +2 -2
  82. data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_tag.rb +1 -1
  83. metadata +20 -9
  84. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_ellipsoid.rb +0 -78
  85. data/lib/adiwg/mdtranslator/writers/html/sections/html_ellipsoidParameters.rb +0 -68
  86. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_ellipsoidParameters.rb +0 -32
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f63c2f64b279e4dbd888fe4af191291d692440e9
4
- data.tar.gz: 37fdda4ca201df46a93d611d8ef3d639cfc684d2
3
+ metadata.gz: b8967380488c638b7c04f98f0fd3d51d68bccf9a
4
+ data.tar.gz: 695fbc3cff2ddf09eda1fabcba0478c035d5a990
5
5
  SHA512:
6
- metadata.gz: 9bb5674e9a1e307c07826358dcde39452219c9b415e2cb8b4c4873340863b8802f10d38c29964cf9dc77ae90f0dce3457b2769fba833e85a958743fc00b477e1
7
- data.tar.gz: 90e071925c75844fe2203b6177ffc752e91bae66e4f35502c47a4908d8e2a1eefeff68023f49a67153f7cbc52d858c5f92f8c2704618739845e6ae0eed4857d8
6
+ metadata.gz: 25f1962901b59cd7c317ab6d1c70d88362fa8a1018a98ff55fcc9311d243b8152132f2779f38c8ed7ac32de3f40a14c0eb612942f1adb7a65a4dca5042cfa26a
7
+ data.tar.gz: fc110571208fd0f094ddb53a31a42b204a6d655dfa1bf7a603a6f267022f62bea71b9269734b7c3eac190cbe348577ee25d2a0514b4552bb930340f50680626f
data/CHANGELOG.md CHANGED
@@ -1,7 +1,24 @@
1
1
  # Change Log
2
2
 
3
- ## [v2.7.0](https://github.com/adiwg/mdTranslator/tree/v2.7.0)
3
+ ## [v2.8.0](https://github.com/adiwg/mdTranslator/tree/v2.8.0)
4
4
 
5
+ [Full Changelog](https://github.com/adiwg/mdTranslator/compare/v2.7.0...v2.8.0)
6
+
7
+ **Implemented enhancements:**
8
+
9
+ - Add resource citation title to HTML heading [\#172](https://github.com/adiwg/mdTranslator/issues/172)
10
+
11
+ **Fixed bugs:**
12
+
13
+ - FGDC writer outputs time in ISO format [\#176](https://github.com/adiwg/mdTranslator/issues/176)
14
+ - FGDC writer time-currentness tag is in wrong location [\#173](https://github.com/adiwg/mdTranslator/issues/173)
15
+ - ISO Topic Category keywords not translated [\#171](https://github.com/adiwg/mdTranslator/issues/171)
16
+
17
+ **Merged pull requests:**
18
+
19
+ - Add spatial resolution section and various patches to FGDC writer beta release [\#179](https://github.com/adiwg/mdTranslator/pull/179) ([stansmith907](https://github.com/stansmith907))
20
+
21
+ ## [v2.7.0](https://github.com/adiwg/mdTranslator/tree/v2.7.0) (2017-12-29)
5
22
  [Full Changelog](https://github.com/adiwg/mdTranslator/compare/v2.6.1...v2.7.0)
6
23
 
7
24
  **Merged pull requests:**
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
34
34
  spec.add_runtime_dependency "uuidtools", "~> 2.1"
35
35
  spec.add_runtime_dependency "json-schema", "~> 2.7"
36
36
  spec.add_runtime_dependency "adiwg-mdjson_schemas", ">= 2.4.1"
37
- spec.add_runtime_dependency "adiwg-mdcodes", "~> 2.3.2"
37
+ spec.add_runtime_dependency "adiwg-mdcodes", "~> 2.4.0"
38
38
  spec.add_runtime_dependency "jbuilder", "~> 2.5"
39
39
  spec.add_runtime_dependency "kramdown", "~> 1.13"
40
40
  spec.add_runtime_dependency "coderay", "~> 1.1"
@@ -256,7 +256,6 @@ class InternalMetadata
256
256
  credits: [],
257
257
  timePeriod: {},
258
258
  status: [],
259
- topicCategories: [],
260
259
  pointOfContacts: [],
261
260
  spatialReferenceSystems: [],
262
261
  spatialRepresentationTypes: [],
@@ -814,6 +813,7 @@ class InternalMetadata
814
813
  {
815
814
  systemType: nil,
816
815
  systemIdentifier: {},
816
+ systemWKT: nil,
817
817
  systemParameterSet: {}
818
818
  }
819
819
  end
@@ -821,7 +821,7 @@ class InternalMetadata
821
821
  def newReferenceSystemParameterSet
822
822
  {
823
823
  projection: {},
824
- ellipsoid: {},
824
+ geodetic: {},
825
825
  verticalDatum: {}
826
826
  }
827
827
  end
@@ -829,8 +829,11 @@ class InternalMetadata
829
829
  def newProjection
830
830
  {
831
831
  projectionIdentifier: {},
832
+ gridSystem: nil,
833
+ gridSystemName: nil,
834
+ gridZone: nil,
835
+ projection: nil,
832
836
  projectionName: nil,
833
- zone: nil,
834
837
  standardParallel1: nil,
835
838
  standardParallel2: nil,
836
839
  longitudeOfCentralMeridian: nil,
@@ -853,8 +856,8 @@ class InternalMetadata
853
856
  landsatPath: nil,
854
857
  localPlanarDescription: nil,
855
858
  localPlanarGeoreference: nil,
856
- otherProjectionDescription: nil,
857
- otherGridDescription: nil
859
+ otherGridDescription: nil,
860
+ otherProjectionDescription: nil
858
861
  }
859
862
  end
860
863
 
@@ -865,8 +868,10 @@ class InternalMetadata
865
868
  }
866
869
  end
867
870
 
868
- def newEllipsoid
871
+ def newGeodetic
869
872
  {
873
+ datumIdentifier: {},
874
+ datumName: nil,
870
875
  ellipsoidIdentifier: {},
871
876
  ellipsoidName: nil,
872
877
  semiMajorAxis: nil,
@@ -924,6 +929,7 @@ class InternalMetadata
924
929
  def newVerticalDatum
925
930
  {
926
931
  datumIdentifier: {},
932
+ datumName: nil,
927
933
  isDepthSystem: false,
928
934
  encodingMethod: nil,
929
935
  verticalResolution: nil,
@@ -20,7 +20,8 @@ module ADIWG
20
20
  # map projection 4.1.2.1.2 (albers) - Albers Conical Equal Area
21
21
  unless xParams.empty?
22
22
  paramCount = 0
23
- hProjection[:projectionName] = 'albers'
23
+ hProjection[:projection] = 'albers'
24
+ hProjection[:projectionName] = 'Albers Conical Equal Area'
24
25
 
25
26
  # -> ReferenceSystemParameters.projection.standardParallel1
26
27
  # -> ReferenceSystemParameters.projection.standardParallel2
@@ -20,7 +20,8 @@ module ADIWG
20
20
  # map projection 4.1.2.1.3 (azimequi) - Azimuthal Equidistant
21
21
  unless xParams.empty?
22
22
  paramCount = 0
23
- hProjection[:projectionName] = 'azimuthal equidistant'
23
+ hProjection[:projection] = 'azimuthalEquidistant'
24
+ hProjection[:projectionName] = 'Azimuthal Equidistant'
24
25
 
25
26
  # -> ReferenceSystemParameters.projection.longitudeOfCentralMeridian
26
27
  paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection, hResponseObj)
@@ -149,12 +149,12 @@ module ADIWG
149
149
  xObliqueLA = xParams.xpath('./obqlazim')
150
150
  unless xObliqueLA.empty?
151
151
  paramCount = 0
152
- lineAzimuth = xObliqueLA.xpath('./asimangl').text
152
+ lineAzimuth = xObliqueLA.xpath('./azimangl').text
153
153
  unless lineAzimuth.empty?
154
154
  hProjection[:azimuthAngle] = lineAzimuth.to_f
155
155
  paramCount += 1
156
156
  end
157
- lineLong = xObliqueLA.xpath('./asimptl').text
157
+ lineLong = xObliqueLA.xpath('./azimptl').text
158
158
  unless lineLong.empty?
159
159
  hProjection[:azimuthMeasurePointLongitude] = lineLong.to_f
160
160
  paramCount += 1
@@ -19,7 +19,8 @@ module ADIWG
19
19
  # map projection 4.1.2.1.4 (equicon) - Equidistant Conic
20
20
  unless xParams.empty?
21
21
  paramCount = 0
22
- hProjection[:projectionName] = 'equidistant conic'
22
+ hProjection[:projection] = 'equidistantConic'
23
+ hProjection[:projectionName] = 'Equidistant Conic'
23
24
 
24
25
  # -> ReferenceSystemParameters.projection.standardParallel1
25
26
  # -> ReferenceSystemParameters.projection.standardParallel2
@@ -19,7 +19,8 @@ module ADIWG
19
19
  # map projection 4.1.2.1.5 (equirect) - Equirectangular
20
20
  unless xParams.empty?
21
21
  paramCount = 0
22
- hProjection[:projectionName] = 'equirectangular'
22
+ hProjection[:projection] = 'equirectangular'
23
+ hProjection[:projectionName] = 'Equirectangular'
23
24
 
24
25
  # -> ReferenceSystemParameters.projection.standardParallel1
25
26
  paramCount += ProjectionCommon.unpackStandParallel(xParams, hProjection, hResponseObj)
@@ -20,7 +20,8 @@ module ADIWG
20
20
  # map projection 4.1.2.1.6 (gvnsp) - General Vertical Near-sided Perspective
21
21
  unless xParams.empty?
22
22
  paramCount = 0
23
- hProjection[:projectionName] = 'general vertical near-side perspective'
23
+ hProjection[:projection] = 'generalVertical'
24
+ hProjection[:projectionName] = 'General Vertical Near-sided Perspective'
24
25
 
25
26
  # -> ReferenceSystemParameters.projection.heightOfProspectivePointAboveSurface
26
27
  paramCount += ProjectionCommon.unpackHeightAS(xParams, hProjection, hResponseObj)
@@ -20,7 +20,8 @@ module ADIWG
20
20
  # map projection 4.1.2.1.7 (gnomonic) - Gnomonic
21
21
  unless xParams.empty?
22
22
  paramCount = 0
23
- hProjection[:projectionName] = 'gnomonic'
23
+ hProjection[:projection] = 'gnomonic'
24
+ hProjection[:projectionName] = 'Gnomonic'
24
25
 
25
26
  # -> ReferenceSystemParameters.projection.longitudeOfProjectionCenter
26
27
  paramCount += ProjectionCommon.unpackLongPC(xParams, hProjection, hResponseObj)
@@ -20,7 +20,8 @@ module ADIWG
20
20
  # map projection 4.1.2.1.9 (lambertc) - Lambert Conformal Conic
21
21
  unless xParams.empty?
22
22
  paramCount = 0
23
- hProjection[:projectionName] = 'lambert conformal conic'
23
+ hProjection[:projection] = 'lambertConic'
24
+ hProjection[:projectionName] = 'Lambert Conformal Conic'
24
25
 
25
26
  # -> ReferenceSystemParameters.projection.standardParallel1
26
27
  # -> ReferenceSystemParameters.projection.standardParallel2
@@ -20,7 +20,8 @@ module ADIWG
20
20
  # map projection 4.1.2.1.8 (lamberta) - Lambert Azimuthal Equal Area
21
21
  unless xParams.empty?
22
22
  paramCount = 0
23
- hProjection[:projectionName] = 'lambert azimuthal equal area'
23
+ hProjection[:projection] = 'lambertEqualArea'
24
+ hProjection[:projectionName] = 'Lambert Azimuthal Equal Area'
24
25
 
25
26
  # -> ReferenceSystemParameters.projection.longitudeOfProjectionCenter
26
27
  paramCount += ProjectionCommon.unpackLongPC(xParams, hProjection, hResponseObj)
@@ -21,7 +21,8 @@ module ADIWG
21
21
  # -> ReferenceSystemParameters.projection.[ standardParallel1 | scaleFactorAtEquator ]
22
22
  unless xParams.empty?
23
23
  paramCount = 0
24
- hProjection[:projectionName] = 'mercator'
24
+ hProjection[:projection] = 'mercator'
25
+ hProjection[:projectionName] = 'Mercator'
25
26
 
26
27
  # -> ReferenceSystemParameters.projection.standardParallel1
27
28
  # -> ReferenceSystemParameters.projection.standardParallel2
@@ -20,7 +20,8 @@ module ADIWG
20
20
  # map projection 4.1.2.1.12 (miller) - Miller Cylindrical
21
21
  unless xParams.empty?
22
22
  paramCount = 0
23
- hProjection[:projectionName] = 'miller cylindrical'
23
+ hProjection[:projection] = 'miller'
24
+ hProjection[:projectionName] = 'Miller Cylindrical'
24
25
 
25
26
  # -> ReferenceSystemParameters.projection.longitudeOfCentralMeridian
26
27
  paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection, hResponseObj)
@@ -20,7 +20,8 @@ module ADIWG
20
20
  # map projection 4.1.2.1.11 (modsak) - Modified Stereographic for Alaska
21
21
  unless xParams.empty?
22
22
  paramCount = 0
23
- hProjection[:projectionName] = 'alaska modified stereographic'
23
+ hProjection[:projection] = 'alaska'
24
+ hProjection[:projectionName] = 'Modified Stereographic for Alaska'
24
25
 
25
26
  # -> ReferenceSystemParameters.projection.falseEasting
26
27
  # -> ReferenceSystemParameters.projection.falseNorthing
@@ -20,7 +20,8 @@ module ADIWG
20
20
  # map projection 4.1.2.1.13 (obqmerc) - Oblique Mercator
21
21
  unless xParams.empty?
22
22
  paramCount = 0
23
- hProjection[:projectionName] = 'oblique mercator'
23
+ hProjection[:projection] = 'obliqueMercator'
24
+ hProjection[:projectionName] = 'Oblique Mercator'
24
25
 
25
26
  # -> ReferenceSystemParameters.projection.scaleFactorAtCenterLine
26
27
  paramCount += ProjectionCommon.unpackSFCenter(xParams, hProjection, hResponseObj)
@@ -20,7 +20,8 @@ module ADIWG
20
20
  # map projection 4.1.2.1.14 (orthogr) - Orthographic
21
21
  unless xParams.empty?
22
22
  paramCount = 0
23
- hProjection[:projectionName] = 'orthographic'
23
+ hProjection[:projection] = 'orthographic'
24
+ hProjection[:projectionName] = 'Orthographic'
24
25
 
25
26
  # -> ReferenceSystemParameters.projection.longitudeOfProjectionCenter
26
27
  paramCount += ProjectionCommon.unpackLongPC(xParams, hProjection, hResponseObj)
@@ -18,7 +18,8 @@ module ADIWG
18
18
 
19
19
  # map projection 4.1.2.1.23 (mapprojp) - projection parameter set
20
20
  unless xParams.empty?
21
- hProjection[:projectionName] = 'projection parameters'
21
+ hProjection[:projection] = 'parameters'
22
+ hProjection[:projectionName] = 'Projection Parameter Set'
22
23
 
23
24
  # -> ReferenceSystemParameters.projection.standardParallel1
24
25
  # -> ReferenceSystemParameters.projection.standardParallel2
@@ -20,7 +20,8 @@ module ADIWG
20
20
  # map projection 4.1.2.1.15 (polarst) - Polar Stereographic
21
21
  unless xParams.empty?
22
22
  paramCount = 0
23
- hProjection[:projectionName] = 'polar stereographic'
23
+ hProjection[:projection] = 'polarStereo'
24
+ hProjection[:projectionName] = 'Polar Stereographic'
24
25
 
25
26
  # -> ReferenceSystemParameters.projection.straightVerticalLongitudeFromPole
26
27
  paramCount += ProjectionCommon.unpackVSLong(xParams, hProjection, hResponseObj)
@@ -20,7 +20,8 @@ module ADIWG
20
20
  # map projection 4.1.2.1.16 (polycon) - Polyconic
21
21
  unless xParams.empty?
22
22
  paramCount = 0
23
- hProjection[:projectionName] = 'polyconic'
23
+ hProjection[:projection] = 'polyconic'
24
+ hProjection[:projectionName] = 'Polyconic'
24
25
 
25
26
  # -> ReferenceSystemParameters.projection.longitudeOfCentralMeridian
26
27
  paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection, hResponseObj)
@@ -20,7 +20,8 @@ module ADIWG
20
20
  # map projection 4.1.2.1.17 (robinson) - Robinson
21
21
  unless xParams.empty?
22
22
  paramCount = 0
23
- hProjection[:projectionName] = 'robinson'
23
+ hProjection[:projection] = 'robinson'
24
+ hProjection[:projectionName] = 'Robinson'
24
25
 
25
26
  # -> ReferenceSystemParameters.projection.longitudeOfProjectionCenter
26
27
  paramCount += ProjectionCommon.unpackLongPC(xParams, hProjection, hResponseObj)
@@ -20,7 +20,8 @@ module ADIWG
20
20
  # map projection 4.1.2.1.18 (sinusoid) - Sinusoidal
21
21
  unless xParams.empty?
22
22
  paramCount = 0
23
- hProjection[:projectionName] = 'sinusoidal'
23
+ hProjection[:projection] = 'sinusoidal'
24
+ hProjection[:projectionName] = 'Sinusoidal'
24
25
 
25
26
  # -> ReferenceSystemParameters.projection.longitudeOfCentralMeridian
26
27
  paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection, hResponseObj)
@@ -20,7 +20,8 @@ module ADIWG
20
20
  # map projection 4.1.2.1.19 (spaceobq) - Space Oblique Mercator (Landsat)
21
21
  unless xParams.empty?
22
22
  paramCount = 0
23
- hProjection[:projectionName] = 'space oblique'
23
+ hProjection[:projection] = 'spaceOblique'
24
+ hProjection[:projectionName] = 'Space Oblique Mercator (Landsat)'
24
25
 
25
26
  # -> ReferenceSystemParameters.projection.landsatNumber
26
27
  paramCount += ProjectionCommon.unpackLandSat(xParams, hProjection, hResponseObj)
@@ -20,7 +20,8 @@ module ADIWG
20
20
  # map projection 4.1.2.1.20 (stereo) - Stereographic
21
21
  unless xParams.empty?
22
22
  paramCount = 0
23
- hProjection[:projectionName] = 'stereographic'
23
+ hProjection[:projection] = 'stereographic'
24
+ hProjection[:projectionName] = 'Stereographic'
24
25
 
25
26
  # -> ReferenceSystemParameters.projection.longitudeOfProjectionCenter
26
27
  paramCount += ProjectionCommon.unpackLongPC(xParams, hProjection, hResponseObj)
@@ -19,7 +19,8 @@ module ADIWG
19
19
  # map projection 4.1.2.1.21 (transmer) - Transverse Mercator
20
20
  unless xParams.empty?
21
21
  paramCount = 0
22
- hProjection[:projectionName] = 'transverse mercator'
22
+ hProjection[:projection] = 'transverseMercator'
23
+ hProjection[:projectionName] = 'Transverse Mercator'
23
24
 
24
25
  # -> ReferenceSystemParameters.projection.scaleFactorAtCentralMeridian
25
26
  paramCount += ProjectionCommon.unpackSFCM(xParams, hProjection, hResponseObj)
@@ -19,7 +19,8 @@ module ADIWG
19
19
  # map projection 4.1.2.1.22 (vdgrin) - van der Grinten
20
20
  unless xParams.empty?
21
21
  paramCount = 0
22
- hProjection[:projectionName] = 'van der grinten'
22
+ hProjection[:projection] = 'grinten'
23
+ hProjection[:projectionName] = 'van der Grinten'
23
24
 
24
25
  # -> ReferenceSystemParameters.projection.longitudeOfCentralMeridian
25
26
  paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection, hResponseObj)
@@ -0,0 +1,82 @@
1
+ # Reader - fgdc to internal data structure
2
+ # unpack fgdc horizontal data geodetic reference
3
+
4
+ # History:
5
+ # Stan Smith 2017-12-29 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 GeodeticReference
16
+
17
+ def self.unpack(xHorizontalRef)
18
+
19
+ # instance classes needed in script
20
+ intMetadataClass = InternalMetadata.new
21
+
22
+ hGeodetic = intMetadataClass.newGeodetic
23
+ xGeodetic = xHorizontalRef.xpath('./geodetic')
24
+
25
+ # geodetic model 4.1.4.1 (horizdn) - horizontal datum name
26
+ # -> referenceSystemParameters.geodetic.datumName
27
+ datumName = xGeodetic.xpath('./horizdn').text
28
+ unless datumName.empty?
29
+ hGeodetic[:datumName] = datumName
30
+ end
31
+
32
+ # geodetic model 4.1.4.2 (ellips) - ellipsoid name
33
+ # -> referenceSystemParameters.geodetic.ellipsoidName
34
+ ellipsoidName = xGeodetic.xpath('./ellips').text
35
+ unless ellipsoidName.empty?
36
+ hGeodetic[:ellipsoidName] = ellipsoidName
37
+ end
38
+
39
+ # geodetic model 4.1.4.3 (semiaxis) - semi-major axis
40
+ # -> referenceSystemParameters.geodetic.semiMajorAxis
41
+ semiAxis = xGeodetic.xpath('./semiaxis').text
42
+ unless semiAxis.empty?
43
+ hGeodetic[:semiMajorAxis] = semiAxis.to_f
44
+ end
45
+
46
+ # geodetic model 4.1.2.4.4 (plandu) - distance units
47
+ # take value from the first 'planar' section with 'plandu' specified
48
+ axPlanar = xHorizontalRef.xpath('./planar')
49
+ unless axPlanar.empty?
50
+ axPlanar.each do |xPlanar|
51
+ xPlanCI = xPlanar.xpath('./planci')
52
+ unless xPlanCI.empty?
53
+ units = xPlanCI.xpath('./plandu').text
54
+ unless units.empty?
55
+ hGeodetic[:axisUnits] = units
56
+ end
57
+ end
58
+ end
59
+ end
60
+
61
+ # geodetic model 4.1.4.4 (denflat) - denominator of flattening ratio
62
+ # -> referenceSystemParameters.geodetic.denominatorOfFlatteningRatio
63
+ flattening = xGeodetic.xpath('./denflat').text
64
+ unless flattening.empty?
65
+ hGeodetic[:denominatorOfFlatteningRatio] = flattening.to_f
66
+ end
67
+
68
+ hReferenceSystem = intMetadataClass.newSpatialReferenceSystem
69
+ hSystemParameters = intMetadataClass.newReferenceSystemParameterSet
70
+ hSystemParameters[:geodetic] = hGeodetic
71
+ hReferenceSystem[:systemParameterSet] = hSystemParameters
72
+
73
+ return hReferenceSystem
74
+
75
+ end
76
+
77
+ end
78
+
79
+ end
80
+ end
81
+ end
82
+ end