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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d2e846bab923dba1c4af51d308e33eb83ae5ea96
4
- data.tar.gz: bbb0ab9ad5191e0dc43cf2889594d44ca31bdb08
3
+ metadata.gz: f6314a8f43eb42ada37a556d73c9fbd0a76d46eb
4
+ data.tar.gz: 34fade7d3ac05ab024a601b899e3734ec4a72d31
5
5
  SHA512:
6
- metadata.gz: 76dc16abf989aba99ec3775be2e6f59344d41ec74759d7392f3309343de73443bdc61a9615c7b1933bb6605ab03b47a9a04031d2713d97f9a42e5186bba8b757
7
- data.tar.gz: 99126f4e0bafae3d8118889f18216c1c70a45f3c886281fafda0a2b70086de8bf9cd4b058c8843dc44fff7e651706015fbb067f04964520105c99a4f166e78d3
6
+ metadata.gz: e28c20ccb05a1e42cbfea51404301f8451fb0367e024c7877714edc7bd42e3628c030936d03116b4d774c2715e820a279d1ad0e26118309fefbc65bbae80e63a
7
+ data.tar.gz: b49985b384314529c11c69cda56848e1087a20cba33fbb8ff240d0cbbf9f6dbe75e503358f4d5474ff6e1b036739816e45acf7c014b1d5eaa5b0f1a6086a6499
data/.travis.yml CHANGED
@@ -3,9 +3,9 @@ sudo: false
3
3
  language: ruby
4
4
  before_install: 'gem install bundler'
5
5
  rvm:
6
- - 2.2
7
- - "2.3.3"
8
- - "2.4.0"
6
+ - "2.3"
7
+ - "2.4"
8
+ - "2.5"
9
9
  - jruby-head
10
10
  - ruby-head
11
11
  matrix:
data/CHANGELOG.md CHANGED
@@ -1,12 +1,19 @@
1
1
  # Change Log
2
2
 
3
- ## [v2.13.3](https://github.com/adiwg/mdTranslator/tree/v2.13.3)
3
+ ## [v2.14.0](https://github.com/adiwg/mdTranslator/tree/v2.14.0)
4
4
 
5
- [Full Changelog](https://github.com/adiwg/mdTranslator/compare/v2.13.2...v2.13.3)
5
+ [Full Changelog](https://github.com/adiwg/mdTranslator/compare/v2.13.3...v2.14.0)
6
6
 
7
- **Fixed bugs:**
7
+ **Closed issues:**
8
+
9
+ - Breaking change in timeInterval [\#199](https://github.com/adiwg/mdTranslator/issues/199)
8
10
 
9
- - sbJSON contacts inherited from associated records [\#202](https://github.com/adiwg/mdTranslator/issues/202)
11
+ **Merged pull requests:**
12
+
13
+ - Change error message text in ISO 19115-2 writer [\#204](https://github.com/adiwg/mdTranslator/pull/204) ([stansmith907](https://github.com/stansmith907))
14
+
15
+ ## [v2.13.3](https://github.com/adiwg/mdTranslator/tree/v2.13.3) (2018-09-06)
16
+ [Full Changelog](https://github.com/adiwg/mdTranslator/compare/v2.13.2...v2.13.3)
10
17
 
11
18
  **Closed issues:**
12
19
 
data/Rakefile CHANGED
@@ -5,15 +5,15 @@ require 'rake/testtask'
5
5
  Rake::TestTask.new do |t|
6
6
  t.libs << 'test'
7
7
  t.test_files = FileList[
8
+ 'test/readers/fgdc/tc*.rb',
8
9
  'test/readers/mdJson/tc*.rb',
9
10
  'test/readers/sbJson/tc*.rb',
10
- 'test/readers/fgdc/tc*.rb',
11
- 'test/writers/iso19115-2/tc*.rb',
11
+ 'test/writers/fgdc/tc*.rb',
12
+ 'test/writers/html/tc*.rb',
12
13
  'test/writers/iso19110/tc*.rb',
14
+ 'test/writers/iso19115-2/tc*.rb',
13
15
  'test/writers/mdJson/tc*.rb',
14
16
  'test/writers/sbJson/tc*.rb',
15
- 'test/writers/html/tc*.rb',
16
- 'test/writers/fgdc/tc*.rb',
17
17
  'test/translator/tc*.rb'
18
18
  ]
19
19
  t.verbose = true
@@ -22,13 +22,13 @@ end
22
22
  desc 'Run tests'
23
23
  task :default => :test
24
24
 
25
- # 'test/readers/mdJson/tc*.rb'
26
- # 'test/readers/sbJson/tc*.rb',
27
- # 'test/readers/fgdc/tc*.rb',
28
- # 'test/writers/iso19115-2/tc*.rb',
29
- # 'test/writers/iso19110/tc*.rb',
30
- # 'test/writers/mdJson/tc*.rb',
31
- # 'test/writers/sbJson/tc*.rb',
32
- # 'test/writers/html/tc*.rb',
33
- # 'test/writers/fgdc/tc*.rb',
34
- # 'test/translator/tc*.rb'
25
+ # 'test/readers/fgdc/tc*.rb',
26
+ # 'test/readers/mdJson/tc*.rb',
27
+ # 'test/readers/sbJson/tc*.rb',
28
+ # 'test/writers/fgdc/tc*.rb',
29
+ # 'test/writers/html/tc*.rb',
30
+ # 'test/writers/iso19110/tc*.rb',
31
+ # 'test/writers/iso19115-2/tc*.rb',
32
+ # 'test/writers/mdJson/tc*.rb',
33
+ # 'test/writers/sbJson/tc*.rb',
34
+ # 'test/translator/tc*.rb'
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.test_files = spec.files.grep(%r{^(tc|test|spec|features)/})
23
23
  spec.require_paths = ["lib"]
24
24
 
25
- spec.required_ruby_version = '>= 2.2'
25
+ spec.required_ruby_version = '>= 2.3'
26
26
 
27
27
  spec.add_development_dependency "bundler", "~> 1"
28
28
  spec.add_development_dependency "rake", "~> 10"
@@ -33,8 +33,8 @@ Gem::Specification.new do |spec|
33
33
  spec.add_runtime_dependency "thor", "~> 0.19"
34
34
  spec.add_runtime_dependency "uuidtools", "~> 2.1"
35
35
  spec.add_runtime_dependency "json-schema", "~> 2.7"
36
- spec.add_runtime_dependency "adiwg-mdjson_schemas", ">= 2.4.9"
37
- spec.add_runtime_dependency "adiwg-mdcodes", "~> 2.6.3"
36
+ spec.add_runtime_dependency "adiwg-mdjson_schemas", ">= 2.6"
37
+ spec.add_runtime_dependency "adiwg-mdcodes", "~> 2.7"
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"
@@ -2,6 +2,8 @@
2
2
 
3
3
  # History:
4
4
  # version 2
5
+ # Stan Smith 2018-10-02 modified referenceSystemParameterSet
6
+ # Stan Smith 2018-10-02 added local reference system
5
7
  # Stan Smith 2017-09-28 add altitude to bounding box for fgdc
6
8
  # Stan Smith 2017-09-28 add description to geographicExtent for fgdc
7
9
  # Stan Smith 2017-04-22 removed 'intObj = ' from new object definitions
@@ -848,11 +850,8 @@ class InternalMetadata
848
850
  def newProjection
849
851
  {
850
852
  projectionIdentifier: {},
851
- gridSystem: nil,
852
- gridSystemName: nil,
853
+ gridIdentifier: {},
853
854
  gridZone: nil,
854
- projection: nil,
855
- projectionName: nil,
856
855
  standardParallel1: nil,
857
856
  standardParallel2: nil,
858
857
  longitudeOfCentralMeridian: nil,
@@ -873,26 +872,21 @@ class InternalMetadata
873
872
  obliqueLinePoints: [],
874
873
  landsatNumber: nil,
875
874
  landsatPath: nil,
876
- localPlanarDescription: nil,
877
- localPlanarGeoreference: nil,
878
- otherGridDescription: nil,
879
- otherProjectionDescription: nil
875
+ local: {}
880
876
  }
881
877
  end
882
878
 
883
879
  def newObliqueLinePoint
884
880
  {
885
- azimuthLineLatitude: nil,
886
- azimuthLineLongitude: nil
881
+ obliqueLineLatitude: nil,
882
+ obliqueLineLongitude: nil
887
883
  }
888
884
  end
889
885
 
890
886
  def newGeodetic
891
887
  {
892
888
  datumIdentifier: {},
893
- datumName: nil,
894
889
  ellipsoidIdentifier: {},
895
- ellipsoidName: nil,
896
890
  semiMajorAxis: nil,
897
891
  axisUnits: nil,
898
892
  denominatorOfFlatteningRatio: nil
@@ -902,13 +896,19 @@ class InternalMetadata
902
896
  def newVerticalDatum
903
897
  {
904
898
  datumIdentifier: {},
905
- datumName: nil,
906
899
  isDepthSystem: false,
907
900
  encodingMethod: nil,
908
901
  verticalResolution: nil,
909
902
  unitOfMeasure: nil
910
903
  }
904
+ end
911
905
 
906
+ def newLocal
907
+ {
908
+ description: nil,
909
+ georeference: nil,
910
+ fixedToEarth: true
911
+ }
912
912
  end
913
913
 
914
914
 
@@ -1038,7 +1038,7 @@ class InternalMetadata
1038
1038
  idProcedure: nil,
1039
1039
  idCompleteness: nil,
1040
1040
  vouchers: [],
1041
- taxonClass: {}
1041
+ taxonClasses: []
1042
1042
  }
1043
1043
  end
1044
1044
 
@@ -0,0 +1,69 @@
1
+ # Reader - fgdc to internal data structure
2
+ # unpack fgdc map grid coordinate system
3
+
4
+ # History:
5
+ # Stan Smith 2018-10-04 original script
6
+
7
+ require 'nokogiri'
8
+ require_relative '../mapProjections/projection_equirectangular'
9
+ require_relative '../mapProjections/projection_azimuthEquidistant'
10
+
11
+ module ADIWG
12
+ module Mdtranslator
13
+ module Readers
14
+ module Fgdc
15
+
16
+ module MapGridEqualArcSecond
17
+
18
+ def self.unpack(xArc, hProjection, hResponseObj)
19
+
20
+ # grid system 4.1.2.2.5 (arcsys) - equal arc-second coordinate system
21
+
22
+ hGridSystemId = hProjection[:gridIdentifier]
23
+ hProjectionId = hProjection[:projectionIdentifier]
24
+
25
+ hGridSystemId[:identifier] = 'arcsys'
26
+ hGridSystemId[:name] = 'Equal Arc-Second Coordinate System' if hGridSystemId[:name].nil?
27
+
28
+ # grid system 4.1.2.2.5.1 (arcszone) - state plane zone number {1..18} (required)
29
+ # -> ReferenceSystemParameters.projection.gridZone
30
+ zone = xArc.xpath('./arczone').text
31
+ unless zone.empty?
32
+ hProjection[:gridZone] = zone
33
+ end
34
+ if zone.empty?
35
+ hResponseObj[:readerExecutionMessages] <<
36
+ 'WARNING: FGDC reader: equal arc-second zone number is missing'
37
+ end
38
+
39
+ # + [ equirectangular | azimuthal equidistant ] (required)
40
+ # + equirectangular
41
+ xEquiR = xArc.xpath('./equirect')
42
+ unless xEquiR.empty?
43
+ hProjectionId[:identifier] = 'equirectangular'
44
+ hProjectionId[:name] = 'Equirectangular'
45
+ return EquirectangularProjection.unpack(xEquiR, hProjection, hResponseObj)
46
+ end
47
+
48
+ # + azimuthal equidistant
49
+ xAzimuthE = xArc.xpath('./azimequi')
50
+ unless xAzimuthE.empty?
51
+ hProjectionId[:identifier] = 'azimuthalEquidistant'
52
+ hProjectionId[:name] = 'Azimuthal Equidistant'
53
+ return AzimuthEquidistantProjection.unpack(xAzimuthE, hProjection, hResponseObj)
54
+ end
55
+
56
+ # error message
57
+ hResponseObj[:readerExecutionMessages] <<
58
+ 'WARNING: FGDC reader: UPS equal arc-second projection definition is missing'
59
+
60
+ return hProjection
61
+
62
+ end
63
+
64
+ end
65
+
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,42 @@
1
+ # Reader - fgdc to internal data structure
2
+ # unpack fgdc map grid coordinate system
3
+
4
+ # History:
5
+ # Stan Smith 2018-10-04 original script
6
+
7
+ require 'nokogiri'
8
+ require_relative '../mapProjections/projection_transverseMercator'
9
+
10
+ module ADIWG
11
+ module Mdtranslator
12
+ module Readers
13
+ module Fgdc
14
+
15
+ module MapGridOther
16
+
17
+ def self.unpack(other, hProjection)
18
+
19
+ # grid system 4.1.2.2.6 (othergrd) - other coordinate system {text}
20
+ # -> ReferenceSystemParameters.projection.gridIdentifier.description
21
+
22
+ hProjectionId = hProjection[:projectionIdentifier]
23
+ hGridSystemId = hProjection[:gridIdentifier]
24
+
25
+ hGridSystemId[:identifier] = 'other'
26
+ hGridSystemId[:name] = 'Other Grid Coordinate System' if hGridSystemId[:name].nil?
27
+ hGridSystemId[:description] = other
28
+
29
+ hProjectionId[:identifier] = 'other'
30
+ hProjectionId[:name] = 'Other Projection'
31
+ hProjectionId[:description] = 'for description see grid system description'
32
+
33
+ return hProjection
34
+
35
+ end
36
+
37
+ end
38
+
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,87 @@
1
+ # Reader - fgdc to internal data structure
2
+ # unpack fgdc map grid coordinate system
3
+
4
+ # History:
5
+ # Stan Smith 2018-10-04 original script
6
+
7
+ require 'nokogiri'
8
+ require_relative '../mapProjections/projection_transverseMercator'
9
+ require_relative '../mapProjections/projection_lambertConic'
10
+ require_relative '../mapProjections/projection_obliqueMercator'
11
+ require_relative '../mapProjections/projection_polyconic'
12
+
13
+ module ADIWG
14
+ module Mdtranslator
15
+ module Readers
16
+ module Fgdc
17
+
18
+ module MapGridStatePlane
19
+
20
+ def self.unpack(xStateP, hProjection, hResponseObj)
21
+
22
+ # grid system 4.1.2.2.4 (spcs) - state plane coordinate system
23
+
24
+ hGridSystemId = hProjection[:gridIdentifier]
25
+ hProjectionId = hProjection[:projectionIdentifier]
26
+
27
+ hGridSystemId[:identifier] = 'spcs'
28
+ hGridSystemId[:name] = 'State Plane Coordinate System' if hGridSystemId[:name].nil?
29
+
30
+ # grid system 4.1.2.2.4.1 (spcszone) - state plane zone number {nnnn} (required)
31
+ # -> ReferenceSystemParameters.projection.gridZone
32
+ zone = xStateP.xpath('./spcszone').text
33
+ unless zone.empty?
34
+ hProjection[:gridZone] = zone
35
+ end
36
+ if zone.empty?
37
+ hResponseObj[:readerExecutionMessages] <<
38
+ 'WARNING: FGDC reader: state plane zone number is missing'
39
+ end
40
+
41
+ # + [ lambert conformal conic | transverse mercator | oblique mercator | polyconic ] (required)
42
+ # + lambert conformal conic
43
+ xLambert = xStateP.xpath('./lambertc')
44
+ unless xLambert.empty?
45
+ hProjectionId[:identifier] = 'lambertConic'
46
+ hProjectionId[:name] = 'Lambert Conformal Conic'
47
+ return LambertConicProjection.unpack(xLambert, hProjection, hResponseObj)
48
+ end
49
+
50
+ # + transverse mercator
51
+ xTransMer = xStateP.xpath('./transmer')
52
+ unless xTransMer.empty?
53
+ hProjectionId[:identifier] = 'transverseMercator'
54
+ hProjectionId[:name] = 'Transverse Mercator'
55
+ return TransverseMercatorProjection.unpack(xTransMer, hProjection, hResponseObj)
56
+ end
57
+
58
+ # + oblique mercator
59
+ xObliqueM = xStateP.xpath('./obqmerc')
60
+ unless xObliqueM.empty?
61
+ hProjectionId[:identifier] = 'obliqueMercator'
62
+ hProjectionId[:name] = 'Oblique Mercator'
63
+ return ObliqueMercatorProjection.unpack(xObliqueM, hProjection, hResponseObj)
64
+ end
65
+
66
+ # + polyconic
67
+ xPolyCon = xStateP.xpath('./polycon')
68
+ unless xPolyCon.empty?
69
+ hProjectionId[:identifier] = 'polyconic'
70
+ hProjectionId[:name] = 'Polyconic'
71
+ return PolyconicProjection.unpack(xPolyCon, hProjection, hResponseObj)
72
+ end
73
+
74
+ # error message
75
+ hResponseObj[:readerExecutionMessages] <<
76
+ 'WARNING: FGDC reader: UPS state plane projection definition is missing'
77
+
78
+ return hProjection
79
+
80
+ end
81
+
82
+ end
83
+
84
+ end
85
+ end
86
+ end
87
+ end
@@ -0,0 +1,58 @@
1
+ # Reader - fgdc to internal data structure
2
+ # unpack fgdc map grid coordinate system
3
+
4
+ # History:
5
+ # Stan Smith 2018-10-04 original script
6
+
7
+ require 'nokogiri'
8
+ require_relative '../mapProjections/projection_polarStereo'
9
+
10
+ module ADIWG
11
+ module Mdtranslator
12
+ module Readers
13
+ module Fgdc
14
+
15
+ module MapGridUps
16
+
17
+ def self.unpack(xUPS, hProjection, hResponseObj)
18
+
19
+ # grid system 4.1.2.2.3 (ups) - universal polar stereographic
20
+
21
+ hGridSystemId = hProjection[:gridIdentifier]
22
+ hProjectionId = hProjection[:projectionIdentifier]
23
+
24
+ hGridSystemId[:identifier] = 'ups'
25
+ hGridSystemId[:name] = 'Universal Polar Stereographic' if hGridSystemId[:name].nil?
26
+
27
+ # grid system 4.1.2.2.3.1 (upszone) - utm zone number {-60..-1, 1..60} (required)
28
+ # -> ReferenceSystemParameters.projection.gridZone
29
+ zone = xUPS.xpath('./upszone').text
30
+ unless zone.empty?
31
+ hProjection[:gridZone] = zone
32
+ end
33
+ if zone.empty?
34
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: UPS zone number is missing'
35
+ end
36
+
37
+ # + polar stereographic (required)
38
+ xPolarS = xUPS.xpath('./polarst')
39
+ unless xPolarS.empty?
40
+ hProjectionId[:identifier] = 'polarStereo'
41
+ hProjectionId[:name] = 'Polar Stereographic'
42
+ return PolarStereoProjection.unpack(xPolarS, hProjection, hResponseObj)
43
+ end
44
+
45
+ # error message
46
+ hResponseObj[:readerExecutionMessages] <<
47
+ 'WARNING: FGDC reader: UPS polar stereographic definition is missing'
48
+
49
+ return hProjection
50
+
51
+ end
52
+
53
+ end
54
+
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,58 @@
1
+ # Reader - fgdc to internal data structure
2
+ # unpack fgdc map grid coordinate system
3
+
4
+ # History:
5
+ # Stan Smith 2018-10-04 original script
6
+
7
+ require 'nokogiri'
8
+ require_relative '../mapProjections/projection_transverseMercator'
9
+
10
+ module ADIWG
11
+ module Mdtranslator
12
+ module Readers
13
+ module Fgdc
14
+
15
+ module MapGridUtm
16
+
17
+ def self.unpack(xUTM, hProjection, hResponseObj)
18
+
19
+ # grid system 4.1.2.2.2 (utm) - universal transverse mercator
20
+
21
+ hGridSystemId = hProjection[:gridIdentifier]
22
+ hProjectionId = hProjection[:projectionIdentifier]
23
+
24
+ hGridSystemId[:identifier] = 'utm'
25
+ hGridSystemId[:name] = 'Universal Transverse Mercator' if hGridSystemId[:name].nil?
26
+
27
+ # grid system 4.1.2.2.2.1 (utmzone) - utm zone number {-60..-1, 1..60} (required)
28
+ # -> ReferenceSystemParameters.projection.gridZone
29
+ zone = xUTM.xpath('./utmzone').text
30
+ unless zone.empty?
31
+ hProjection[:gridZone] = zone
32
+ end
33
+ if zone.empty?
34
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: UTM zone number is missing'
35
+ end
36
+
37
+ # + transverse mercator (required)
38
+ xTransMer = xUTM.xpath('./transmer')
39
+ unless xTransMer.empty?
40
+ hProjectionId[:identifier] = 'transverseMercator'
41
+ hProjectionId[:name] = 'Transverse Mercator'
42
+ return TransverseMercatorProjection.unpack(xTransMer, hProjection, hResponseObj)
43
+ end
44
+
45
+ # error message
46
+ hResponseObj[:readerExecutionMessages] <<
47
+ 'WARNING: FGDC reader: UTM transverse mercator definition is missing'
48
+
49
+ return hProjection
50
+
51
+ end
52
+
53
+ end
54
+
55
+ end
56
+ end
57
+ end
58
+ end
@@ -2,6 +2,7 @@
2
2
  # unpack fgdc map projection - albers
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'
@@ -20,28 +21,27 @@ module ADIWG
20
21
  # map projection 4.1.2.1.2 (albers) - Albers Conical Equal Area
21
22
  unless xParams.empty?
22
23
  paramCount = 0
23
- hProjection[:projection] = 'albers'
24
- hProjection[:projectionName] = 'Albers Conical Equal Area'
25
24
 
26
25
  # -> ReferenceSystemParameters.projection.standardParallel1
27
26
  # -> ReferenceSystemParameters.projection.standardParallel2
28
- paramCount += ProjectionCommon.unpackStandParallel(xParams, hProjection, hResponseObj)
27
+ paramCount += ProjectionCommon.unpackStandParallel(xParams, hProjection)
29
28
 
30
29
  # -> ReferenceSystemParameters.projection.longitudeOfCentralMeridian
31
- paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection, hResponseObj)
30
+ paramCount += ProjectionCommon.unpackLongCM(xParams, hProjection)
32
31
 
33
32
  # -> ReferenceSystemParameters.projection.latitudeOfProjectionOrigin
34
- paramCount += ProjectionCommon.unpackLatPO(xParams, hProjection, hResponseObj)
33
+ paramCount += ProjectionCommon.unpackLatPO(xParams, hProjection)
35
34
 
36
35
  # -> ReferenceSystemParameters.projection.falseEasting
37
36
  # -> ReferenceSystemParameters.projection.falseNorthing
38
- paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection, hResponseObj)
37
+ paramCount += ProjectionCommon.unpackFalseNE(xParams, hProjection)
39
38
 
40
39
  # verify parameter count
41
40
  if paramCount == 6
42
41
  return hProjection
43
42
  else
44
- hResponseObj[:readerExecutionMessages] << 'WARNING: Albers projection is missing one or more parameters'
43
+ hResponseObj[:readerExecutionMessages] <<
44
+ 'WARNING: Albers projection is missing one or more parameters'
45
45
  end
46
46
  end
47
47
 
@@ -2,6 +2,7 @@
2
2
  # unpack fgdc map projection - azimuth equidistant
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-10-03 refactor mdJson projection object
5
6
  # Stan Smith 2017-10-16 original script
6
7
 
7
8
  require 'nokogiri'
@@ -20,24 +21,23 @@ module ADIWG
20
21
  # map projection 4.1.2.1.3 (azimequi) - Azimuthal Equidistant
21
22
  unless xParams.empty?
22
23
  paramCount = 0
23
- hProjection[:projection] = 'azimuthalEquidistant'
24
- hProjection[:projectionName] = 'Azimuthal Equidistant'
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: Azimuth Equidistant projection is missing one or more parameters'
39
+ hResponseObj[:readerExecutionMessages] <<
40
+ 'WARNING: FGDC reader: Azimuth Equidistant projection is missing one or more parameters'
41
41
  end
42
42
  end
43
43