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
@@ -1,6 +1,12 @@
1
1
  # adiwg mdTranslator
2
2
 
3
3
  # version 2 history
4
+ # 2.4.0 2017-10-24 added mdJson writers for reference system parameter set
5
+ # 2.4.0 2017-10-19 added mdJson reader for geographicResolution
6
+ # 2.4.0 2017-10-19 added mdJson reader for bearingDistanceResolution
7
+ # 2.4.0 2017-10-19 added mdJson reader for coordinateResolution
8
+ # 2.4.0 2017-10-19 added fgdc readers for spatial reference
9
+ # 2.3.6 2017-10-24 fix bug that returns first identifier if no SB namespace is found
4
10
  # 2.3.5 2017-10-17 fixed problem with adding technical prerequisite to nil distribution description
5
11
  # 2.3.5 2017-10-13 trap missing topology level in html writer vectorRepresentation
6
12
  # 2.3.4 2017-10-12 drop harvest set tag if repository citation is missing
@@ -32,7 +38,7 @@
32
38
  module ADIWG
33
39
  module Mdtranslator
34
40
  # current mdtranslator version
35
- VERSION = "2.3.5"
41
+ VERSION = "2.4.0"
36
42
  end
37
43
  end
38
44
 
@@ -0,0 +1,68 @@
1
+ # HTML writer
2
+ # bearing distance resolution
3
+
4
+ # History:
5
+ # Stan Smith 2017-10-20 original script
6
+
7
+ module ADIWG
8
+ module Mdtranslator
9
+ module Writers
10
+ module Html
11
+
12
+ class Html_BearingDistanceResolution
13
+
14
+ def initialize(html)
15
+ @html = html
16
+ end
17
+
18
+ def writeHtml(hBearRes)
19
+
20
+ # bearing distance resolution - distance resolution
21
+ unless hBearRes[:distanceResolution].nil?
22
+ @html.em('Distance Resolution: ')
23
+ @html.text!(hBearRes[:distanceResolution].to_s)
24
+ @html.br
25
+ end
26
+
27
+ # bearing distance resolution - distance unit of measure
28
+ unless hBearRes[:distanceUnitOfMeasure].nil?
29
+ @html.em('Distance Unit of Measure: ')
30
+ @html.text!(hBearRes[:distanceUnitOfMeasure])
31
+ @html.br
32
+ end
33
+
34
+ # bearing distance resolution - bearing resolution
35
+ unless hBearRes[:bearingResolution].nil?
36
+ @html.em('Bearing Resolution: ')
37
+ @html.text!(hBearRes[:bearingResolution].to_s)
38
+ @html.br
39
+ end
40
+
41
+ # bearing distance resolution - bearing unit of measure
42
+ unless hBearRes[:bearingUnitOfMeasure].nil?
43
+ @html.em('Bearing Unit of Measure: ')
44
+ @html.text!(hBearRes[:bearingUnitOfMeasure])
45
+ @html.br
46
+ end
47
+
48
+ # bearing distance resolution - bearing reference direction
49
+ unless hBearRes[:bearingReferenceDirection].nil?
50
+ @html.em('Bearing Reference Direction: ')
51
+ @html.text!(hBearRes[:bearingReferenceDirection])
52
+ @html.br
53
+ end
54
+
55
+ # bearing distance resolution - bearing reference meridian
56
+ unless hBearRes[:bearingReferenceMeridian].nil?
57
+ @html.em('Bearing Reference Meridian: ')
58
+ @html.text!(hBearRes[:bearingReferenceMeridian])
59
+ @html.br
60
+ end
61
+
62
+ end # writeHtml
63
+ end # Html_BearingDistanceResolution
64
+
65
+ end
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,47 @@
1
+ # HTML writer
2
+ # coordinate resolution
3
+
4
+ # History:
5
+ # Stan Smith 2017-10-20 original script
6
+
7
+ module ADIWG
8
+ module Mdtranslator
9
+ module Writers
10
+ module Html
11
+
12
+ class Html_CoordinateResolution
13
+
14
+ def initialize(html)
15
+ @html = html
16
+ end
17
+
18
+ def writeHtml(hCoordRes)
19
+
20
+ # coordinate resolution - abscissa
21
+ unless hCoordRes[:abscissaResolutionX].nil?
22
+ @html.em('X Resolution (abscissa): ')
23
+ @html.text!(hCoordRes[:abscissaResolutionX].to_s)
24
+ @html.br
25
+ end
26
+
27
+ # coordinate resolution - ordinate
28
+ unless hCoordRes[:ordinateResolutionY].nil?
29
+ @html.em('Y Resolution (ordinate): ')
30
+ @html.text!(hCoordRes[:ordinateResolutionY].to_s)
31
+ @html.br
32
+ end
33
+
34
+ # coordinate resolution - unit of measure
35
+ unless hCoordRes[:unitOfMeasure].nil?
36
+ @html.em('Units of Measure: ')
37
+ @html.text!(hCoordRes[:unitOfMeasure])
38
+ @html.br
39
+ end
40
+
41
+ end # writeHtml
42
+ end # Html_CoordinateResolution
43
+
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,47 @@
1
+ # HTML writer
2
+ # geographic resolution
3
+
4
+ # History:
5
+ # Stan Smith 2017-10-20 original script
6
+
7
+ module ADIWG
8
+ module Mdtranslator
9
+ module Writers
10
+ module Html
11
+
12
+ class Html_GeographicResolution
13
+
14
+ def initialize(html)
15
+ @html = html
16
+ end
17
+
18
+ def writeHtml(hGeoRes)
19
+
20
+ # geographic resolution - latitude resolution
21
+ unless hGeoRes[:latitudeResolution].nil?
22
+ @html.em('Latitude Resolution: ')
23
+ @html.text!(hGeoRes[:latitudeResolution].to_s)
24
+ @html.br
25
+ end
26
+
27
+ # geographic resolution - longitude resolution
28
+ unless hGeoRes[:longitudeResolution].nil?
29
+ @html.em('Longitude Resolution: ')
30
+ @html.text!(hGeoRes[:longitudeResolution].to_s)
31
+ @html.br
32
+ end
33
+
34
+ # geographic resolution - unit of measure
35
+ unless hGeoRes[:unitOfMeasure].nil?
36
+ @html.em('Units of Measure: ')
37
+ @html.text!(hGeoRes[:unitOfMeasure])
38
+ @html.br
39
+ end
40
+
41
+ end # writeHtml
42
+ end # Html_GeographicResolution
43
+
44
+ end
45
+ end
46
+ end
47
+ end
@@ -15,7 +15,7 @@ require_relative 'html_temporalExtent'
15
15
  require_relative 'html_duration'
16
16
  require_relative 'html_spatialReference'
17
17
  require_relative 'html_spatialRepresentation'
18
- require_relative 'html_resolution'
18
+ require_relative 'html_spatialResolution'
19
19
  require_relative 'html_keyword'
20
20
  require_relative 'html_taxonomy'
21
21
  require_relative 'html_graphic'
@@ -48,7 +48,7 @@ module ADIWG
48
48
  durationClass = Html_Duration.new(@html)
49
49
  referenceClass = Html_SpatialReference.new(@html)
50
50
  representationClass = Html_SpatialRepresentation.new(@html)
51
- resolutionClass = Html_Resolution.new(@html)
51
+ resolutionClass = Html_SpatialResolution.new(@html)
52
52
  keywordClass = Html_Keyword.new(@html)
53
53
  taxonomyClass = Html_Taxonomy.new(@html)
54
54
  graphicClass = Html_Graphic.new(@html)
@@ -238,6 +238,52 @@ module ADIWG
238
238
  @html.br
239
239
  end
240
240
 
241
+ # spatial resolution [] {resolution}
242
+ unless hResource[:spatialResolutions].empty?
243
+ @html.details do
244
+ @html.summary('Spatial Resolutions', {'class' => 'h5'})
245
+ @html.section(:class => 'block') do
246
+
247
+ # keep like resolution types together
248
+ # find all scale factors
249
+ hResource[:spatialResolutions].each do |hResolution|
250
+ unless hResolution[:scaleFactor].nil?
251
+ resolutionClass.writeHtml(hResolution)
252
+ end
253
+ end
254
+
255
+ # find all measures
256
+ hResource[:spatialResolutions].each do |hResolution|
257
+ unless hResolution[:measure].empty?
258
+ resolutionClass.writeHtml(hResolution)
259
+ end
260
+ end
261
+
262
+ # find all coordinate resolutions
263
+ hResource[:spatialResolutions].each do |hResolution|
264
+ unless hResolution[:coordinateResolution].empty?
265
+ resolutionClass.writeHtml(hResolution)
266
+ end
267
+ end
268
+
269
+ # find all bearing distance resolutions
270
+ hResource[:spatialResolutions].each do |hResolution|
271
+ unless hResolution[:bearingDistanceResolution].empty?
272
+ resolutionClass.writeHtml(hResolution)
273
+ end
274
+ end
275
+
276
+ # find all geographic resolutions
277
+ hResource[:spatialResolutions].each do |hResolution|
278
+ unless hResolution[:geographicResolution].empty?
279
+ resolutionClass.writeHtml(hResolution)
280
+ end
281
+ end
282
+
283
+ end
284
+ end
285
+ end
286
+
241
287
  # reference system [] {spatialReference}
242
288
  hResource[:spatialReferenceSystems].each do |hRefSystem|
243
289
  @html.details do
@@ -253,11 +299,6 @@ module ADIWG
253
299
  representationClass.writeHtml(hRepresentation)
254
300
  end
255
301
 
256
- # spatial resolution [] {resolution}
257
- hResource[:spatialResolutions].each do |hResolution|
258
- resolutionClass.writeHtml(hResolution)
259
- end
260
-
261
302
  end
262
303
  end
263
304
  end
@@ -7,7 +7,7 @@
7
7
  # Stan Smith 2015-03-27 original script
8
8
 
9
9
  require_relative 'html_citation'
10
- require_relative 'html_resolution'
10
+ require_relative 'html_spatialResolution'
11
11
  require_relative 'html_spatialReference'
12
12
  require_relative 'html_processStep'
13
13
  require_relative 'html_scope'
@@ -27,7 +27,7 @@ module ADIWG
27
27
 
28
28
  # classes used
29
29
  citationClass = Html_Citation.new(@html)
30
- resolutionClass = Html_Resolution.new(@html)
30
+ resolutionClass = Html_SpatialResolution.new(@html)
31
31
  referenceClass = Html_SpatialReference.new(@html)
32
32
  stepClass = Html_ProcessStep.new(@html)
33
33
  scopeClass = Html_Scope.new(@html)
@@ -0,0 +1,95 @@
1
+ # HTML writer
2
+ # resolution
3
+
4
+ # History:
5
+ # Stan Smith 2017-10-20 added coordinateResolution
6
+ # Stan Smith 2017-10-20 added bearingDistanceResolution
7
+ # Stan Smith 2017-10-20 added geographicResolution
8
+ # Stan Smith 2017-03-29 refactored for mdTranslator 2.0
9
+ # Stan Smith 2015-03-26 original script
10
+
11
+ require_relative 'html_measure'
12
+ require_relative 'html_coordinateResolution'
13
+ require_relative 'html_bearingDistanceResolution'
14
+ require_relative 'html_geographicResolution'
15
+
16
+ module ADIWG
17
+ module Mdtranslator
18
+ module Writers
19
+ module Html
20
+
21
+ class Html_SpatialResolution
22
+
23
+ def initialize(html)
24
+ @html = html
25
+ end
26
+
27
+ def writeHtml(hResolution)
28
+
29
+ measureClass = Html_Measure.new(@html)
30
+ coordinateClass = Html_CoordinateResolution.new(@html)
31
+ bearingClass = Html_BearingDistanceResolution.new(@html)
32
+ geoClass = Html_GeographicResolution.new(@html)
33
+
34
+ # resolution - scale factor
35
+ unless hResolution[:scaleFactor].nil?
36
+ @html.em('Scale Factor: ')
37
+ @html.text!(hResolution[:scaleFactor].to_s)
38
+ @html.br
39
+ end
40
+
41
+ # resolution - measure
42
+ unless hResolution[:measure].empty?
43
+ @html.details do
44
+ @html.summary('Resolution Measure', {'class' => 'h5'})
45
+ @html.section(:class => 'block') do
46
+ measureClass.writeHtml(hResolution[:measure])
47
+ end
48
+ end
49
+ end
50
+
51
+ # resolution - coordinate resolution
52
+ unless hResolution[:coordinateResolution].empty?
53
+ @html.details do
54
+ @html.summary('Coordinate Resolution', {'class' => 'h5'})
55
+ @html.section(:class => 'block') do
56
+ coordinateClass.writeHtml(hResolution[:coordinateResolution])
57
+ end
58
+ end
59
+ end
60
+
61
+ # resolution - bearing distance resolution
62
+ unless hResolution[:bearingDistanceResolution].empty?
63
+ @html.details do
64
+ @html.summary('Bearing Distance Resolution', {'class' => 'h5'})
65
+ @html.section(:class => 'block') do
66
+ bearingClass.writeHtml(hResolution[:bearingDistanceResolution])
67
+ end
68
+ end
69
+ end
70
+
71
+ # resolution - geographic resolution
72
+ unless hResolution[:geographicResolution].empty?
73
+ @html.details do
74
+ @html.summary('Geographic Resolution', {'class' => 'h5'})
75
+ @html.section(:class => 'block') do
76
+ geoClass.writeHtml(hResolution[:geographicResolution])
77
+ end
78
+ end
79
+ end
80
+
81
+ # resolution - level of detail
82
+ unless hResolution[:levelOfDetail].nil?
83
+ @html.em('Level of Detail: ')
84
+ @html.section(:class => 'block') do
85
+ @html.text!(hResolution[:levelOfDetail])
86
+ end
87
+ end
88
+
89
+ end # writeHtml
90
+ end # Html_Resolution
91
+
92
+ end
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,32 @@
1
+ # mdJson 2.0 writer - bearing distance resolution
2
+
3
+ # History:
4
+ # Stan Smith 2017-10-20 original script
5
+
6
+ require 'jbuilder'
7
+
8
+ module ADIWG
9
+ module Mdtranslator
10
+ module Writers
11
+ module MdJson
12
+
13
+ module BearingDistanceResolution
14
+
15
+ def self.build(hBearRes)
16
+
17
+ Jbuilder.new do |json|
18
+ json.distanceResolution hBearRes[:distanceResolution]
19
+ json.distanceUnitOfMeasure hBearRes[:distanceUnitOfMeasure]
20
+ json.bearingResolution hBearRes[:bearingResolution]
21
+ json.bearingUnitOfMeasure hBearRes[:bearingUnitOfMeasure]
22
+ json.bearingReferenceDirection hBearRes[:bearingReferenceDirection]
23
+ json.bearingReferenceMeridian hBearRes[:bearingReferenceMeridian]
24
+ end
25
+
26
+ end # build
27
+ end # BearingDistanceResolution
28
+
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,29 @@
1
+ # mdJson 2.0 writer - coordinate resolution
2
+
3
+ # History:
4
+ # Stan Smith 2017-10-20 original script
5
+
6
+ require 'jbuilder'
7
+
8
+ module ADIWG
9
+ module Mdtranslator
10
+ module Writers
11
+ module MdJson
12
+
13
+ module CoordinateResolution
14
+
15
+ def self.build(hCoordRes)
16
+
17
+ Jbuilder.new do |json|
18
+ json.abscissaResolutionX hCoordRes[:abscissaResolutionX]
19
+ json.ordinateResolutionY hCoordRes[:ordinateResolutionY]
20
+ json.unitOfMeasure hCoordRes[:unitOfMeasure]
21
+ end
22
+
23
+ end # build
24
+ end # CoordinateResolution
25
+
26
+ end
27
+ end
28
+ end
29
+ end