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.
- checksums.yaml +4 -4
- data/.travis.yml +3 -3
- data/CHANGELOG.md +11 -4
- data/Rakefile +14 -14
- data/adiwg-mdtranslator.gemspec +3 -3
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +14 -14
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/gridSystems/grid_equalArcSecond.rb +69 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/gridSystems/grid_other.rb +42 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/gridSystems/grid_statePlane.rb +87 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/gridSystems/grid_ups.rb +58 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/gridSystems/grid_utm.rb +58 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_albers.rb +7 -7
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_azimuthEquidistant.rb +6 -6
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_common.rb +23 -22
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_equidistantConic.rb +7 -7
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_equirectangular.rb +6 -6
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_generalVertical.rb +7 -7
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_gnomonic.rb +6 -6
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_lambertConic.rb +7 -7
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_lambertEqualArea.rb +6 -6
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_mercator.rb +7 -7
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_millerCylinder.rb +5 -5
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_modifiedAlaska.rb +4 -4
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_obliqueMercator.rb +8 -8
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_orthographic.rb +6 -6
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_parameters.rb +20 -20
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_polarStereo.rb +8 -8
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_polyconic.rb +6 -6
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_robinson.rb +5 -5
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_sinusoidal.rb +5 -5
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_spaceOblique.rb +6 -6
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_stereographic.rb +6 -6
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_transverseMercator.rb +7 -7
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_vanDerGrinten.rb +5 -5
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_geodeticReference.rb +15 -7
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_geographicResolution.rb +6 -3
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_horizontalPlanar.rb +8 -6
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_horizontalReference.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/{module_mapLocalPlanar.rb → module_localPlanar.rb} +16 -8
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_localSystem.rb +23 -8
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapGridSystem.rb +21 -144
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapProjection.rb +48 -3
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/{module_mapCoordinateInfo.rb → module_planarCoordinateInfo.rb} +23 -11
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonomy.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_verticalAltitude.rb +5 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_verticalDepth.rb +6 -2
- data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_reader_messages_eng.yml +20 -5
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geodetic.rb +41 -8
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_localProjection.rb +57 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_obliqueLinePoint.rb +6 -6
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_projectionParameters.rb +36 -53
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_referenceSystemParameters.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomy.rb +39 -13
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_verticalDatum.rb +20 -8
- data/lib/adiwg/mdtranslator/version.rb +11 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geodeticReference.rb +8 -7
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geographicResolution.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_localPlanar.rb +63 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_localSystem.rb +30 -15
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_mapProjectionTags.rb +164 -109
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarGrid.rb +60 -61
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarInfo.rb +12 -12
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarMap.rb +87 -99
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarReference.rb +16 -41
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialReference.rb +12 -11
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomy.rb +9 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomySystem.rb +2 -3
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_verticalDatum.rb +8 -7
- data/lib/adiwg/mdtranslator/writers/fgdc/fgdc_writer_messages_eng.yml +13 -6
- data/lib/adiwg/mdtranslator/writers/html/sections/html_geodeticParameters.rb +16 -30
- data/lib/adiwg/mdtranslator/writers/html/sections/html_identifier.rb +8 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_obliqueLinePoint.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/html/sections/html_projectionParameters.rb +68 -57
- data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceInfo.rb +11 -6
- data/lib/adiwg/mdtranslator/writers/html/sections/html_spatialReference.rb +9 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_taxonomy.rb +13 -12
- data/lib/adiwg/mdtranslator/writers/html/sections/html_usage.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/html/sections/html_verticalDatumParameters.rb +9 -15
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_crs.rb +12 -15
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataIdentification.rb +9 -8
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_obliqueLinePoint.rb +6 -6
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_referenceSystem.rb +2 -1
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_taxonomy.rb +21 -10
- data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer_messages_eng.yml +4 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_geodeticParameters.rb +2 -3
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_identifier.rb +4 -2
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_localProjection.rb +31 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_obliqueLinePoint.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_projectionParameters.rb +5 -9
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_taxonomy.rb +6 -5
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_verticalDatumParameters.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/sbJson/sbJson_writer.rb +10 -0
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_contact.rb +21 -0
- metadata +17 -10
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarLocal.rb +0 -42
@@ -22,25 +22,25 @@ module ADIWG
|
|
22
22
|
@xml.tag!('gmd:MD_ObliqueLinePoint') do
|
23
23
|
|
24
24
|
# oblique line point - azimuth line latitude {integer}
|
25
|
-
r = hLinePoint[:
|
25
|
+
r = hLinePoint[:obliqueLineLatitude]
|
26
26
|
unless r.nil?
|
27
|
-
@xml.tag!('gmd:
|
27
|
+
@xml.tag!('gmd:obliqueLineLatitude') do
|
28
28
|
@xml.tag!('gco:real', r.to_s)
|
29
29
|
end
|
30
30
|
end
|
31
31
|
if r.nil? && @hResponseObj[:writerShowTags]
|
32
|
-
@xml.tag!('gmd:
|
32
|
+
@xml.tag!('gmd:obliqueLineLatitude')
|
33
33
|
end
|
34
34
|
|
35
35
|
# oblique line point - azimuth line longitude {real}
|
36
|
-
r = hLinePoint[:
|
36
|
+
r = hLinePoint[:obliqueLineLongitude]
|
37
37
|
unless r.nil?
|
38
|
-
@xml.tag!('gmd:
|
38
|
+
@xml.tag!('gmd:obliqueLineLongitude') do
|
39
39
|
@xml.tag!('gco:real', r.to_s)
|
40
40
|
end
|
41
41
|
end
|
42
42
|
if r.nil? && @hResponseObj[:writerShowTags]
|
43
|
-
@xml.tag!('gmd:
|
43
|
+
@xml.tag!('gmd:obliqueLineLongitude')
|
44
44
|
end
|
45
45
|
|
46
46
|
end # gmd:MD_ObliqueLinePoint
|
@@ -3,6 +3,7 @@
|
|
3
3
|
# 19115-2 output for ISO 19115-2 XML
|
4
4
|
|
5
5
|
# History:
|
6
|
+
# Stan Smith 2018-10-17 refactor to support schema 2.6.0 changes to projection
|
6
7
|
# Stan Smith 2017-10-26 added crs class
|
7
8
|
# Stan Smith 2016-12-07 refactored for mdTranslator/mdJson 2.0
|
8
9
|
# Stan Smith 2015-08-28 convert referenceSystem to resourceId and pass to RS_Identifier
|
@@ -53,7 +54,7 @@ module ADIWG
|
|
53
54
|
end
|
54
55
|
|
55
56
|
# CRS identifiers and parameters
|
56
|
-
|
57
|
+
unless hSystem[:systemParameterSet].empty?
|
57
58
|
crsClass.writeXML(hSystem[:systemParameterSet])
|
58
59
|
end
|
59
60
|
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# 19115-2 writer output in XML
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2018-10-19 refactor for mdJson schema 2.6.0
|
5
6
|
# Stan Smith 2018-04-10 add error and warning messaging
|
6
7
|
# Stan Smith 2016-12-09 refactored for mdTranslator/mdJson 2.0
|
7
8
|
# Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
|
@@ -11,6 +12,7 @@
|
|
11
12
|
# Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
|
12
13
|
# Stan Smith 2013-11-19 original script.
|
13
14
|
|
15
|
+
require 'adiwg/mdtranslator/internal/internal_metadata_obj'
|
14
16
|
require_relative '../iso19115_2_writer'
|
15
17
|
require_relative 'class_taxonomicSystem'
|
16
18
|
require_relative 'class_rsIdentifier'
|
@@ -34,6 +36,7 @@ module ADIWG
|
|
34
36
|
def writeXML(hSystem)
|
35
37
|
|
36
38
|
# classes used
|
39
|
+
intMetadataClass = InternalMetadata.new
|
37
40
|
taxonomicClass = TaxonomicSystem.new(@xml, @hResponseObj)
|
38
41
|
identifierClass = RS_Identifier.new(@xml, @hResponseObj)
|
39
42
|
partyClass = CI_ResponsibleParty.new(@xml, @hResponseObj)
|
@@ -64,16 +67,20 @@ module ADIWG
|
|
64
67
|
@xml.tag!('gmd:taxongen')
|
65
68
|
end
|
66
69
|
|
67
|
-
# taxon system - identification reference (required) [{
|
68
|
-
|
69
|
-
|
70
|
-
|
70
|
+
# taxon system - identification reference (required) [{citation}]
|
71
|
+
# convert to RS_Identifier
|
72
|
+
aCitations = hSystem[:idReferences]
|
73
|
+
aCitations.each do |hCitation|
|
74
|
+
unless hCitation.empty?
|
75
|
+
hIdentifier = intMetadataClass.newIdentifier
|
76
|
+
hIdentifier[:identifier] = 'missing'
|
77
|
+
hIdentifier[:citation] = hCitation
|
71
78
|
@xml.tag!('gmd:idref') do
|
72
79
|
identifierClass.writeXML(hIdentifier, 'taxon identification reference')
|
73
80
|
end
|
74
81
|
end
|
75
82
|
end
|
76
|
-
if
|
83
|
+
if aCitations.empty?
|
77
84
|
@NameSpace.issueWarning(311, 'gmd:idref')
|
78
85
|
end
|
79
86
|
|
@@ -126,14 +133,18 @@ module ADIWG
|
|
126
133
|
@xml.tag!('gmd:voucher')
|
127
134
|
end
|
128
135
|
|
129
|
-
# taxon system - taxonomy classification [] (required)
|
130
|
-
|
131
|
-
unless
|
136
|
+
# taxon system - taxonomy classification [0] (required)
|
137
|
+
aTaxClass = hSystem[:taxonClasses]
|
138
|
+
unless aTaxClass.empty?
|
132
139
|
@xml.tag!('gmd:taxonCl') do
|
133
|
-
taxonClass.writeXML(
|
140
|
+
taxonClass.writeXML(aTaxClass[0])
|
141
|
+
end
|
142
|
+
if aTaxClass.length > 1
|
143
|
+
@NameSpace.issueNotice(315, 'taxonomy')
|
144
|
+
@NameSpace.issueNotice(316, 'taxonomy')
|
134
145
|
end
|
135
146
|
end
|
136
|
-
if
|
147
|
+
if aTaxClass.empty?
|
137
148
|
@NameSpace.issueWarning(314, 'gmd:taxonCl')
|
138
149
|
end
|
139
150
|
|
@@ -22,6 +22,8 @@ messageList:
|
|
22
22
|
- {id: 50, message: "resource citation is missing"}
|
23
23
|
- {id: 51, message: "resource abstract is missing"}
|
24
24
|
- {id: 52, message: "resource point of contact is missing"}
|
25
|
+
- {id: 53, message: "multiple taxonomies were provided, ISO 19115-2 allows only one"}
|
26
|
+
- {id: 54, message: "the first taxonomy was written to the metadata record"}
|
25
27
|
|
26
28
|
- {id: 60, message: "data quality scope is missing"}
|
27
29
|
|
@@ -92,6 +94,8 @@ messageList:
|
|
92
94
|
- {id: 312, message: "taxonomic observer is missing"}
|
93
95
|
- {id: 313, message: "taxonomic procedures are missing"}
|
94
96
|
- {id: 314, message: "taxonomic classification is missing"}
|
97
|
+
- {id: 315, message: "multiple taxonomic classifications were specified, ISO 19115-2 supports only one"}
|
98
|
+
- {id: 316, message: "the first taxonomic classification was written to the metadata record"}
|
95
99
|
|
96
100
|
- {id: 320, message: "resource specific usage is missing"}
|
97
101
|
- {id: 321, message: "resource specific usage contact is missing"}
|
@@ -1,7 +1,8 @@
|
|
1
1
|
# mdJson 2.0 writer - spatial reference system ellipsoid parameters
|
2
2
|
|
3
3
|
# History:
|
4
|
-
#
|
4
|
+
# Stan Smith 2018-09-27 deprecated datumName and ellipsoidName
|
5
|
+
# Stan Smith 2017-10-24 original script
|
5
6
|
|
6
7
|
require 'jbuilder'
|
7
8
|
require_relative 'mdJson_identifier'
|
@@ -17,9 +18,7 @@ module ADIWG
|
|
17
18
|
|
18
19
|
Jbuilder.new do |json|
|
19
20
|
json.datumIdentifier Identifier.build(hGeodetic[:datumIdentifier]) unless hGeodetic[:datumIdentifier].empty?
|
20
|
-
json.datumName hGeodetic[:datumName]
|
21
21
|
json.ellipsoidIdentifier Identifier.build(hGeodetic[:ellipsoidIdentifier]) unless hGeodetic[:ellipsoidIdentifier].empty?
|
22
|
-
json.ellipsoidName hGeodetic[:ellipsoidName]
|
23
22
|
json.semiMajorAxis hGeodetic[:semiMajorAxis]
|
24
23
|
json.axisUnits hGeodetic[:axisUnits]
|
25
24
|
json.denominatorOfFlatteningRatio hGeodetic[:denominatorOfFlatteningRatio]
|
@@ -1,8 +1,9 @@
|
|
1
1
|
# mdJson 2.0 writer tests - identifier
|
2
2
|
|
3
3
|
# History:
|
4
|
-
#
|
5
|
-
#
|
4
|
+
# Stan Smith 2018-10-18 added 'name' for projectionIdentifier & gridIdentifier
|
5
|
+
# Stan Smith 2017-03-13 refactored for mdJson/mdTranslator 2.0
|
6
|
+
# Josh Bradley original script
|
6
7
|
|
7
8
|
require 'jbuilder'
|
8
9
|
require_relative 'mdJson_citation'
|
@@ -20,6 +21,7 @@ module ADIWG
|
|
20
21
|
json.identifier hIdentifier[:identifier]
|
21
22
|
json.namespace hIdentifier[:namespace]
|
22
23
|
json.version hIdentifier[:version]
|
24
|
+
json.name hIdentifier[:name]
|
23
25
|
json.description hIdentifier[:description]
|
24
26
|
json.authority Citation.build(hIdentifier[:citation]) unless hIdentifier[:citation].empty?
|
25
27
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# mdJson 2.0 writer - spatial reference system projection parameters
|
2
|
+
|
3
|
+
# History:
|
4
|
+
# Stan Smith 2018 10-18 original script
|
5
|
+
|
6
|
+
require 'jbuilder'
|
7
|
+
|
8
|
+
module ADIWG
|
9
|
+
module Mdtranslator
|
10
|
+
module Writers
|
11
|
+
module MdJson
|
12
|
+
|
13
|
+
module LocalProjection
|
14
|
+
|
15
|
+
@Namespace = ADIWG::Mdtranslator::Writers::MdJson
|
16
|
+
|
17
|
+
def self.build(hLocal)
|
18
|
+
|
19
|
+
Jbuilder.new do |json|
|
20
|
+
json.fixedToEarth hLocal[:fixedToEarth]
|
21
|
+
json.description hLocal[:description]
|
22
|
+
json.georeference hLocal[:georeference]
|
23
|
+
end
|
24
|
+
|
25
|
+
end # build
|
26
|
+
end # LocalProjection
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -15,8 +15,8 @@ module ADIWG
|
|
15
15
|
def self.build(hLinePoint)
|
16
16
|
|
17
17
|
Jbuilder.new do |json|
|
18
|
-
json.
|
19
|
-
json.
|
18
|
+
json.obliqueLineLatitude hLinePoint[:obliqueLineLatitude]
|
19
|
+
json.obliqueLineLongitude hLinePoint[:obliqueLineLongitude]
|
20
20
|
end
|
21
21
|
|
22
22
|
end # build
|
@@ -1,11 +1,13 @@
|
|
1
1
|
# mdJson 2.0 writer - spatial reference system projection parameters
|
2
2
|
|
3
3
|
# History:
|
4
|
-
#
|
4
|
+
# Stan Smith 2018 10-18 refactor for mdJson schema 2.6.0
|
5
|
+
# Stan Smith 2017-10-24 original script
|
5
6
|
|
6
7
|
require 'jbuilder'
|
7
8
|
require_relative 'mdJson_identifier'
|
8
9
|
require_relative 'mdJson_obliqueLinePoint'
|
10
|
+
require_relative 'mdJson_localProjection'
|
9
11
|
|
10
12
|
module ADIWG
|
11
13
|
module Mdtranslator
|
@@ -20,11 +22,8 @@ module ADIWG
|
|
20
22
|
|
21
23
|
Jbuilder.new do |json|
|
22
24
|
json.projectionIdentifier Identifier.build(hProjection[:projectionIdentifier]) unless hProjection[:projectionIdentifier].empty?
|
23
|
-
json.
|
24
|
-
json.gridSystemName hProjection[:gridSystemName]
|
25
|
+
json.gridIdentifier Identifier.build(hProjection[:gridIdentifier]) unless hProjection[:gridIdentifier].empty?
|
25
26
|
json.gridZone hProjection[:gridZone]
|
26
|
-
json.projection hProjection[:projection]
|
27
|
-
json.projectionName hProjection[:projectionName]
|
28
27
|
json.standardParallel1 hProjection[:standardParallel1]
|
29
28
|
json.standardParallel2 hProjection[:standardParallel2]
|
30
29
|
json.longitudeOfCentralMeridian hProjection[:longitudeOfCentralMeridian]
|
@@ -45,10 +44,7 @@ module ADIWG
|
|
45
44
|
json.obliqueLinePoint @Namespace.json_map(hProjection[:obliqueLinePoints], ObliqueLinePoint)
|
46
45
|
json.landsatNumber hProjection[:landsatNumber]
|
47
46
|
json.landsatPath hProjection[:landsatPath]
|
48
|
-
json.
|
49
|
-
json.localPlanarGeoreference hProjection[:localPlanarGeoreference]
|
50
|
-
json.otherGridDescription hProjection[:otherGridDescription]
|
51
|
-
json.otherProjectionDescription hProjection[:otherProjectionDescription]
|
47
|
+
json.local LocalProjection.build(hProjection[:local]) unless hProjection[:local].empty?
|
52
48
|
end
|
53
49
|
|
54
50
|
end # build
|
@@ -1,12 +1,13 @@
|
|
1
1
|
# mdJson 2.0 writer - taxonomy
|
2
2
|
|
3
3
|
# History:
|
4
|
-
#
|
5
|
-
#
|
4
|
+
# Stan Smith 2018-10-26 refactor for mdJson schema 2.6.0
|
5
|
+
# Stan Smith 2017-03-17 refactored for mdJson/mdTranslator 2.0
|
6
|
+
# Josh Bradley original script
|
6
7
|
|
7
8
|
require 'jbuilder'
|
8
9
|
require_relative 'mdJson_taxonomicSystem'
|
9
|
-
require_relative '
|
10
|
+
require_relative 'mdJson_citation'
|
10
11
|
require_relative 'mdJson_responsibleParty'
|
11
12
|
require_relative 'mdJson_voucher'
|
12
13
|
require_relative 'mdJson_taxonomicClassification'
|
@@ -25,12 +26,12 @@ module ADIWG
|
|
25
26
|
Jbuilder.new do |json|
|
26
27
|
json.taxonomicSystem @Namespace.json_map(hTaxonomy[:taxonSystem], TaxonomicSystem)
|
27
28
|
json.generalScope hTaxonomy[:generalScope]
|
28
|
-
json.identificationReference @Namespace.json_map(hTaxonomy[:idReferences],
|
29
|
+
json.identificationReference @Namespace.json_map(hTaxonomy[:idReferences], Citation)
|
29
30
|
json.observer @Namespace.json_map(hTaxonomy[:observers], ResponsibleParty)
|
30
31
|
json.identificationProcedure hTaxonomy[:idProcedure]
|
31
32
|
json.identificationCompleteness hTaxonomy[:idCompleteness]
|
32
33
|
json.voucher @Namespace.json_map(hTaxonomy[:vouchers], Voucher)
|
33
|
-
json.taxonomicClassification
|
34
|
+
json.taxonomicClassification @Namespace.json_map(hTaxonomy[:taxonClasses], TaxonomicClassification)
|
34
35
|
end
|
35
36
|
|
36
37
|
end # build
|
@@ -1,7 +1,8 @@
|
|
1
1
|
# mdJson 2.0 writer - spatial reference system vertical datum parameters
|
2
2
|
|
3
3
|
# History:
|
4
|
-
#
|
4
|
+
# Stan Smith 2018-09-26 datumName is deprecated
|
5
|
+
# Stan Smith 2017-10-24 original script
|
5
6
|
|
6
7
|
require 'jbuilder'
|
7
8
|
require_relative 'mdJson_identifier'
|
@@ -17,7 +18,6 @@ module ADIWG
|
|
17
18
|
|
18
19
|
Jbuilder.new do |json|
|
19
20
|
json.datumIdentifier Identifier.build(hDatum[:datumIdentifier]) unless hDatum[:datumIdentifier].empty?
|
20
|
-
json.datumName hDatum[:datumName]
|
21
21
|
json.encodingMethod hDatum[:encodingMethod]
|
22
22
|
json.isDepthSystem hDatum[:isDepthSystem]
|
23
23
|
json.verticalResolution hDatum[:verticalResolution]
|
@@ -53,6 +53,16 @@ module ADIWG
|
|
53
53
|
{}
|
54
54
|
end
|
55
55
|
|
56
|
+
# find contact in contact array and return the contact index
|
57
|
+
def self.get_contact_index_by_id(contactId)
|
58
|
+
@contacts.each_with_index do |hContact, index|
|
59
|
+
if hContact[:contactId] == contactId
|
60
|
+
return index
|
61
|
+
end
|
62
|
+
end
|
63
|
+
{}
|
64
|
+
end
|
65
|
+
|
56
66
|
# ignore jBuilder object mapping when array is empty
|
57
67
|
def self.json_map(collection = [], _class)
|
58
68
|
if collection.nil? || collection.empty?
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# sbJson 1.0 writer
|
2
2
|
|
3
3
|
# History:
|
4
|
+
# Stan Smith 2018-09-28 add budget sourceId and recipientId to contacts list
|
4
5
|
# Stan Smith 2018-09-05 skip responsibility objects in associatedResource
|
5
6
|
# Stan Smith 2017-05-25 refactored for mdJson/mdTranslator 2.0
|
6
7
|
# Josh Bradley original script
|
@@ -42,6 +43,26 @@ module ADIWG
|
|
42
43
|
aContactList << { :role => sbRole, :index => hParty[:contactIndex] }
|
43
44
|
end
|
44
45
|
end
|
46
|
+
|
47
|
+
# add sourceId and recipientId contacts
|
48
|
+
unless intObj[:metadata][:funding].empty?
|
49
|
+
aFunding = intObj[:metadata][:funding]
|
50
|
+
aFunding.each do |hFunding|
|
51
|
+
hFunding[:allocations].each do |hAllocation|
|
52
|
+
unless hAllocation[:sourceId].nil?
|
53
|
+
contactId = hAllocation[:sourceId]
|
54
|
+
sourceIndex = @Namespace.get_contact_index_by_id(contactId)
|
55
|
+
aContactList << { :role => 'funder', :index => sourceIndex }
|
56
|
+
end
|
57
|
+
unless hAllocation[:recipientId].nil?
|
58
|
+
contactId = hAllocation[:recipientId]
|
59
|
+
recipientIndex = @Namespace.get_contact_index_by_id(contactId)
|
60
|
+
aContactList << { :role => '', :index => recipientIndex }
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
45
66
|
aContactList = aContactList.uniq
|
46
67
|
|
47
68
|
end
|
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.
|
4
|
+
version: 2.14.0
|
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-
|
12
|
+
date: 2018-10-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -129,28 +129,28 @@ dependencies:
|
|
129
129
|
requirements:
|
130
130
|
- - ">="
|
131
131
|
- !ruby/object:Gem::Version
|
132
|
-
version: 2.
|
132
|
+
version: '2.6'
|
133
133
|
type: :runtime
|
134
134
|
prerelease: false
|
135
135
|
version_requirements: !ruby/object:Gem::Requirement
|
136
136
|
requirements:
|
137
137
|
- - ">="
|
138
138
|
- !ruby/object:Gem::Version
|
139
|
-
version: 2.
|
139
|
+
version: '2.6'
|
140
140
|
- !ruby/object:Gem::Dependency
|
141
141
|
name: adiwg-mdcodes
|
142
142
|
requirement: !ruby/object:Gem::Requirement
|
143
143
|
requirements:
|
144
144
|
- - "~>"
|
145
145
|
- !ruby/object:Gem::Version
|
146
|
-
version: 2.
|
146
|
+
version: '2.7'
|
147
147
|
type: :runtime
|
148
148
|
prerelease: false
|
149
149
|
version_requirements: !ruby/object:Gem::Requirement
|
150
150
|
requirements:
|
151
151
|
- - "~>"
|
152
152
|
- !ruby/object:Gem::Version
|
153
|
-
version: 2.
|
153
|
+
version: '2.7'
|
154
154
|
- !ruby/object:Gem::Dependency
|
155
155
|
name: jbuilder
|
156
156
|
requirement: !ruby/object:Gem::Requirement
|
@@ -237,6 +237,11 @@ files:
|
|
237
237
|
- lib/adiwg/mdtranslator/internal/module_coordinates.rb
|
238
238
|
- lib/adiwg/mdtranslator/internal/module_dateTimeFun.rb
|
239
239
|
- lib/adiwg/mdtranslator/readers/fgdc/fgdc_reader.rb
|
240
|
+
- lib/adiwg/mdtranslator/readers/fgdc/modules/gridSystems/grid_equalArcSecond.rb
|
241
|
+
- lib/adiwg/mdtranslator/readers/fgdc/modules/gridSystems/grid_other.rb
|
242
|
+
- lib/adiwg/mdtranslator/readers/fgdc/modules/gridSystems/grid_statePlane.rb
|
243
|
+
- lib/adiwg/mdtranslator/readers/fgdc/modules/gridSystems/grid_ups.rb
|
244
|
+
- lib/adiwg/mdtranslator/readers/fgdc/modules/gridSystems/grid_utm.rb
|
240
245
|
- lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_albers.rb
|
241
246
|
- lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_azimuthEquidistant.rb
|
242
247
|
- lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_common.rb
|
@@ -281,10 +286,9 @@ files:
|
|
281
286
|
- lib/adiwg/mdtranslator/readers/fgdc/modules/module_identification.rb
|
282
287
|
- lib/adiwg/mdtranslator/readers/fgdc/modules/module_keyword.rb
|
283
288
|
- lib/adiwg/mdtranslator/readers/fgdc/modules/module_lineage.rb
|
289
|
+
- lib/adiwg/mdtranslator/readers/fgdc/modules/module_localPlanar.rb
|
284
290
|
- lib/adiwg/mdtranslator/readers/fgdc/modules/module_localSystem.rb
|
285
|
-
- lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapCoordinateInfo.rb
|
286
291
|
- lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapGridSystem.rb
|
287
|
-
- lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapLocalPlanar.rb
|
288
292
|
- lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapProjection.rb
|
289
293
|
- lib/adiwg/mdtranslator/readers/fgdc/modules/module_metadataInfo.rb
|
290
294
|
- lib/adiwg/mdtranslator/readers/fgdc/modules/module_methodology.rb
|
@@ -292,6 +296,7 @@ files:
|
|
292
296
|
- lib/adiwg/mdtranslator/readers/fgdc/modules/module_onlineOption.rb
|
293
297
|
- lib/adiwg/mdtranslator/readers/fgdc/modules/module_onlineResource.rb
|
294
298
|
- lib/adiwg/mdtranslator/readers/fgdc/modules/module_orderProcess.rb
|
299
|
+
- lib/adiwg/mdtranslator/readers/fgdc/modules/module_planarCoordinateInfo.rb
|
295
300
|
- lib/adiwg/mdtranslator/readers/fgdc/modules/module_pointVector.rb
|
296
301
|
- lib/adiwg/mdtranslator/readers/fgdc/modules/module_process.rb
|
297
302
|
- lib/adiwg/mdtranslator/readers/fgdc/modules/module_publication.rb
|
@@ -370,6 +375,7 @@ files:
|
|
370
375
|
- lib/adiwg/mdtranslator/readers/mdJson/modules/module_keywordObject.rb
|
371
376
|
- lib/adiwg/mdtranslator/readers/mdJson/modules/module_legalConstraint.rb
|
372
377
|
- lib/adiwg/mdtranslator/readers/mdJson/modules/module_lineage.rb
|
378
|
+
- lib/adiwg/mdtranslator/readers/mdJson/modules/module_localProjection.rb
|
373
379
|
- lib/adiwg/mdtranslator/readers/mdJson/modules/module_locale.rb
|
374
380
|
- lib/adiwg/mdtranslator/readers/mdJson/modules/module_maintenance.rb
|
375
381
|
- lib/adiwg/mdtranslator/readers/mdJson/modules/module_mdJson.rb
|
@@ -467,6 +473,7 @@ files:
|
|
467
473
|
- lib/adiwg/mdtranslator/writers/fgdc/classes/class_identification.rb
|
468
474
|
- lib/adiwg/mdtranslator/writers/fgdc/classes/class_keyword.rb
|
469
475
|
- lib/adiwg/mdtranslator/writers/fgdc/classes/class_lineage.rb
|
476
|
+
- lib/adiwg/mdtranslator/writers/fgdc/classes/class_localPlanar.rb
|
470
477
|
- lib/adiwg/mdtranslator/writers/fgdc/classes/class_localSystem.rb
|
471
478
|
- lib/adiwg/mdtranslator/writers/fgdc/classes/class_mapProjectionTags.rb
|
472
479
|
- lib/adiwg/mdtranslator/writers/fgdc/classes/class_metadataInfo.rb
|
@@ -478,7 +485,6 @@ files:
|
|
478
485
|
- lib/adiwg/mdtranslator/writers/fgdc/classes/class_phone.rb
|
479
486
|
- lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarGrid.rb
|
480
487
|
- lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarInfo.rb
|
481
|
-
- lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarLocal.rb
|
482
488
|
- lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarMap.rb
|
483
489
|
- lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarReference.rb
|
484
490
|
- lib/adiwg/mdtranslator/writers/fgdc/classes/class_process.rb
|
@@ -764,6 +770,7 @@ files:
|
|
764
770
|
- lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_keywordObject.rb
|
765
771
|
- lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_legalConstraint.rb
|
766
772
|
- lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_lineageInfo.rb
|
773
|
+
- lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_localProjection.rb
|
767
774
|
- lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_locale.rb
|
768
775
|
- lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_maintenance.rb
|
769
776
|
- lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_mdJson.rb
|
@@ -847,7 +854,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
847
854
|
requirements:
|
848
855
|
- - ">="
|
849
856
|
- !ruby/object:Gem::Version
|
850
|
-
version: '2.
|
857
|
+
version: '2.3'
|
851
858
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
852
859
|
requirements:
|
853
860
|
- - ">="
|
@@ -1,42 +0,0 @@
|
|
1
|
-
# FGDC <<Class>> PlanarReference
|
2
|
-
# FGDC CSDGM writer output in XML
|
3
|
-
|
4
|
-
# History:
|
5
|
-
# Stan Smith 2018-03-21 original script
|
6
|
-
|
7
|
-
require_relative 'class_mapProjectionTags'
|
8
|
-
|
9
|
-
module ADIWG
|
10
|
-
module Mdtranslator
|
11
|
-
module Writers
|
12
|
-
module Fgdc
|
13
|
-
|
14
|
-
class PlanarLocal
|
15
|
-
|
16
|
-
def initialize(xml, hResponseObj)
|
17
|
-
@xml = xml
|
18
|
-
@hResponseObj = hResponseObj
|
19
|
-
end
|
20
|
-
|
21
|
-
def writeXML(hProjection)
|
22
|
-
|
23
|
-
# classes used
|
24
|
-
classTags = MapProjectionTags.new(@xml, @hResponseObj)
|
25
|
-
|
26
|
-
# planar 4.1.2.3 (localp) - local planar
|
27
|
-
projection = hProjection[:projection]
|
28
|
-
if projection == 'localPlanar'
|
29
|
-
hProjection[:projectionName] = 'local right-handed planar coordinate system'
|
30
|
-
@xml.tag!('localp') do
|
31
|
-
classTags.write_localDesc(hProjection)
|
32
|
-
classTags.write_localGeoInfo(hProjection)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
end # writeXML
|
37
|
-
end # PlanarReference
|
38
|
-
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|