adiwg-mdtranslator 2.14.2 → 2.15.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 +1 -1
- data/CHANGELOG.md +20 -5
- data/Rakefile +2 -0
- data/adiwg-mdtranslator.gemspec +2 -1
- data/lib/adiwg/mdtranslator.rb +1 -0
- data/lib/adiwg/mdtranslator/internal/module_codelistFun.rb +26 -0
- data/lib/adiwg/mdtranslator/internal/module_coordinates.rb +3 -0
- data/lib/adiwg/mdtranslator/internal/module_dateTimeFun.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_date.rb +0 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_dateTime.rb +0 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_keyword.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonSystem.rb +2 -4
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_contact.rb +0 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_date.rb +0 -2
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dateTime.rb +0 -2
- data/lib/adiwg/mdtranslator/readers/sbJson/modules/module_provenance.rb +0 -1
- data/lib/adiwg/mdtranslator/version.rb +3 -2
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_attribute.rb +0 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_citation.rb +0 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dateRange.rb +0 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dateSingle.rb +0 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_method.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_methodKeywords.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_process.rb +0 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_transferInfo.rb +0 -1
- data/lib/adiwg/mdtranslator/writers/html/sections/html_taxonomy.rb +1 -3
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_additionalDocument.rb +48 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_address.rb +90 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_associatedResource.rb +84 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_attribute.rb +107 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_attributeGroup.rb +69 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_baseUnit.rb +38 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_boundingBox.rb +70 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_browseGraphic.rb +95 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_citation.rb +205 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_codelist.rb +50 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_constraint.rb +51 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_constraintCommon.rb +104 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_contact.rb +119 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_conventionalUnit.rb +64 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_coverageDescription.rb +84 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_dataIdentification.rb +347 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_date.rb +62 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_definitionUnit.rb +35 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_derivedUnit.rb +42 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_dimension.rb +72 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_distribution.rb +62 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_distributor.rb +77 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_email.rb +44 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_extent.rb +85 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_feature.rb +71 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_featureCollection.rb +56 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_featureProperties.rb +64 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_format.rb +74 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_fraction.rb +46 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_gcoDateTime.rb +45 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_geographicElement.rb +77 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_geographicExtent.rb +96 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_geometricObjects.rb +60 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_geometryCollection.rb +97 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_georectified.rb +121 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_georeferenceable.rb +87 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_gmlIdentifier.rb +32 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_grid.rb +71 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_gridRepresentation.rb +36 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_identifier.rb +95 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_imageDescription.rb +175 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_individual.rb +85 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_keyword.rb +78 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_legalConstraints.rb +87 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_lineString.rb +76 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_lineage.rb +97 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_locale.rb +67 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_maintenance.rb +101 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_mdBand.rb +82 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_mdMetadata.rb +372 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_measure.rb +71 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_medium.rb +113 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_miBand.rb +90 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_multiLine.rb +84 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_multiPoint.rb +84 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_multiPolygon.rb +84 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_onlineResource.rb +91 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_orderProcess.rb +79 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_organization.rb +106 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_phone.rb +81 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_point.rb +77 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_polygon.rb +95 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_processStep.rb +130 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_rangeDimension.rb +94 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_referenceSystem.rb +92 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_releasability.rb +71 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_resolution.rb +97 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_responsibility.rb +91 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_sampleDimension.rb +127 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_scope.rb +75 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_scopeDescription.rb +75 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_securityConstraints.rb +97 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_series.rb +63 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_source.rb +125 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_spatialRepresentation.rb +61 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_temporalExtent.rb +53 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_timeInstant.rb +80 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_timePeriod.rb +113 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_transferOptions.rb +107 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_unitsOfMeasure.rb +258 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_usage.rb +134 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_useConstraints.rb +41 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_vectorRepresentation.rb +61 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_verticalExtent.rb +70 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/iso19115_1_writer.rb +105 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/iso19115_1_writer_messages_eng.yml +132 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/readme.md +12 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_1/version.rb +15 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_citation.rb +3 -2
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataIdentification.rb +42 -39
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataQuality.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_distributor.rb +3 -1
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_extension.rb +12 -7
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_miMetadata.rb +2 -3
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_referenceSystem.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_resolution.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_responsibleParty.rb +42 -35
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_spatialRepresentation.rb +4 -10
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_useConstraints.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer_messages_eng.yml +5 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_2/readme.md +2 -2
- data/lib/adiwg/mdtranslator/writers/iso19115_2/version.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/mdWriters.rb +7 -7
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_citation.rb +0 -1
- data/lib/adiwg/mdtranslator_cli.rb +2 -1
- metadata +93 -5
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_gmlIdentifier.rb +0 -55
@@ -0,0 +1,127 @@
|
|
1
|
+
# ISO <<Class>> MD_SampleDimension attributes
|
2
|
+
# 19115-1 writer output in XML
|
3
|
+
|
4
|
+
# History:
|
5
|
+
# Stan Smith 2019-04-08 original script.
|
6
|
+
|
7
|
+
require_relative '../iso19115_1_writer'
|
8
|
+
require_relative 'class_unitsOfMeasure'
|
9
|
+
|
10
|
+
module ADIWG
|
11
|
+
module Mdtranslator
|
12
|
+
module Writers
|
13
|
+
module Iso19115_1
|
14
|
+
|
15
|
+
class MD_SampleDimension
|
16
|
+
|
17
|
+
def initialize(xml, hResponseObj)
|
18
|
+
@xml = xml
|
19
|
+
@hResponseObj = hResponseObj
|
20
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_1
|
21
|
+
end
|
22
|
+
|
23
|
+
def writeXML(hAttribute, inContext = nil)
|
24
|
+
|
25
|
+
# classes used
|
26
|
+
uomClass = UnitsOfMeasure.new(@xml, @hResponseObj)
|
27
|
+
|
28
|
+
# sample dimension - max value {real}
|
29
|
+
unless hAttribute[:maxValue].nil?
|
30
|
+
@xml.tag!('mrc:maxValue') do
|
31
|
+
@xml.tag!('gco:Real', hAttribute[:maxValue])
|
32
|
+
end
|
33
|
+
end
|
34
|
+
if hAttribute[:maxValue].nil? && @hResponseObj[:writerShowTags]
|
35
|
+
@xml.tag!('mrc:maxValue')
|
36
|
+
end
|
37
|
+
|
38
|
+
# sample dimension - min value {real}
|
39
|
+
unless hAttribute[:minValue].nil?
|
40
|
+
@xml.tag!('mrc:minValue') do
|
41
|
+
@xml.tag!('gco:Real', hAttribute[:minValue])
|
42
|
+
end
|
43
|
+
end
|
44
|
+
if hAttribute[:minValue].nil? && @hResponseObj[:writerShowTags]
|
45
|
+
@xml.tag!('mrc:minValue')
|
46
|
+
end
|
47
|
+
|
48
|
+
# sample dimension - units {gml:unitsOfMeasure}
|
49
|
+
unless hAttribute[:units].nil?
|
50
|
+
@xml.tag!('mrc:units') do
|
51
|
+
uomClass.writeUnits(hAttribute[:units])
|
52
|
+
end
|
53
|
+
end
|
54
|
+
if hAttribute[:units].nil? && @hResponseObj[:writerShowTags]
|
55
|
+
@xml.tag!('mrc:units')
|
56
|
+
end
|
57
|
+
|
58
|
+
# sample dimension - scale factor {real}
|
59
|
+
unless hAttribute[:scaleFactor].nil?
|
60
|
+
@xml.tag!('mrc:scaleFactor') do
|
61
|
+
@xml.tag!('gco:Real', hAttribute[:scaleFactor])
|
62
|
+
end
|
63
|
+
end
|
64
|
+
if hAttribute[:scaleFactor].nil? && @hResponseObj[:writerShowTags]
|
65
|
+
@xml.tag!('mrc:scaleFactor')
|
66
|
+
end
|
67
|
+
|
68
|
+
# sample dimension - offset {real}
|
69
|
+
unless hAttribute[:offset].nil?
|
70
|
+
@xml.tag!('mrc:offset') do
|
71
|
+
@xml.tag!('gco:Real', hAttribute[:offset])
|
72
|
+
end
|
73
|
+
end
|
74
|
+
if hAttribute[:offset].nil? && @hResponseObj[:writerShowTags]
|
75
|
+
@xml.tag!('mrc:offset')
|
76
|
+
end
|
77
|
+
|
78
|
+
# sample dimension - mean value {real}
|
79
|
+
unless hAttribute[:meanValue].nil?
|
80
|
+
@xml.tag!('mrc:meanValue') do
|
81
|
+
@xml.tag!('gco:Real', hAttribute[:meanValue])
|
82
|
+
end
|
83
|
+
end
|
84
|
+
if hAttribute[:meanValue].nil? && @hResponseObj[:writerShowTags]
|
85
|
+
@xml.tag!('mrc:meanValue')
|
86
|
+
end
|
87
|
+
|
88
|
+
# sample dimension - number of values {integer}
|
89
|
+
unless hAttribute[:numberOfValues].nil?
|
90
|
+
@xml.tag!('mrc:numberOfValues') do
|
91
|
+
@xml.tag!('gco:Integer', hAttribute[:numberOfValues])
|
92
|
+
end
|
93
|
+
end
|
94
|
+
if hAttribute[:numberOfValues].nil? && @hResponseObj[:writerShowTags]
|
95
|
+
@xml.tag!('mrc:numberOfValues')
|
96
|
+
end
|
97
|
+
|
98
|
+
# sample dimension - standard deviation {real}
|
99
|
+
unless hAttribute[:standardDeviation].nil?
|
100
|
+
@xml.tag!('mrc:standardDeviation') do
|
101
|
+
@xml.tag!('gco:Real', hAttribute[:standardDeviation])
|
102
|
+
end
|
103
|
+
end
|
104
|
+
if hAttribute[:standardDeviation].nil? && @hResponseObj[:writerShowTags]
|
105
|
+
@xml.tag!('mrc:standardDeviation')
|
106
|
+
end
|
107
|
+
|
108
|
+
# sample dimension - other property type - not implemented
|
109
|
+
# sample dimension - other property - not implemented
|
110
|
+
|
111
|
+
# sample dimension - bits per value {integer}
|
112
|
+
unless hAttribute[:bitsPerValue].nil?
|
113
|
+
@xml.tag!('mrc:bitsPerValue') do
|
114
|
+
@xml.tag!('gco:Integer', hAttribute[:bitsPerValue])
|
115
|
+
end
|
116
|
+
end
|
117
|
+
if hAttribute[:bitsPerValue].nil? && @hResponseObj[:writerShowTags]
|
118
|
+
@xml.tag!('mrc:bitsPerValue')
|
119
|
+
end
|
120
|
+
|
121
|
+
end # writeXML
|
122
|
+
end # MD_SampleDescription
|
123
|
+
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# ISO <<Class>> MD_Scope
|
2
|
+
# 19115-1 writer output in XML
|
3
|
+
|
4
|
+
# History:
|
5
|
+
# Stan Smith 2019-03-18 original script
|
6
|
+
|
7
|
+
require_relative '../iso19115_1_writer'
|
8
|
+
require_relative 'class_codelist'
|
9
|
+
require_relative 'class_extent'
|
10
|
+
require_relative 'class_scopeDescription'
|
11
|
+
|
12
|
+
module ADIWG
|
13
|
+
module Mdtranslator
|
14
|
+
module Writers
|
15
|
+
module Iso19115_1
|
16
|
+
|
17
|
+
class MD_Scope
|
18
|
+
|
19
|
+
def initialize(xml, responseObj)
|
20
|
+
@xml = xml
|
21
|
+
@hResponseObj = responseObj
|
22
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_1
|
23
|
+
end
|
24
|
+
|
25
|
+
def writeXML(hScope, inContext = nil)
|
26
|
+
|
27
|
+
# classes used
|
28
|
+
codelistClass = MD_Codelist.new(@xml, @hResponseObj)
|
29
|
+
extentClass = EX_Extent.new(@xml, @hResponseObj)
|
30
|
+
descriptionClass = MD_ScopeDescription.new(@xml, @hResponseObj)
|
31
|
+
|
32
|
+
outContext = 'scope'
|
33
|
+
outContext = inContext + ' scope' unless inContext.nil?
|
34
|
+
|
35
|
+
@xml.tag!('mcc:MD_Scope') do
|
36
|
+
|
37
|
+
# scope - level (required)
|
38
|
+
unless hScope[:scopeCode].nil?
|
39
|
+
@xml.tag!('mcc:level') do
|
40
|
+
codelistClass.writeXML('mcc', 'iso_scope', hScope[:scopeCode])
|
41
|
+
end
|
42
|
+
end
|
43
|
+
if hScope[:scopeCode].nil?
|
44
|
+
@NameSpace.issueWarning(280, 'mcc:level', inContext)
|
45
|
+
end
|
46
|
+
|
47
|
+
# scope - extent [] {EX_Extent}
|
48
|
+
aExtents = hScope[:extents]
|
49
|
+
aExtents.each do |hExtent|
|
50
|
+
@xml.tag!('mcc:extent') do
|
51
|
+
extentClass.writeXML(hExtent, outContext)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
if aExtents.empty? && @hResponseObj[:writerShowTags]
|
55
|
+
@xml.tag!('mcc:extent')
|
56
|
+
end
|
57
|
+
|
58
|
+
# scope - level description [{MD_ScopeDescription}]
|
59
|
+
# ... write mcc: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!('mcc:levelDescription')
|
66
|
+
end
|
67
|
+
|
68
|
+
end # mcc:MD_Scope tag
|
69
|
+
end # writeXML
|
70
|
+
end # DQ_Scope class
|
71
|
+
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# ISO <<Class>> MD_ScopeDimension
|
2
|
+
# 19115-1 writer output in XML
|
3
|
+
|
4
|
+
# History:
|
5
|
+
# Stan Smith 2019-03-16 original script
|
6
|
+
|
7
|
+
module ADIWG
|
8
|
+
module Mdtranslator
|
9
|
+
module Writers
|
10
|
+
module Iso19115_1
|
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
|
+
# featureInstances (not supported in mdJson)
|
23
|
+
# attributeInstances (not supported in mdJson)
|
24
|
+
|
25
|
+
# scope description - dataset
|
26
|
+
unless hScopeDesc[:dataset].nil?
|
27
|
+
@xml.tag!('mcc:levelDescription') do
|
28
|
+
@xml.tag!('mcc:MD_ScopeDescription') do
|
29
|
+
@xml.tag!('mcc:dataset') do
|
30
|
+
@xml.tag!('gco:CharacterString', hScopeDesc[:dataset])
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
# scope description - attributes
|
37
|
+
unless hScopeDesc[:attributes].nil?
|
38
|
+
@xml.tag!('mcc:levelDescription') do
|
39
|
+
@xml.tag!('mcc:MD_ScopeDescription') do
|
40
|
+
@xml.tag!('mcc:attributes') do
|
41
|
+
@xml.tag!('gco:CharacterString', hScopeDesc[:attributes])
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
# scope description - features
|
48
|
+
unless hScopeDesc[:features].nil?
|
49
|
+
@xml.tag!('mcc:levelDescription') do
|
50
|
+
@xml.tag!('mcc:MD_ScopeDescription') do
|
51
|
+
@xml.tag!('mcc:features') do
|
52
|
+
@xml.tag!('gco:CharacterString', hScopeDesc[:features])
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
# scope description - other
|
59
|
+
unless hScopeDesc[:other].nil?
|
60
|
+
@xml.tag!('mcc:levelDescription') do
|
61
|
+
@xml.tag!('mcc:MD_ScopeDescription') do
|
62
|
+
@xml.tag!('mcc:other') do
|
63
|
+
@xml.tag!('gco:CharacterString', hScopeDesc[:other])
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
end # writeXML
|
70
|
+
end # MD_ScopeDescription class
|
71
|
+
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
# ISO <<Class>> MD_SecurityConstraints
|
2
|
+
# 19115-1 writer output in XML
|
3
|
+
|
4
|
+
# History:
|
5
|
+
# Stan Smith 2019-03-18 original script.
|
6
|
+
|
7
|
+
require_relative '../iso19115_1_writer'
|
8
|
+
require_relative 'class_codelist'
|
9
|
+
require_relative 'class_constraintCommon'
|
10
|
+
|
11
|
+
module ADIWG
|
12
|
+
module Mdtranslator
|
13
|
+
module Writers
|
14
|
+
module Iso19115_1
|
15
|
+
|
16
|
+
class MD_SecurityConstraints
|
17
|
+
|
18
|
+
def initialize(xml, hResponseObj)
|
19
|
+
@xml = xml
|
20
|
+
@hResponseObj = hResponseObj
|
21
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_1
|
22
|
+
end
|
23
|
+
|
24
|
+
def writeXML(hConstraint, inContext = nil)
|
25
|
+
|
26
|
+
# classes used
|
27
|
+
codelistClass = MD_Codelist.new(@xml, @hResponseObj)
|
28
|
+
commonClass = ConstraintCommon.new(@xml, @hResponseObj)
|
29
|
+
|
30
|
+
outContext = 'security constraint'
|
31
|
+
outContext = inContext + ' security constraint' unless inContext.nil?
|
32
|
+
|
33
|
+
hSecurityCon = hConstraint[:securityConstraint]
|
34
|
+
unless hSecurityCon.empty?
|
35
|
+
@xml.tag!('mco:MD_SecurityConstraints') do
|
36
|
+
|
37
|
+
# security constraints - use constraint elements
|
38
|
+
commonClass.writeXML(hConstraint, outContext)
|
39
|
+
|
40
|
+
# security constraints - classification code (required)
|
41
|
+
s = hSecurityCon[:classCode]
|
42
|
+
unless s.nil?
|
43
|
+
@xml.tag!('mco:classification') do
|
44
|
+
codelistClass.writeXML('mco', 'iso_classification', s)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
if s.nil?
|
48
|
+
@NameSpace.issueWarning(290, 'mco:classification')
|
49
|
+
end
|
50
|
+
|
51
|
+
# security constraints - user note
|
52
|
+
s = hSecurityCon[:userNote]
|
53
|
+
unless s.nil?
|
54
|
+
@xml.tag!('mco:userNote') do
|
55
|
+
@xml.tag!('gco:CharacterString', s)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
if s.nil? && @hResponseObj[:writerShowTags]
|
59
|
+
@xml.tag!('mco:userNote')
|
60
|
+
end
|
61
|
+
|
62
|
+
# security constraints - classification system
|
63
|
+
s = hSecurityCon[:classSystem]
|
64
|
+
unless s.nil?
|
65
|
+
@xml.tag!('mco:classificationSystem') do
|
66
|
+
@xml.tag!('gco:CharacterString', s)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
if s.nil? && @hResponseObj[:writerShowTags]
|
70
|
+
@xml.tag!('mco:classificationSystem')
|
71
|
+
end
|
72
|
+
|
73
|
+
# security constraints - handling description
|
74
|
+
s = hSecurityCon[:handling]
|
75
|
+
unless s.nil?
|
76
|
+
@xml.tag!('mco:handlingDescription') do
|
77
|
+
@xml.tag!('gco:CharacterString', s)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
if s.nil? && @hResponseObj[:writerShowTags]
|
81
|
+
@xml.tag!('mco:handlingDescription')
|
82
|
+
end
|
83
|
+
|
84
|
+
end # MD_SecurityConstraints tag
|
85
|
+
|
86
|
+
end
|
87
|
+
if hSecurityCon.empty?
|
88
|
+
@NameSpace.issueWarning(292, nil, outContext)
|
89
|
+
end
|
90
|
+
|
91
|
+
end # writeXML
|
92
|
+
end # MD_SecurityConstraints class
|
93
|
+
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# ISO <<Class>> CI_Series
|
2
|
+
# 19115-1 writer output in XML
|
3
|
+
|
4
|
+
# History:
|
5
|
+
# Stan Smith 2019-03-15 original script
|
6
|
+
|
7
|
+
module ADIWG
|
8
|
+
module Mdtranslator
|
9
|
+
module Writers
|
10
|
+
module Iso19115_1
|
11
|
+
|
12
|
+
class CI_Series
|
13
|
+
|
14
|
+
def initialize(xml, hResponseObj)
|
15
|
+
@xml = xml
|
16
|
+
@hResponseObj = hResponseObj
|
17
|
+
end
|
18
|
+
|
19
|
+
def writeXML(hSeries)
|
20
|
+
|
21
|
+
@xml.tag!('cit:CI_Series') do
|
22
|
+
|
23
|
+
# series - name
|
24
|
+
s = hSeries[:seriesName]
|
25
|
+
unless s.nil?
|
26
|
+
@xml.tag!('cit:name') do
|
27
|
+
@xml.tag!('gco:CharacterString', s)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
if s.nil? && @hResponseObj[:writerShowTags]
|
31
|
+
@xml.tag!('cit:name')
|
32
|
+
end
|
33
|
+
|
34
|
+
# series - issue identification
|
35
|
+
s = hSeries[:seriesIssue]
|
36
|
+
unless s.nil?
|
37
|
+
@xml.tag!('cit:issueIdentification') do
|
38
|
+
@xml.tag!('gco:CharacterString', s)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
if s.nil? && @hResponseObj[:writerShowTags]
|
42
|
+
@xml.tag!('cit:issueIdentification')
|
43
|
+
end
|
44
|
+
|
45
|
+
# series - page
|
46
|
+
s = hSeries[:issuePage]
|
47
|
+
unless s.nil?
|
48
|
+
@xml.tag!('cit:page') do
|
49
|
+
@xml.tag!('gco:CharacterString', s)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
if s.nil? && @hResponseObj[:writerShowTags]
|
53
|
+
@xml.tag!('cit:page')
|
54
|
+
end
|
55
|
+
|
56
|
+
end # CI_Series tag
|
57
|
+
end # writeXML
|
58
|
+
end # CI_Series class
|
59
|
+
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,125 @@
|
|
1
|
+
# ISO <<Class>> LI_Source
|
2
|
+
# 19115-1 writer output in XML
|
3
|
+
|
4
|
+
# History:
|
5
|
+
# Stan Smith 2019-04-10 original script.
|
6
|
+
|
7
|
+
require_relative 'class_resolution'
|
8
|
+
require_relative 'class_referenceSystem'
|
9
|
+
require_relative 'class_citation'
|
10
|
+
require_relative 'class_scope'
|
11
|
+
require_relative 'class_processStep'
|
12
|
+
|
13
|
+
module ADIWG
|
14
|
+
module Mdtranslator
|
15
|
+
module Writers
|
16
|
+
module Iso19115_1
|
17
|
+
|
18
|
+
class LI_Source
|
19
|
+
|
20
|
+
def initialize(xml, hResponseObj)
|
21
|
+
@xml = xml
|
22
|
+
@hResponseObj = hResponseObj
|
23
|
+
end
|
24
|
+
|
25
|
+
def writeXML(hSource, inContext = nil)
|
26
|
+
|
27
|
+
# classes used
|
28
|
+
resolutionClass = MD_Resolution.new(@xml, @hResponseObj)
|
29
|
+
referenceClass = MD_ReferenceSystem.new(@xml, @hResponseObj)
|
30
|
+
citationClass = CI_Citation.new(@xml, @hResponseObj)
|
31
|
+
scopeClass = MD_Scope.new(@xml, @hResponseObj)
|
32
|
+
stepClass = LI_ProcessStep.new(@xml, @hResponseObj)
|
33
|
+
|
34
|
+
outContext = 'source'
|
35
|
+
outContext = inContext + ' source' unless inContext.nil?
|
36
|
+
|
37
|
+
# source - id (tag attribute id="")
|
38
|
+
attributes = {}
|
39
|
+
s = hSource[:sourceId]
|
40
|
+
unless s.nil?
|
41
|
+
attributes = { id: s.gsub(/[^0-9A-Za-z]/,'') }
|
42
|
+
end
|
43
|
+
|
44
|
+
@xml.tag!('mrl:LI_Source', attributes) do
|
45
|
+
|
46
|
+
# source - description
|
47
|
+
unless hSource[:description].nil?
|
48
|
+
@xml.tag!('mrl:description') do
|
49
|
+
@xml.tag!('gco:CharacterString', hSource[:description])
|
50
|
+
end
|
51
|
+
end
|
52
|
+
if hSource[:description].nil? && @hResponseObj[:writerShowTags]
|
53
|
+
@xml.tag!('mrl:description')
|
54
|
+
end
|
55
|
+
|
56
|
+
# source - spatial resolution {MD_Resolution}
|
57
|
+
unless hSource[:spatialResolution].empty?
|
58
|
+
@xml.tag!('mrl:sourceSpatialResolution') do
|
59
|
+
resolutionClass.writeXML(hSource[:spatialResolution], outContext)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
if hSource[:spatialResolution].empty? && @hResponseObj[:writerShowTags]
|
63
|
+
@xml.tag!('mrl:sourceSpatialResolution')
|
64
|
+
end
|
65
|
+
|
66
|
+
# source - reference system {MD_ReferenceSystem}
|
67
|
+
unless hSource[:referenceSystem].empty?
|
68
|
+
@xml.tag!('mrl:sourceReferenceSystem') do
|
69
|
+
referenceClass.writeXML(hSource[:referenceSystem])
|
70
|
+
end
|
71
|
+
end
|
72
|
+
if hSource[:referenceSystem].empty? && @hResponseObj[:writerShowTags]
|
73
|
+
@xml.tag!('mrl:sourceReferenceSystem')
|
74
|
+
end
|
75
|
+
|
76
|
+
# source - citation {CI_Citation}
|
77
|
+
unless hSource[:sourceCitation].empty?
|
78
|
+
@xml.tag!('mrl:sourceCitation') do
|
79
|
+
citationClass.writeXML(hSource[:sourceCitation], outContext)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
if hSource[:sourceCitation].empty? && @hResponseObj[:writerShowTags]
|
83
|
+
@xml.tag!('mrl:sourceCitation')
|
84
|
+
end
|
85
|
+
|
86
|
+
# source - metadata [] {CI_Citation}
|
87
|
+
aCitations = hSource[:metadataCitation]
|
88
|
+
aCitations.each do |hCitation|
|
89
|
+
@xml.tag!('mrl:sourceMetadata') do
|
90
|
+
citationClass.writeXML(hCitation, outContext)
|
91
|
+
end
|
92
|
+
end
|
93
|
+
if aCitations.empty? && @hResponseObj[:writerShowTags]
|
94
|
+
@xml.tag!('mrl:sourceMetadata')
|
95
|
+
end
|
96
|
+
|
97
|
+
# source - scope {MD_Scope}
|
98
|
+
unless hSource[:scope].empty?
|
99
|
+
@xml.tag!('mrl:scope') do
|
100
|
+
scopeClass.writeXML(hSource[:scope], outContext)
|
101
|
+
end
|
102
|
+
end
|
103
|
+
if hSource[:scope].empty? && @hResponseObj[:writerShowTags]
|
104
|
+
@xml.tag!('mrl:scope')
|
105
|
+
end
|
106
|
+
|
107
|
+
# source - process step [] {LI_ProcessStep}
|
108
|
+
aSteps = hSource[:sourceSteps]
|
109
|
+
aSteps.each do |hStep|
|
110
|
+
@xml.tag!('mrl:sourceStep') do
|
111
|
+
stepClass.writeXML(hStep)
|
112
|
+
end
|
113
|
+
end
|
114
|
+
if aSteps.empty? && @hResponseObj[:writerShowTags]
|
115
|
+
@xml.tag!('mrl:sourceStep')
|
116
|
+
end
|
117
|
+
|
118
|
+
end # mrl:LI_Source tag
|
119
|
+
end # writeXML
|
120
|
+
end # LI_Source class
|
121
|
+
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|