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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -1
- data/adiwg-mdtranslator.gemspec +1 -1
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +12 -6
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_albers.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_azimuthEquidistant.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_common.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_equidistantConic.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_equirectangular.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_generalVertical.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_gnomonic.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_lambertConic.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_lambertEqualArea.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_mercator.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_millerCylinder.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_modifiedAlaska.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_obliqueMercator.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_orthographic.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_parameters.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_polarStereo.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_polyconic.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_robinson.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_sinusoidal.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_spaceOblique.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_stereographic.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_transverseMercator.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_vanDerGrinten.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_geodeticReference.rb +82 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_geographicResolution.rb +57 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_horizontalPlanar.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_horizontalReference.rb +12 -113
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_keyword.rb +9 -27
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_localSystem.rb +53 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapCoordinateInfo.rb +1 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapGridSystem.rb +27 -15
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/{module_mapLocalSystem.rb → module_mapLocalPlanar.rb} +3 -14
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_spatialReference.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonSystem.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_verticalAltitude.rb +4 -6
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/{module_verticalReference.rb → module_verticalDatum.rb} +0 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_verticalDepth.rb +4 -7
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geodetic.rb +95 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_keyword.rb +1 -14
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_projectionParameters.rb +29 -8
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_referenceSystemParameters.rb +5 -5
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceInfo.rb +15 -3
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_spatialReference.rb +16 -4
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_verticalDatum.rb +8 -23
- data/lib/adiwg/mdtranslator/readers/sbJson/modules/module_tag.rb +2 -2
- data/lib/adiwg/mdtranslator/version.rb +4 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_citation.rb +1 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dateRange.rb +6 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dateSingle.rb +5 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_fgdc.rb +18 -5
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geodeticReference.rb +62 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geographicResolution.rb +56 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_keyword.rb +1 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_localSystem.rb +45 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_mapCoordinateInfo.rb +167 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_mapProjection.rb +374 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarReference.rb +372 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_process.rb +1 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialReference.rb +134 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomySystem.rb +8 -11
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_timePeriod.rb +8 -8
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_verticalDatum.rb +120 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_body.rb +12 -2
- data/lib/adiwg/mdtranslator/writers/html/sections/html_geodeticParameters.rb +85 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_keyword.rb +5 -1
- data/lib/adiwg/mdtranslator/writers/html/sections/html_projectionParameters.rb +36 -15
- data/lib/adiwg/mdtranslator/writers/html/sections/html_referenceSystemParameters.rb +6 -6
- data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceInfo.rb +1 -2
- data/lib/adiwg/mdtranslator/writers/html/sections/html_verticalDatumParameters.rb +7 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_crs.rb +21 -8
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataIdentification.rb +332 -321
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_keyword.rb +8 -8
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_projectionParameters.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_geodeticParameters.rb +34 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_projectionParameters.rb +5 -2
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_spatialReference.rb +1 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_spatialReferenceParameters.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_tag.rb +1 -1
- metadata +20 -9
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_ellipsoid.rb +0 -78
- data/lib/adiwg/mdtranslator/writers/html/sections/html_ellipsoidParameters.rb +0 -68
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_ellipsoidParameters.rb +0 -32
@@ -5,21 +5,13 @@
|
|
5
5
|
# Stan Smith 2017-10-04 original script
|
6
6
|
|
7
7
|
require 'nokogiri'
|
8
|
-
require 'adiwg/mdtranslator/internal/internal_metadata_obj'
|
9
|
-
require_relative 'mapProjections/projection_transverseMercator'
|
10
|
-
require_relative 'mapProjections/projection_polarStereo'
|
11
|
-
require_relative 'mapProjections/projection_lambertConic'
|
12
|
-
require_relative 'mapProjections/projection_obliqueMercator'
|
13
|
-
require_relative 'mapProjections/projection_polyconic'
|
14
|
-
require_relative 'mapProjections/projection_equirectangular'
|
15
|
-
require_relative 'mapProjections/projection_azimuthEquidistant'
|
16
8
|
|
17
9
|
module ADIWG
|
18
10
|
module Mdtranslator
|
19
11
|
module Readers
|
20
12
|
module Fgdc
|
21
13
|
|
22
|
-
module
|
14
|
+
module MapLocalPlanar
|
23
15
|
|
24
16
|
def self.unpack(xMapLocal, hResponseObj)
|
25
17
|
|
@@ -27,11 +19,8 @@ module ADIWG
|
|
27
19
|
intMetadataClass = InternalMetadata.new
|
28
20
|
hProjection = intMetadataClass.newProjection
|
29
21
|
|
30
|
-
|
31
|
-
|
32
|
-
hIdentifier[:identifier] = 'local planar coordinate system'
|
33
|
-
hProjection[:projectionIdentifier] = hIdentifier
|
34
|
-
hProjection[:projectionName] = 'local planar'
|
22
|
+
hProjection[:projection] = 'localPlanar'
|
23
|
+
hProjection[:projectionName] = 'local planar coordinate system'
|
35
24
|
|
36
25
|
# local planar 4.1.2.3.1 (localpd) - local planar description
|
37
26
|
# -> ReferenceSystemParameters.projection.localPlanarDescription
|
@@ -114,7 +114,7 @@ module ADIWG
|
|
114
114
|
unless xRepository.empty?
|
115
115
|
hResponsibility = Contact.unpack(xRepository, hResponseObj)
|
116
116
|
unless hResponsibility.nil?
|
117
|
-
hResponsibility[:roleName] = '
|
117
|
+
hResponsibility[:roleName] = 'custodian'
|
118
118
|
hVoucher[:repository] = hResponsibility
|
119
119
|
end
|
120
120
|
end
|
@@ -18,16 +18,15 @@ module ADIWG
|
|
18
18
|
|
19
19
|
# instance classes needed in script
|
20
20
|
intMetadataClass = InternalMetadata.new
|
21
|
-
hIdentifier = intMetadataClass.newIdentifier
|
22
21
|
hDatum = intMetadataClass.newVerticalDatum
|
23
22
|
|
24
23
|
hDatum[:isDepthSystem] = false
|
25
24
|
|
26
25
|
# altitude datum 4.2.1.1 (altdatum) - altitude datum name
|
27
|
-
# -> referenceSystemParameters.verticalDatum.
|
28
|
-
|
29
|
-
unless
|
30
|
-
|
26
|
+
# -> referenceSystemParameters.verticalDatum.datumName
|
27
|
+
datumName = xAltSys.xpath('./altdatum').text
|
28
|
+
unless datumName.empty?
|
29
|
+
hDatum[:datumName] = datumName
|
31
30
|
end
|
32
31
|
|
33
32
|
# altitude datum 4.2.1.2 (altres) - altitude resolution []
|
@@ -53,7 +52,6 @@ module ADIWG
|
|
53
52
|
|
54
53
|
hParamSet = intMetadataClass.newReferenceSystemParameterSet
|
55
54
|
hRefSystem = intMetadataClass.newSpatialReferenceSystem
|
56
|
-
hDatum[:datumIdentifier] = hIdentifier
|
57
55
|
hParamSet[:verticalDatum] = hDatum
|
58
56
|
hRefSystem[:systemParameterSet] = hParamSet
|
59
57
|
return hRefSystem
|
File without changes
|
@@ -18,16 +18,14 @@ module ADIWG
|
|
18
18
|
|
19
19
|
# instance classes needed in script
|
20
20
|
intMetadataClass = InternalMetadata.new
|
21
|
-
hIdentifier = intMetadataClass.newIdentifier
|
22
21
|
hDatum = intMetadataClass.newVerticalDatum
|
23
|
-
|
24
22
|
hDatum[:isDepthSystem] = true
|
25
23
|
|
26
24
|
# depth datum 4.2.2.1 (depthdn) - depth datum name
|
27
|
-
# -> referenceSystemParameters.verticalDatum.
|
28
|
-
|
29
|
-
unless
|
30
|
-
|
25
|
+
# -> referenceSystemParameters.verticalDatum.datumName
|
26
|
+
datumName = xDepthSys.xpath('./depthdn').text
|
27
|
+
unless datumName.empty?
|
28
|
+
hDatum[:datumName] = datumName
|
31
29
|
end
|
32
30
|
|
33
31
|
# depth datum 4.2.2.2 (depthres) - depth resolution [] (take first)
|
@@ -53,7 +51,6 @@ module ADIWG
|
|
53
51
|
|
54
52
|
hParamSet = intMetadataClass.newReferenceSystemParameterSet
|
55
53
|
hRefSystem = intMetadataClass.newSpatialReferenceSystem
|
56
|
-
hDatum[:datumIdentifier] = hIdentifier
|
57
54
|
hParamSet[:verticalDatum] = hDatum
|
58
55
|
hRefSystem[:systemParameterSet] = hParamSet
|
59
56
|
return hRefSystem
|
@@ -0,0 +1,95 @@
|
|
1
|
+
# unpack spatial reference system ellipsoid
|
2
|
+
# Reader - ADIwg JSON to internal data structure
|
3
|
+
|
4
|
+
# History:
|
5
|
+
# Stan Smith 2017-10-23 original script
|
6
|
+
|
7
|
+
require_relative 'module_identifier'
|
8
|
+
|
9
|
+
module ADIWG
|
10
|
+
module Mdtranslator
|
11
|
+
module Readers
|
12
|
+
module MdJson
|
13
|
+
|
14
|
+
module Geodetic
|
15
|
+
|
16
|
+
def self.unpack(hGeodetic, responseObj)
|
17
|
+
|
18
|
+
# return nil object if input is empty
|
19
|
+
if hGeodetic.empty?
|
20
|
+
responseObj[:readerExecutionMessages] << 'Geodetic object is empty'
|
21
|
+
responseObj[:readerExecutionPass] = false
|
22
|
+
return nil
|
23
|
+
end
|
24
|
+
|
25
|
+
# instance classes needed in script
|
26
|
+
intMetadataClass = InternalMetadata.new
|
27
|
+
intGeodetic = intMetadataClass.newGeodetic
|
28
|
+
|
29
|
+
# geodetic - datum identifier {identifier}
|
30
|
+
if hGeodetic.has_key?('datumIdentifier')
|
31
|
+
unless hGeodetic['datumIdentifier'].empty?
|
32
|
+
hReturn = Identifier.unpack(hGeodetic['datumIdentifier'], responseObj)
|
33
|
+
unless hReturn.nil?
|
34
|
+
intGeodetic[:datumIdentifier] = hReturn
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
# geodetic - datum name
|
40
|
+
if hGeodetic.has_key?('datumName')
|
41
|
+
if hGeodetic['datumName'] != ''
|
42
|
+
intGeodetic[:datumName] = hGeodetic['datumName']
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# geodetic - ellipsoid identifier {identifier}
|
47
|
+
if hGeodetic.has_key?('ellipsoidIdentifier')
|
48
|
+
unless hGeodetic['ellipsoidIdentifier'].empty?
|
49
|
+
hReturn = Identifier.unpack(hGeodetic['ellipsoidIdentifier'], responseObj)
|
50
|
+
unless hReturn.nil?
|
51
|
+
intGeodetic[:ellipsoidIdentifier] = hReturn
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
# geodetic - ellipsoid name (required)
|
57
|
+
if hGeodetic.has_key?('ellipsoidName')
|
58
|
+
intGeodetic[:ellipsoidName] = hGeodetic['ellipsoidName']
|
59
|
+
end
|
60
|
+
if intGeodetic[:ellipsoidName].nil? || intGeodetic[:ellipsoidName] == ''
|
61
|
+
responseObj[:readerExecutionMessages] << 'Ellipsoid name is missing'
|
62
|
+
responseObj[:readerExecutionPass] = false
|
63
|
+
return nil
|
64
|
+
end
|
65
|
+
|
66
|
+
# geodetic - semi-major axis
|
67
|
+
if hGeodetic.has_key?('semiMajorAxis')
|
68
|
+
if hGeodetic['semiMajorAxis'] != ''
|
69
|
+
intGeodetic[:semiMajorAxis] = hGeodetic['semiMajorAxis']
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
# geodetic - axis units
|
74
|
+
if hGeodetic.has_key?('axisUnits')
|
75
|
+
if hGeodetic['axisUnits'] != ''
|
76
|
+
intGeodetic[:axisUnits] = hGeodetic['axisUnits']
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
# geodetic - denominator of flattening ratio
|
81
|
+
if hGeodetic.has_key?('denominatorOfFlatteningRatio')
|
82
|
+
if hGeodetic['denominatorOfFlatteningRatio'] != ''
|
83
|
+
intGeodetic[:denominatorOfFlatteningRatio] = hGeodetic['denominatorOfFlatteningRatio']
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
return intGeodetic
|
88
|
+
end
|
89
|
+
|
90
|
+
end
|
91
|
+
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
@@ -71,20 +71,7 @@ module ADIWG
|
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
-
|
75
|
-
# resourceInfo.topicCategory [] << keyword
|
76
|
-
topicArray = []
|
77
|
-
if hKeyword.has_key?('keywordType')
|
78
|
-
if hKeyword['keywordType'] == 'isoTopicCategory'
|
79
|
-
hKeyword['keyword'].each do |hItem|
|
80
|
-
unless hItem.empty?
|
81
|
-
topicArray << hItem['keyword']
|
82
|
-
end
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
|
-
return intKeyword, topicArray
|
74
|
+
return intKeyword
|
88
75
|
|
89
76
|
end
|
90
77
|
|
@@ -37,20 +37,41 @@ module ADIWG
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
-
# projection parameters -
|
41
|
-
if hProjection.has_key?('
|
42
|
-
|
40
|
+
# projection parameters - grid system
|
41
|
+
if hProjection.has_key?('gridSystem')
|
42
|
+
if hProjection['gridSystem'] != ''
|
43
|
+
intProjection[:gridSystem] = hProjection['gridSystem']
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
# projection parameters - grid system name
|
48
|
+
if hProjection.has_key?('gridSystemName')
|
49
|
+
if hProjection['gridSystemName'] != ''
|
50
|
+
intProjection[:gridSystemName] = hProjection['gridSystemName']
|
51
|
+
end
|
43
52
|
end
|
44
|
-
|
45
|
-
|
53
|
+
|
54
|
+
# projection parameters - projection (required)
|
55
|
+
if hProjection.has_key?('projection')
|
56
|
+
intProjection[:projection] = hProjection['projection']
|
57
|
+
end
|
58
|
+
if intProjection[:projection].nil? || intProjection[:projection] == ''
|
59
|
+
responseObj[:readerExecutionMessages] << 'Spatial Reference Projection is missing'
|
46
60
|
responseObj[:readerExecutionPass] = false
|
47
61
|
return nil
|
48
62
|
end
|
49
63
|
|
64
|
+
# projection parameters - projection name
|
65
|
+
if hProjection.has_key?('projectionName')
|
66
|
+
if hProjection['projectionName'] != ''
|
67
|
+
intProjection[:projectionName] = hProjection['projectionName']
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
50
71
|
# projection parameters - zone
|
51
|
-
if hProjection.has_key?('
|
52
|
-
if hProjection['
|
53
|
-
intProjection[:
|
72
|
+
if hProjection.has_key?('gridZone')
|
73
|
+
if hProjection['gridZone'] != ''
|
74
|
+
intProjection[:gridZone] = hProjection['gridZone']
|
54
75
|
end
|
55
76
|
end
|
56
77
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
# Stan Smith 2017-10-23 original script
|
6
6
|
|
7
7
|
require_relative 'module_projectionParameters'
|
8
|
-
require_relative '
|
8
|
+
require_relative 'module_geodetic'
|
9
9
|
require_relative 'module_verticalDatum'
|
10
10
|
|
11
11
|
module ADIWG
|
@@ -39,11 +39,11 @@ module ADIWG
|
|
39
39
|
end
|
40
40
|
|
41
41
|
# reference system parameters - ellipsoid parameters
|
42
|
-
if hParams.has_key?('
|
43
|
-
unless hParams['
|
44
|
-
hReturn =
|
42
|
+
if hParams.has_key?('geodetic')
|
43
|
+
unless hParams['geodetic'].empty?
|
44
|
+
hReturn = Geodetic.unpack(hParams['geodetic'], responseObj)
|
45
45
|
unless hReturn.nil?
|
46
|
-
intParamSet[:
|
46
|
+
intParamSet[:geodetic] = hReturn
|
47
47
|
end
|
48
48
|
end
|
49
49
|
end
|
@@ -6,6 +6,7 @@
|
|
6
6
|
# ... topic category is now handled as keyword list
|
7
7
|
# Stan Smith 2016-11-01 original script
|
8
8
|
|
9
|
+
require 'adiwg/mdtranslator/internal/internal_metadata_obj'
|
9
10
|
require_relative 'module_resourceType'
|
10
11
|
require_relative 'module_citation'
|
11
12
|
require_relative 'module_timePeriod'
|
@@ -139,8 +140,20 @@ module ADIWG
|
|
139
140
|
# resource information - topic category (deprecated)
|
140
141
|
if hResInfo.has_key?('topicCategory')
|
141
142
|
unless hResInfo['topicCategory'].empty?
|
143
|
+
# move topicCategories to keywordObject
|
144
|
+
hKeyword = {}
|
145
|
+
hKeyword['keyword'] = []
|
146
|
+
hKeyword['keywordType'] = 'isoTopicCategory'
|
147
|
+
hResInfo['topicCategory'].each do |keyword|
|
148
|
+
hKeywordObj = {}
|
149
|
+
hKeywordObj['keyword'] = keyword
|
150
|
+
hKeyword['keyword'] << hKeywordObj
|
151
|
+
end
|
152
|
+
hReturn = Keyword.unpack(hKeyword, responseObj)
|
153
|
+
unless hReturn.nil?
|
154
|
+
intResInfo[:keywords] << hReturn[0]
|
155
|
+
end
|
142
156
|
responseObj[:readerExecutionMessages] << 'TopicCategory is deprecated, use keyword type isoTopicCategory instead'
|
143
|
-
responseObj[:readerExecutionPass] = false
|
144
157
|
end
|
145
158
|
end
|
146
159
|
|
@@ -274,8 +287,7 @@ module ADIWG
|
|
274
287
|
aItems.each do |item|
|
275
288
|
hReturn = Keyword.unpack(item, responseObj)
|
276
289
|
unless hReturn.nil?
|
277
|
-
intResInfo[:keywords] << hReturn
|
278
|
-
intResInfo[:topicCategories] = intResInfo[:topicCategories] | hReturn[1]
|
290
|
+
intResInfo[:keywords] << hReturn
|
279
291
|
end
|
280
292
|
end
|
281
293
|
end
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# Reader - ADIwg JSON to internal data structure
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2018-01-10 added reference system WKT
|
5
6
|
# Stan Smith 2017-10-23 added reference system parameter set
|
6
7
|
# Stan Smith 2016-10-16 refactored for mdJson 2.0
|
7
8
|
# Stan Smith 2015-07-14 refactored to remove global namespace constants
|
@@ -32,10 +33,13 @@ module ADIWG
|
|
32
33
|
intMetadataClass = InternalMetadata.new
|
33
34
|
intSpatialRef = intMetadataClass.newSpatialReferenceSystem
|
34
35
|
|
36
|
+
haveSystem = false
|
37
|
+
|
35
38
|
# spatial reference system - type
|
36
39
|
if hSpatialRef.has_key?('referenceSystemType')
|
37
40
|
if hSpatialRef['referenceSystemType'] != ''
|
38
41
|
intSpatialRef[:systemType] = hSpatialRef['referenceSystemType']
|
42
|
+
haveSystem = true
|
39
43
|
end
|
40
44
|
end
|
41
45
|
|
@@ -46,10 +50,19 @@ module ADIWG
|
|
46
50
|
hReturn = Identifier.unpack(hObject, responseObj)
|
47
51
|
unless hReturn.nil?
|
48
52
|
intSpatialRef[:systemIdentifier] = hReturn
|
53
|
+
haveSystem = true
|
49
54
|
end
|
50
55
|
end
|
51
56
|
end
|
52
57
|
|
58
|
+
# spatial reference system - wkt
|
59
|
+
if hSpatialRef.has_key?('referenceSystemWKT')
|
60
|
+
if hSpatialRef['referenceSystemWKT'] != ''
|
61
|
+
intSpatialRef[:systemWKT] = hSpatialRef['referenceSystemWKT']
|
62
|
+
haveSystem = true
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
53
66
|
# spatial reference system - reference system parameters {referenceSystemParameterSet}
|
54
67
|
if hSpatialRef.has_key?('referenceSystemParameterSet')
|
55
68
|
hObject = hSpatialRef['referenceSystemParameterSet']
|
@@ -57,14 +70,13 @@ module ADIWG
|
|
57
70
|
hReturn = ReferenceSystemParameters.unpack(hObject, responseObj)
|
58
71
|
unless hReturn.nil?
|
59
72
|
intSpatialRef[:systemParameterSet] = hReturn
|
73
|
+
haveSystem = true
|
60
74
|
end
|
61
75
|
end
|
62
76
|
end
|
63
77
|
|
64
|
-
|
65
|
-
|
66
|
-
intSpatialRef[:systemParameterSet].empty?
|
67
|
-
responseObj[:readerExecutionMessages] << 'Spatial Reference System must declare reference system type, identifier, or parameter set'
|
78
|
+
unless haveSystem
|
79
|
+
responseObj[:readerExecutionMessages] << 'Spatial Reference System must declare reference system type, identifier, WKT, or parameter set'
|
68
80
|
responseObj[:readerExecutionPass] = false
|
69
81
|
return nil
|
70
82
|
end
|
@@ -26,7 +26,7 @@ module ADIWG
|
|
26
26
|
intMetadataClass = InternalMetadata.new
|
27
27
|
intDatum = intMetadataClass.newVerticalDatum
|
28
28
|
|
29
|
-
# vertical datum - identifier {identifier}
|
29
|
+
# vertical datum - identifier {identifier}
|
30
30
|
if hDatum.has_key?('datumIdentifier')
|
31
31
|
unless hDatum['datumIdentifier'].empty?
|
32
32
|
hReturn = Identifier.unpack(hDatum['datumIdentifier'], responseObj)
|
@@ -35,21 +35,16 @@ module ADIWG
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
38
|
+
|
39
|
+
# vertical datum - datum name
|
40
|
+
if hDatum.has_key?('datumName')
|
41
|
+
intDatum[:datumName] = hDatum['datumName']
|
42
42
|
end
|
43
43
|
|
44
|
-
# vertical datum - encoding method
|
44
|
+
# vertical datum - encoding method
|
45
45
|
if hDatum.has_key?('encodingMethod')
|
46
46
|
intDatum[:encodingMethod] = hDatum['encodingMethod']
|
47
47
|
end
|
48
|
-
if intDatum[:encodingMethod].nil? || intDatum[:encodingMethod] == ''
|
49
|
-
responseObj[:readerExecutionMessages] << 'Vertical Datum Encoding Method is missing'
|
50
|
-
responseObj[:readerExecutionPass] = false
|
51
|
-
return nil
|
52
|
-
end
|
53
48
|
|
54
49
|
# vertical datum - is depth system {Boolean} (required)
|
55
50
|
if hDatum.has_key?('isDepthSystem')
|
@@ -58,25 +53,15 @@ module ADIWG
|
|
58
53
|
end
|
59
54
|
end
|
60
55
|
|
61
|
-
# vertical datum - vertical resolution
|
56
|
+
# vertical datum - vertical resolution
|
62
57
|
if hDatum.has_key?('verticalResolution')
|
63
58
|
intDatum[:verticalResolution] = hDatum['verticalResolution']
|
64
59
|
end
|
65
|
-
if intDatum[:verticalResolution].nil? || intDatum[:verticalResolution] == ''
|
66
|
-
responseObj[:readerExecutionMessages] << 'Vertical Resolution is missing'
|
67
|
-
responseObj[:readerExecutionPass] = false
|
68
|
-
return nil
|
69
|
-
end
|
70
60
|
|
71
|
-
# vertical datum - unit of measure
|
61
|
+
# vertical datum - unit of measure
|
72
62
|
if hDatum.has_key?('unitOfMeasure')
|
73
63
|
intDatum[:unitOfMeasure] = hDatum['unitOfMeasure']
|
74
64
|
end
|
75
|
-
if intDatum[:unitOfMeasure].nil? || intDatum[:unitOfMeasure] == ''
|
76
|
-
responseObj[:readerExecutionMessages] << 'Unit of Measure is missing'
|
77
|
-
responseObj[:readerExecutionPass] = false
|
78
|
-
return nil
|
79
|
-
end
|
80
65
|
|
81
66
|
return intDatum
|
82
67
|
end
|