adiwg-mdtranslator 2.14.0 → 2.14.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f6314a8f43eb42ada37a556d73c9fbd0a76d46eb
4
- data.tar.gz: 34fade7d3ac05ab024a601b899e3734ec4a72d31
3
+ metadata.gz: 57ce35d6f0c15b4f51f8ec3c8b1884af34e483d3
4
+ data.tar.gz: 876ce4e8c37e6c1da496f5f481e068ee769cd4bb
5
5
  SHA512:
6
- metadata.gz: e28c20ccb05a1e42cbfea51404301f8451fb0367e024c7877714edc7bd42e3628c030936d03116b4d774c2715e820a279d1ad0e26118309fefbc65bbae80e63a
7
- data.tar.gz: b49985b384314529c11c69cda56848e1087a20cba33fbb8ff240d0cbbf9f6dbe75e503358f4d5474ff6e1b036739816e45acf7c014b1d5eaa5b0f1a6086a6499
6
+ metadata.gz: a1f7b49ad24984bf82f1b588b4c4d7de805a832924df29651f0b09687e9c5ca1c110ca8b1ad9134c8b43387e94395d38463fba91ecb261c9514964b3b0222332
7
+ data.tar.gz: 896084fe3f5a85cc946d6ce926013cd32721e68483eeb43993033e4f9ba3884f0746e491b80b1a22851861f075f98f7bc539cdbfe772397c79bb2432bdda48ac
@@ -1,6 +1,7 @@
1
1
  # adiwg mdTranslator
2
2
 
3
3
  # version 2 history
4
+ # 2.14.1 2018-10-31 add fix for empty verticalDatum in fgdc and iso 19115_2 writers
4
5
  # 2.14.0 2018-10-27 refactor taxonomy for multiple taxonomic classifications
5
6
  # 2.14.0 2018-10-27 refactor taxonomy for identification reference as citation
6
7
  # 2.14.0 2018-10-27 refactor taxonomy for identification procedures not required
@@ -101,7 +102,7 @@
101
102
  module ADIWG
102
103
  module Mdtranslator
103
104
  # current mdtranslator version
104
- VERSION = "2.14.0"
105
+ VERSION = "2.14.1"
105
106
  end
106
107
  end
107
108
 
@@ -2,6 +2,7 @@
2
2
  # FGDC CSDGM writer output in XML
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-10-31 fix empty verticalDatum issue
5
6
  # Stan Smith 2018-09-26 deprecate datumName use datumIdentifier.identifier
6
7
  # Stan Smith 2018-03-27 refactored error and warning messaging
7
8
  # Stan Smith 2018-01-16 original script
@@ -25,83 +26,87 @@ module ADIWG
25
26
  unless hSpaceRef[:systemParameterSet].empty?
26
27
  if hSpaceRef[:systemParameterSet][:verticalDatum]
27
28
  hVDatum = hSpaceRef[:systemParameterSet][:verticalDatum]
29
+ unless hVDatum.empty?
30
+
31
+ # determine if vertical datum is altitude or depth
32
+ if hVDatum[:isDepthSystem]
33
+ @xml.tag!('depthsys') do
34
+
35
+ # vertical datum 4.2.1.1 (depthdn) - depth datum name (required)
36
+ unless hVDatum[:datumIdentifier].empty?
37
+ @xml.tag!('depthdn', hVDatum[:datumIdentifier][:identifier])
38
+ end
39
+ if hVDatum[:datumIdentifier].empty?
40
+ @NameSpace.issueWarning(460, 'depthdn')
41
+ end
42
+
43
+ # vertical datum 4.2.1.2 (depthres) - depth units resolution (required)
44
+ unless hVDatum[:verticalResolution].nil?
45
+ @xml.tag!('depthres', hVDatum[:verticalResolution])
46
+ end
47
+ if hVDatum[:verticalResolution].nil?
48
+ @NameSpace.issueWarning(461, 'depthres')
49
+ end
50
+
51
+ # vertical datum 4.2.1.3 (depthdu) - depth units (required)
52
+ unless hVDatum[:unitOfMeasure].nil?
53
+ @xml.tag!('depthdu', hVDatum[:unitOfMeasure])
54
+ end
55
+ if hVDatum[:unitOfMeasure].nil?
56
+ @NameSpace.issueWarning(462, 'depthdu')
57
+ end
58
+
59
+ # vertical datum 4.2.1.4 (depthem) - encoding method (required)
60
+ unless hVDatum[:encodingMethod].nil?
61
+ @xml.tag!('depthem', hVDatum[:encodingMethod])
62
+ end
63
+ if hVDatum[:encodingMethod].nil?
64
+ @NameSpace.issueWarning(463, 'depthem')
65
+ end
66
+
67
+ end
68
+
69
+ else
70
+ @xml.tag!('altsys') do
71
+
72
+ # altitude datum 4.2.2.1 (altdatum) - altitude datum name (required)
73
+ unless hVDatum[:datumIdentifier].empty?
74
+ @xml.tag!('altdatum', hVDatum[:datumIdentifier][:identifier])
75
+ end
76
+ if hVDatum[:datumIdentifier].empty?
77
+ @NameSpace.issueWarning(464, 'altdatum')
78
+ end
79
+
80
+ # altitude datum 4.2.2.2 (altres) - altitude units resolution (required)
81
+ unless hVDatum[:verticalResolution].nil?
82
+ @xml.tag!('altres', hVDatum[:verticalResolution])
83
+ end
84
+ if hVDatum[:verticalResolution].nil?
85
+ @NameSpace.issueWarning(465, 'altres')
86
+ end
87
+
88
+ # altitude datum 4.2.2.3 (altunits) - altitude units (required)
89
+ unless hVDatum[:unitOfMeasure].nil?
90
+ @xml.tag!('altunits', hVDatum[:unitOfMeasure])
91
+ end
92
+ if hVDatum[:unitOfMeasure].nil?
93
+ @NameSpace.issueWarning(466, 'altunits')
94
+ end
95
+
96
+ # altitude datum 4.2.2.4 (altenc) - altitude units (required)
97
+ unless hVDatum[:encodingMethod].nil?
98
+ @xml.tag!('altenc', hVDatum[:encodingMethod])
99
+ end
100
+ if hVDatum[:encodingMethod].nil?
101
+ @NameSpace.issueWarning(467, 'altenc')
102
+ end
28
103
 
29
- # determine if vertical datum is altitude or depth
30
- if hVDatum[:isDepthSystem]
31
- @xml.tag!('depthsys') do
32
-
33
- # vertical datum 4.2.1.1 (depthdn) - depth datum name (required)
34
- unless hVDatum[:datumIdentifier].empty?
35
- @xml.tag!('depthdn', hVDatum[:datumIdentifier][:identifier])
36
- end
37
- if hVDatum[:datumIdentifier].empty?
38
- @NameSpace.issueWarning(460, 'depthdn')
39
- end
40
-
41
- # vertical datum 4.2.1.2 (depthres) - depth units resolution (required)
42
- unless hVDatum[:verticalResolution].nil?
43
- @xml.tag!('depthres', hVDatum[:verticalResolution])
44
- end
45
- if hVDatum[:verticalResolution].nil?
46
- @NameSpace.issueWarning(461, 'depthres')
47
- end
48
-
49
- # vertical datum 4.2.1.3 (depthdu) - depth units (required)
50
- unless hVDatum[:unitOfMeasure].nil?
51
- @xml.tag!('depthdu', hVDatum[:unitOfMeasure])
52
104
  end
53
- if hVDatum[:unitOfMeasure].nil?
54
- @NameSpace.issueWarning(462, 'depthdu')
55
- end
56
-
57
- # vertical datum 4.2.1.4 (depthem) - encoding method (required)
58
- unless hVDatum[:encodingMethod].nil?
59
- @xml.tag!('depthem', hVDatum[:encodingMethod])
60
- end
61
- if hVDatum[:encodingMethod].nil?
62
- @NameSpace.issueWarning(463, 'depthem')
63
- end
64
-
65
105
  end
66
106
 
67
- else
68
- @xml.tag!('altsys') do
69
-
70
- # altitude datum 4.2.2.1 (altdatum) - altitude datum name (required)
71
- unless hVDatum[:datumIdentifier].empty?
72
- @xml.tag!('altdatum', hVDatum[:datumIdentifier][:identifier])
73
- end
74
- if hVDatum[:datumIdentifier].empty?
75
- @NameSpace.issueWarning(464, 'altdatum')
76
- end
77
-
78
- # altitude datum 4.2.2.2 (altres) - altitude units resolution (required)
79
- unless hVDatum[:verticalResolution].nil?
80
- @xml.tag!('altres', hVDatum[:verticalResolution])
81
- end
82
- if hVDatum[:verticalResolution].nil?
83
- @NameSpace.issueWarning(465, 'altres')
84
- end
85
-
86
- # altitude datum 4.2.2.3 (altunits) - altitude units (required)
87
- unless hVDatum[:unitOfMeasure].nil?
88
- @xml.tag!('altunits', hVDatum[:unitOfMeasure])
89
- end
90
- if hVDatum[:unitOfMeasure].nil?
91
- @NameSpace.issueWarning(466, 'altunits')
92
- end
93
-
94
- # altitude datum 4.2.2.4 (altenc) - altitude units (required)
95
- unless hVDatum[:encodingMethod].nil?
96
- @xml.tag!('altenc', hVDatum[:encodingMethod])
97
- end
98
- if hVDatum[:encodingMethod].nil?
99
- @NameSpace.issueWarning(467, 'altenc')
100
- end
101
-
102
- end
103
107
  end
104
108
 
109
+
105
110
  end
106
111
  end
107
112
  end
@@ -3,6 +3,7 @@
3
3
  # 19115-2 output for ISO 19115-2 XML
4
4
 
5
5
  # History:
6
+ # Stan Smith 2018-10-31 fix error with 'writerShowTags'
6
7
  # Stan Smith 2018-10-17 refactor to support schema 2.6.0 changes to projection
7
8
  # Stan Smith 2017-10-26 original script
8
9
 
@@ -38,10 +39,12 @@ module ADIWG
38
39
  end
39
40
  end
40
41
  end
41
- if hParamSet[:projection].empty? && @hResponseObj[:writerShowTags]
42
- @xml.tag!('gmd:projection')
43
- elsif hParamSet[:projection][:projectionIdentifier].empty? && @hResponseObj[:writerShowTags]
44
- @xml.tag!('gmd:projection')
42
+ if @hResponseObj[:writerShowTags]
43
+ if hParamSet[:projection].empty?
44
+ @xml.tag!('gmd:projection')
45
+ elsif hParamSet[:projection][:projectionIdentifier].empty?
46
+ @xml.tag!('gmd:projection')
47
+ end
45
48
  end
46
49
 
47
50
  # geodetic ellipsoid identifier {rsIdentifier}
@@ -53,10 +56,12 @@ module ADIWG
53
56
  end
54
57
  end
55
58
  end
56
- if hParamSet[:geodetic].empty? && @hResponseObj[:writerShowTags]
57
- @xml.tag!('gmd:ellipsoid')
58
- elsif hParamSet[:geodetic][:ellipsoidIdentifier].empty? && @hResponseObj[:writerShowTags]
59
- @xml.tag!('gmd:ellipsoid')
59
+ if @hResponseObj[:writerShowTags]
60
+ if hParamSet[:geodetic].empty?
61
+ @xml.tag!('gmd:ellipsoid')
62
+ elsif hParamSet[:geodetic][:ellipsoidIdentifier].empty?
63
+ @xml.tag!('gmd:ellipsoid')
64
+ end
60
65
  end
61
66
 
62
67
  # geodetic datum identifier (horizontal) {rsIdentifier}
@@ -68,10 +73,12 @@ module ADIWG
68
73
  end
69
74
  end
70
75
  end
71
- if hParamSet[:geodetic].empty? && @hResponseObj[:writerShowTags]
72
- @xml.tag!('gmd:datum')
73
- elsif hParamSet[:geodetic][:datumIdentifier].empty? && @hResponseObj[:writerShowTags]
74
- @xml.tag!('gmd:datum')
76
+ if @hResponseObj[:writerShowTags]
77
+ if hParamSet[:geodetic].empty?
78
+ @xml.tag!('gmd:datum')
79
+ elsif hParamSet[:geodetic][:datumIdentifier].empty?
80
+ @xml.tag!('gmd:datum')
81
+ end
75
82
  end
76
83
 
77
84
  # ellipsoid parameters
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adiwg-mdtranslator
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.14.0
4
+ version: 2.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stan Smith
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-10-31 00:00:00.000000000 Z
12
+ date: 2018-11-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler