adiwg-mdtranslator 2.12.0 → 2.13.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 +15 -1
- data/adiwg-mdtranslator.gemspec +1 -1
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +2 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/fgdc_reader.rb +4 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityAttribute.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_georectifiedRepresentation.rb +7 -12
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceInfo.rb +12 -11
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_source.rb +15 -7
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomy.rb +1 -6
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_timePeriod.rb +15 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_transferOption.rb +1 -3
- data/lib/adiwg/mdtranslator/version.rb +5 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_citation.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_contact.rb +4 -2
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicAge.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_identification.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_method.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_source.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomyKeywords.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomySystem.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_fcFeatureCatalogue.rb +7 -7
- data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb +6 -5
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_address.rb +104 -104
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_aggregateInformation.rb +63 -60
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/{class_attributeGroup.rb → class_attribute.rb} +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_baseUnit.rb +23 -23
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_boundingBox.rb +64 -60
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_browseGraphic.rb +55 -51
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_citation.rb +24 -14
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_contact.rb +96 -91
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_conventionalUnit.rb +45 -45
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_coverageDescription.rb +104 -77
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_crs.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataIdentification.rb +23 -8
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataQuality.rb +57 -52
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_date.rb +49 -46
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_definitionUnit.rb +20 -20
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_derivedUnit.rb +32 -32
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dimension.rb +56 -50
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_distribution.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_distributor.rb +77 -74
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_enumerationList.rb +34 -34
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_extension.rb +190 -186
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_extent.rb +66 -66
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_feature.rb +50 -45
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_featureCollection.rb +35 -35
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_featureProperties.rb +43 -43
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_format.rb +73 -69
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_fraction.rb +37 -33
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geographicElement.rb +59 -54
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geographicExtent.rb +58 -58
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geometricObjects.rb +49 -46
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geometryCollection.rb +68 -63
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_georectified.rb +113 -110
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_georeferenceable.rb +78 -75
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gmlIdentifier.rb +17 -17
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_grid.rb +55 -52
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gridRepresentation.rb +19 -19
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_hierarchy.rb +47 -47
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_image.rb +132 -132
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_keyword.rb +5 -2
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_lineString.rb +70 -70
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_lineage.rb +55 -55
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_locale.rb +51 -48
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_maintenance.rb +114 -105
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_mdBand.rb +111 -111
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_mdIdentifier.rb +9 -3
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_measure.rb +58 -41
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_medium.rb +104 -104
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_miBand.rb +70 -70
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_miMetadata.rb +51 -16
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_multiLine.rb +70 -70
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_multiPoint.rb +70 -70
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_multiPolygon.rb +70 -70
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_onlineResource.rb +79 -76
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_orderProcess.rb +67 -67
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_phone.rb +67 -67
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_point.rb +8 -8
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_polygon.rb +89 -89
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_processStep.rb +9 -3
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_rangeDimension.rb +59 -54
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_referenceSystem.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_resolution.rb +47 -47
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_responsibleParty.rb +111 -105
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_rsIdentifier.rb +71 -65
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_scope.rb +54 -50
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_scopeDescription.rb +45 -42
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_securityConstraints.rb +92 -89
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_series.rb +55 -55
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_source.rb +98 -91
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_spatialRepresentation.rb +42 -42
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_taxonomicClassification.rb +63 -59
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_taxonomicSystem.rb +40 -40
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_taxonomy.rb +133 -130
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_temporalExtent.rb +49 -49
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_timeInstant.rb +60 -60
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_timePeriod.rb +110 -108
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_transferOptions.rb +71 -69
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_unitsOfMeasure.rb +243 -243
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_usage.rb +98 -95
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_useConstraints.rb +38 -38
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_vectorRepresentation.rb +48 -48
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_verticalExtent.rb +74 -70
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_vouchers.rb +56 -53
- data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer.rb +61 -11
- data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer_messages_eng.yml +109 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_2/version.rb +3 -2
- data/lib/adiwg/mdtranslator_cli.rb +21 -4
- metadata +6 -5
@@ -2,85 +2,91 @@
|
|
2
2
|
# 19115-2 output for ISO 19115-2 XML
|
3
3
|
|
4
4
|
# History:
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
5
|
+
# Stan Smith 2018-04-10 add error and warning messaging
|
6
|
+
# Stan Smith 2016-11-29 refactored for mdTranslator/mdJson 2.0
|
7
|
+
# Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
|
8
|
+
# Stan Smith 2015-07-14 refactored to make iso19110 independent of iso19115_2 classes
|
9
|
+
# Stan Smith 2015-06-22 replace global ($response) with passed in object (hResponseObj)
|
10
|
+
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
11
|
+
# Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
|
12
|
+
# Stan Smith 2014-05-28 revised for json schema 0.5.0
|
12
13
|
# Stan Smith 2014-05-16 original script
|
13
14
|
|
15
|
+
require_relative '../iso19115_2_writer'
|
14
16
|
require_relative 'class_citation'
|
15
17
|
|
16
18
|
module ADIWG
|
17
|
-
|
18
|
-
|
19
|
-
|
19
|
+
module Mdtranslator
|
20
|
+
module Writers
|
21
|
+
module Iso19115_2
|
20
22
|
|
21
|
-
|
23
|
+
class RS_Identifier
|
22
24
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
25
|
+
def initialize(xml, hResponseObj)
|
26
|
+
@xml = xml
|
27
|
+
@hResponseObj = hResponseObj
|
28
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_2
|
29
|
+
end
|
27
30
|
|
28
|
-
|
31
|
+
def writeXML(hIdentifier, inContext = nil)
|
29
32
|
|
30
|
-
|
31
|
-
|
33
|
+
outContext = 'identifier'
|
34
|
+
outContext = inContext + ' authority' unless inContext.nil?
|
32
35
|
|
33
|
-
|
36
|
+
# classes used in MD_Metadata
|
37
|
+
citationClass = CI_Citation.new(@xml, @hResponseObj)
|
34
38
|
|
35
|
-
|
36
|
-
hCitation = hIdentifier[:citation]
|
37
|
-
unless hCitation.empty?
|
38
|
-
@xml.tag!('gmd:authority') do
|
39
|
-
citationClass.writeXML(hCitation)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
if hCitation.empty? && @hResponseObj[:writerShowTags]
|
43
|
-
@xml.tag!('gmd:authority')
|
44
|
-
end
|
39
|
+
@xml.tag!('gmd:RS_Identifier') do
|
45
40
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
41
|
+
# identifier - authority {CI_Citation}
|
42
|
+
hCitation = hIdentifier[:citation]
|
43
|
+
unless hCitation.empty?
|
44
|
+
@xml.tag!('gmd:authority') do
|
45
|
+
citationClass.writeXML(hCitation, outContext)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
if hCitation.empty? && @hResponseObj[:writerShowTags]
|
49
|
+
@xml.tag!('gmd:authority')
|
50
|
+
end
|
56
51
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
52
|
+
# identifier - code (required)
|
53
|
+
s = hIdentifier[:identifier]
|
54
|
+
unless s.nil?
|
55
|
+
@xml.tag!('gmd:code') do
|
56
|
+
@xml.tag!('gco:CharacterString', s)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
if s.nil?
|
60
|
+
@NameSpace.issueWarning(230, 'gmd:code', inContext)
|
61
|
+
end
|
67
62
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
63
|
+
# identifier - codeSpace
|
64
|
+
s = hIdentifier[:namespace]
|
65
|
+
unless s.nil?
|
66
|
+
@xml.tag!('gmd:codeSpace') do
|
67
|
+
@xml.tag!('gco:CharacterString', s)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
if s.nil? && @hResponseObj[:writerShowTags]
|
71
|
+
@xml.tag!('gmd:codeSpace')
|
72
|
+
end
|
78
73
|
|
79
|
-
|
80
|
-
|
81
|
-
|
74
|
+
# identifier - codeSpace version
|
75
|
+
s = hIdentifier[:version]
|
76
|
+
unless s.nil?
|
77
|
+
@xml.tag!('gmd:version') do
|
78
|
+
@xml.tag!('gco:CharacterString', s)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
if s.nil? && @hResponseObj[:writerShowTags]
|
82
|
+
@xml.tag!('gmd:version')
|
83
|
+
end
|
82
84
|
|
83
|
-
|
84
|
-
|
85
|
-
|
85
|
+
end # RS_Identifier tag
|
86
|
+
end # writeXML
|
87
|
+
end # RS_Identifier class
|
88
|
+
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
86
92
|
end
|
@@ -2,70 +2,74 @@
|
|
2
2
|
# 19115-2 writer output in XML
|
3
3
|
|
4
4
|
# History:
|
5
|
-
#
|
5
|
+
# Stan Smith 2018-04-10 add error and warning messaging
|
6
|
+
# Stan Smith 2016-12-13 original script
|
6
7
|
|
8
|
+
require_relative '../iso19115_2_writer'
|
7
9
|
require_relative 'class_codelist'
|
8
10
|
require_relative 'class_extent'
|
9
11
|
require_relative 'class_scopeDescription'
|
10
12
|
|
11
13
|
module ADIWG
|
12
|
-
|
13
|
-
|
14
|
-
|
14
|
+
module Mdtranslator
|
15
|
+
module Writers
|
16
|
+
module Iso19115_2
|
15
17
|
|
16
|
-
|
18
|
+
class DQ_Scope
|
17
19
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
20
|
+
def initialize(xml, responseObj)
|
21
|
+
@xml = xml
|
22
|
+
@hResponseObj = responseObj
|
23
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_2
|
24
|
+
end
|
22
25
|
|
23
|
-
|
26
|
+
def writeXML(hScope, inContext = nil)
|
24
27
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
28
|
+
# classes used
|
29
|
+
codelistClass = MD_Codelist.new(@xml, @hResponseObj)
|
30
|
+
extentClass = EX_Extent.new(@xml, @hResponseObj)
|
31
|
+
descriptionClass = MD_ScopeDescription.new(@xml, @hResponseObj)
|
29
32
|
|
30
|
-
|
33
|
+
@xml.tag!('gmd:DQ_Scope') do
|
31
34
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
35
|
+
# scope - level (required)
|
36
|
+
s = hScope[:scopeCode]
|
37
|
+
unless s.nil?
|
38
|
+
@xml.tag!('gmd:level') do
|
39
|
+
codelistClass.writeXML('gmd', 'iso_scope', s)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
if s.nil?
|
43
|
+
@NameSpace.issueWarning(280, 'gmd:level', inContext)
|
44
|
+
end
|
42
45
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
46
|
+
# scope - extent [0] {EX_Extent}
|
47
|
+
# ... only one extent allowed in ISO 19115-2
|
48
|
+
aExtents = hScope[:extents]
|
49
|
+
unless aExtents.empty?
|
50
|
+
@xml.tag!('gmd:extent') do
|
51
|
+
extentClass.writeXML(aExtents[0])
|
52
|
+
end
|
53
|
+
end
|
54
|
+
if aExtents.empty? && @hResponseObj[:writerShowTags]
|
55
|
+
@xml.tag!('gmd:extent')
|
56
|
+
end
|
53
57
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
58
|
+
# scope - level description [{MD_ScopeDescription}]
|
59
|
+
# ... write gmd:levelDescription tag from class_scopeDescription
|
60
|
+
aDescription = hScope[:scopeDescriptions]
|
61
|
+
aDescription.each do |hDescription|
|
62
|
+
descriptionClass.writeXML(hDescription)
|
63
|
+
end
|
64
|
+
if aDescription.empty? && @hResponseObj[:writerShowTags]
|
65
|
+
@xml.tag!('gmd:levelDescription')
|
66
|
+
end
|
63
67
|
|
64
|
-
|
65
|
-
|
66
|
-
|
68
|
+
end # gmd:DQ_Scope tag
|
69
|
+
end # writeXML
|
70
|
+
end # DQ_Scope class
|
67
71
|
|
68
|
-
|
69
|
-
|
70
|
-
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
71
75
|
end
|
@@ -5,50 +5,53 @@
|
|
5
5
|
# Stan Smith 2016-12-12 refactored for mdTranslator/mdJson 2.0
|
6
6
|
|
7
7
|
module ADIWG
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
8
|
+
module Mdtranslator
|
9
|
+
module Writers
|
10
|
+
module Iso19115_2
|
11
|
+
|
12
|
+
class MD_ScopeDescription
|
13
|
+
|
14
|
+
def initialize(xml, hResponseObj)
|
15
|
+
@xml = xml
|
16
|
+
@hResponseObj = hResponseObj
|
17
|
+
end
|
18
|
+
|
19
|
+
def writeXML(hScopeDesc)
|
20
|
+
|
21
|
+
# these scope description types not implemented -----------------------------
|
22
|
+
# attributes (ISO 19115-2 XSD type is set to 'empty')
|
23
|
+
# features (ISO 19115-2 XSD type is set to 'empty')
|
24
|
+
# featureInstances (not supported in mdJson)
|
25
|
+
# attributeInstances (not supported in mdJson)
|
26
|
+
|
27
|
+
# scope description - dataset
|
28
|
+
sData = hScopeDesc[:dataset]
|
29
|
+
unless sData.nil?
|
30
|
+
@xml.tag!('gmd:levelDescription') do
|
31
|
+
@xml.tag!('gmd:MD_ScopeDescription') do
|
32
|
+
@xml.tag!('gmd:dataset') do
|
33
|
+
@xml.tag!('gco:CharacterString', sData)
|
34
|
+
end
|
31
35
|
end
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
# scope description - other
|
40
|
+
sOther = hScopeDesc[:other]
|
41
|
+
unless sOther.nil?
|
42
|
+
@xml.tag!('gmd:levelDescription') do
|
43
|
+
@xml.tag!('gmd:MD_ScopeDescription') do
|
44
|
+
@xml.tag!('gmd:other') do
|
45
|
+
@xml.tag!('gco:CharacterString', sOther)
|
46
|
+
end
|
43
47
|
end
|
48
|
+
end
|
49
|
+
end
|
44
50
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
end # writeXML
|
49
|
-
end # MD_ScopeDescription class
|
51
|
+
end # writeXML
|
52
|
+
end # MD_ScopeDescription class
|
50
53
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
54
57
|
end
|
@@ -2,98 +2,101 @@
|
|
2
2
|
# 19115-2 writer output in XML
|
3
3
|
|
4
4
|
# History:
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
5
|
+
# Stan Smith 2018-04-10 add error and warning messaging
|
6
|
+
# Stan Smith 2016-12-13 refactored for mdTranslator/mdJson 2.0
|
7
|
+
# Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
|
8
|
+
# Stan Smith 2015-07-14 refactored to make iso19110 independent of iso19115_2 classes
|
9
|
+
# Stan Smith 2015-06-22 replace global ($response) with passed in object (hResponseObj)
|
10
|
+
# Stan Smith 2015-06-11 change all codelists to use 'class_codelist' method
|
11
|
+
# Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
|
12
|
+
# Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
|
12
13
|
# Stan Smith 2013-11-01 original script.
|
13
14
|
|
15
|
+
require_relative '../iso19115_2_writer'
|
14
16
|
require_relative 'class_codelist'
|
15
17
|
|
16
18
|
module ADIWG
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
19
|
+
module Mdtranslator
|
20
|
+
module Writers
|
21
|
+
module Iso19115_2
|
22
|
+
|
23
|
+
class MD_SecurityConstraints
|
24
|
+
|
25
|
+
def initialize(xml, hResponseObj)
|
26
|
+
@xml = xml
|
27
|
+
@hResponseObj = hResponseObj
|
28
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_2
|
29
|
+
end
|
30
|
+
|
31
|
+
def writeXML(hConstraint)
|
32
|
+
|
33
|
+
# classes used
|
34
|
+
codelistClass = MD_Codelist.new(@xml, @hResponseObj)
|
35
|
+
|
36
|
+
@xml.tag!('gmd:MD_SecurityConstraints') do
|
37
|
+
|
38
|
+
# constraints - use limitation []
|
39
|
+
aUse = hConstraint[:useLimitation]
|
40
|
+
aUse.each do |useCon|
|
41
|
+
@xml.tag!('gmd:useLimitation') do
|
42
|
+
@xml.tag!('gco:CharacterString', useCon)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
if aUse.empty? && @hResponseObj[:writerShowTags]
|
46
|
+
@xml.tag!('gmd:useLimitation')
|
47
|
+
end
|
48
|
+
|
49
|
+
hSecurityCon = hConstraint[:securityConstraint]
|
50
|
+
|
51
|
+
# security constraints - classification code (required)
|
52
|
+
s = hSecurityCon[:classCode]
|
53
|
+
unless s.nil?
|
54
|
+
@xml.tag!('gmd:classification') do
|
55
|
+
codelistClass.writeXML('gmd', 'iso_classification', s)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
if s.nil?
|
59
|
+
@NameSpace.issueWarning(290, 'gmd:classification')
|
60
|
+
end
|
61
|
+
|
62
|
+
# security constraints - user note
|
63
|
+
s = hSecurityCon[:userNote]
|
64
|
+
unless s.nil?
|
65
|
+
@xml.tag!('gmd:userNote') do
|
66
|
+
@xml.tag!('gco:CharacterString', s)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
if s.nil? && @hResponseObj[:writerShowTags]
|
70
|
+
@xml.tag!('gmd:userNote')
|
71
|
+
end
|
72
|
+
|
73
|
+
# security constraints - classification system
|
74
|
+
s = hSecurityCon[:classSystem]
|
75
|
+
unless s.nil?
|
76
|
+
@xml.tag!('gmd:classificationSystem') do
|
77
|
+
@xml.tag!('gco:CharacterString', s)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
if s.nil? && @hResponseObj[:writerShowTags]
|
81
|
+
@xml.tag!('gmd:classificationSystem')
|
82
|
+
end
|
83
|
+
|
84
|
+
# security constraints - handling description
|
85
|
+
s = hSecurityCon[:handling]
|
86
|
+
unless s.nil?
|
87
|
+
@xml.tag!('gmd:handlingDescription') do
|
88
|
+
@xml.tag!('gco:CharacterString', s)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
if s.nil? && @hResponseObj[:writerShowTags]
|
92
|
+
@xml.tag!('gmd:handlingDescription')
|
93
|
+
end
|
94
|
+
|
95
|
+
end # MD_SecurityConstraints tag
|
96
|
+
end # writeXML
|
97
|
+
end # MD_SecurityConstraints class
|
98
|
+
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
99
102
|
end
|