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,84 @@
|
|
1
|
+
# ISO <<Class>> MD_AssociatedResource
|
2
|
+
# 19115-1 writer output in XML
|
3
|
+
|
4
|
+
# History:
|
5
|
+
# Stan Smith 2019-03-25 original script
|
6
|
+
|
7
|
+
require_relative '../iso19115_1_writer'
|
8
|
+
require_relative 'class_codelist'
|
9
|
+
require_relative 'class_citation'
|
10
|
+
|
11
|
+
module ADIWG
|
12
|
+
module Mdtranslator
|
13
|
+
module Writers
|
14
|
+
module Iso19115_1
|
15
|
+
|
16
|
+
class MD_AssociatedResource
|
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(hAssocRes, inContext = nil)
|
25
|
+
|
26
|
+
# classes used
|
27
|
+
codelistClass = MD_Codelist.new(@xml, @hResponseObj)
|
28
|
+
citationClass = CI_Citation.new(@xml, @hResponseObj)
|
29
|
+
|
30
|
+
outContext = 'associated resource'
|
31
|
+
outContext = inContext + ' associated resource' unless inContext.nil?
|
32
|
+
|
33
|
+
@xml.tag!('mri:MD_AssociatedResource') do
|
34
|
+
|
35
|
+
# associated resource - name {CI_Citation}
|
36
|
+
hResourceCitation = hAssocRes[:resourceCitation]
|
37
|
+
unless hResourceCitation.empty?
|
38
|
+
@xml.tag!('mri:name') do
|
39
|
+
citationClass.writeXML(hResourceCitation, outContext)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
if hResourceCitation.empty? && @hResponseObj[:writerShowTags]
|
43
|
+
@xml.tag!('mri:name')
|
44
|
+
end
|
45
|
+
|
46
|
+
# associated resource - association type {DS_AssociationTypeCode} (required)
|
47
|
+
unless hAssocRes[:associationType].nil?
|
48
|
+
@xml.tag!('mri:associationType') do
|
49
|
+
codelistClass.writeXML('mri', 'iso_associationType', hAssocRes[:associationType])
|
50
|
+
end
|
51
|
+
end
|
52
|
+
if hAssocRes[:associationType].nil?
|
53
|
+
@NameSpace.issueWarning(1, 'mri:associationType')
|
54
|
+
end
|
55
|
+
|
56
|
+
# associated resource - initiative type {DS_InitiativeTypeCode}
|
57
|
+
unless hAssocRes[:initiativeType].nil?
|
58
|
+
@xml.tag!('mri:initiativeType') do
|
59
|
+
codelistClass.writeXML('mri', 'iso_initiativeType', hAssocRes[:initiativeType])
|
60
|
+
end
|
61
|
+
end
|
62
|
+
if hAssocRes[:initiativeType].nil? && @hResponseObj[:writerShowTags]
|
63
|
+
@xml.tag!('mri:initiativeType')
|
64
|
+
end
|
65
|
+
|
66
|
+
# associated resource - metadata reference {CI_Citation}
|
67
|
+
hMetadataCitation = hAssocRes[:metadataCitation]
|
68
|
+
unless hMetadataCitation.empty?
|
69
|
+
@xml.tag!('mri:metadataReference') do
|
70
|
+
citationClass.writeXML(hMetadataCitation, outContext)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
if hMetadataCitation.empty? && @hResponseObj[:writerShowTags]
|
74
|
+
@xml.tag!('mri:metadataReference')
|
75
|
+
end
|
76
|
+
|
77
|
+
end # MD_AssociatedResource tag
|
78
|
+
end # writeXML
|
79
|
+
end # MD_AssociatedResource class
|
80
|
+
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
@@ -0,0 +1,107 @@
|
|
1
|
+
# ISO <<Class>> attribute group
|
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_rangeDimension'
|
9
|
+
require_relative 'class_sampleDimension'
|
10
|
+
require_relative 'class_mdBand'
|
11
|
+
require_relative 'class_miBand'
|
12
|
+
|
13
|
+
module ADIWG
|
14
|
+
module Mdtranslator
|
15
|
+
module Writers
|
16
|
+
module Iso19115_1
|
17
|
+
|
18
|
+
class Attribute
|
19
|
+
|
20
|
+
def initialize(xml, hResponseObj)
|
21
|
+
@xml = xml
|
22
|
+
@hResponseObj = hResponseObj
|
23
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_1
|
24
|
+
end
|
25
|
+
|
26
|
+
def writeXML(hAttribute, inContext = nil)
|
27
|
+
|
28
|
+
# classes used
|
29
|
+
rangeClass = MD_RangeDimension.new(@xml, @hResponseObj)
|
30
|
+
sampleClass = MD_SampleDimension.new(@xml, @hResponseObj)
|
31
|
+
mdBandClass = MD_Band.new(@xml, @hResponseObj)
|
32
|
+
miBandClass = MI_Band.new(@xml, @hResponseObj)
|
33
|
+
|
34
|
+
outContext = 'attribute'
|
35
|
+
outContext = inContext + ' attribute' unless inContext.nil?
|
36
|
+
|
37
|
+
unless hAttribute.empty?
|
38
|
+
|
39
|
+
# determine attribute classes to output
|
40
|
+
attributeTag = nil
|
41
|
+
unless hAttribute[:sequenceIdentifier].nil? &&
|
42
|
+
hAttribute[:sequenceIdentifierType].nil? &&
|
43
|
+
hAttribute[:attributeDescription].nil? &&
|
44
|
+
hAttribute[:attributeIdentifiers].nil?
|
45
|
+
attributeTag = 'mrc:MD_RangeDimension'
|
46
|
+
end
|
47
|
+
unless hAttribute[:maxValue].nil? &&
|
48
|
+
hAttribute[:minValue].nil? &&
|
49
|
+
hAttribute[:units].nil? &&
|
50
|
+
hAttribute[:scaleFactor].nil? &&
|
51
|
+
hAttribute[:offset].nil? &&
|
52
|
+
hAttribute[:meanValue].nil? &&
|
53
|
+
hAttribute[:numberOfValues].nil? &&
|
54
|
+
hAttribute[:standardDeviation].nil? &&
|
55
|
+
hAttribute[:bitsPerValue].nil?
|
56
|
+
attributeTag = 'mrc:MD_SampleDimension'
|
57
|
+
end
|
58
|
+
unless hAttribute[:boundMin].nil? &&
|
59
|
+
hAttribute[:boundMax].nil? &&
|
60
|
+
hAttribute[:boundUnits].nil? &&
|
61
|
+
hAttribute[:peakResponse].nil? &&
|
62
|
+
hAttribute[:toneGradations].nil?
|
63
|
+
attributeTag = 'mrc:MD_Band'
|
64
|
+
end
|
65
|
+
unless hAttribute[:bandBoundaryDefinition].nil? &&
|
66
|
+
hAttribute[:nominalSpatialResolution].nil? &&
|
67
|
+
hAttribute[:transferFunctionType].nil? &&
|
68
|
+
hAttribute[:transmittedPolarization].nil? &&
|
69
|
+
hAttribute[:detectedPolarization].nil?
|
70
|
+
attributeTag = 'mrc:MI_Band'
|
71
|
+
end
|
72
|
+
|
73
|
+
unless attributeTag.nil?
|
74
|
+
@xml.tag!(attributeTag) do
|
75
|
+
if attributeTag == 'mrc:MD_RangeDimension'
|
76
|
+
rangeClass.writeXML(hAttribute, outContext)
|
77
|
+
end
|
78
|
+
if attributeTag == 'mrc:MD_SampleDimension'
|
79
|
+
rangeClass.writeXML(hAttribute, outContext)
|
80
|
+
sampleClass.writeXML(hAttribute, outContext)
|
81
|
+
end
|
82
|
+
if attributeTag == 'mrc:MD_Band'
|
83
|
+
rangeClass.writeXML(hAttribute, outContext)
|
84
|
+
sampleClass.writeXML(hAttribute, outContext)
|
85
|
+
mdBandClass.writeXML(hAttribute)
|
86
|
+
end
|
87
|
+
if attributeTag == 'mrc:MI_Band'
|
88
|
+
rangeClass.writeXML(hAttribute, outContext)
|
89
|
+
sampleClass.writeXML(hAttribute, outContext)
|
90
|
+
mdBandClass.writeXML(hAttribute)
|
91
|
+
miBandClass.writeXML(hAttribute)
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
if attributeTag.nil?
|
96
|
+
@NameSpace.issueWarning(42, 'mrc:attribute', outContext)
|
97
|
+
end
|
98
|
+
|
99
|
+
end
|
100
|
+
|
101
|
+
end # writeXML
|
102
|
+
end # Attribute
|
103
|
+
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# ISO <<Class>> attribute group
|
2
|
+
# 19115-1 writer output in XML
|
3
|
+
|
4
|
+
# History:
|
5
|
+
# Stan Smith 2019-04-05 original script.
|
6
|
+
|
7
|
+
require_relative '../iso19115_1_writer'
|
8
|
+
require_relative 'class_codelist'
|
9
|
+
require_relative 'class_attribute'
|
10
|
+
|
11
|
+
module ADIWG
|
12
|
+
module Mdtranslator
|
13
|
+
module Writers
|
14
|
+
module Iso19115_1
|
15
|
+
|
16
|
+
class MD_AttributeGroup
|
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(hGroup, inContext = nil)
|
25
|
+
|
26
|
+
# classes used
|
27
|
+
codelistClass = MD_Codelist.new(@xml, @hResponseObj)
|
28
|
+
attributeClass = Attribute.new(@xml, @hResponseObj)
|
29
|
+
|
30
|
+
outContext = 'attribute group'
|
31
|
+
outContext = inContext + ' attribute group' unless inContext.nil?
|
32
|
+
|
33
|
+
unless hGroup.empty?
|
34
|
+
@xml.tag!('mrc:MD_AttributeGroup') do
|
35
|
+
|
36
|
+
# attribute group - content type [] {MD_CoverageContentTypeCode} (required)
|
37
|
+
aContentTypes = hGroup[:attributeContentTypes]
|
38
|
+
aContentTypes.each do |item|
|
39
|
+
@xml.tag!('mrc:contentType') do
|
40
|
+
codelistClass.writeXML('mrc', 'iso_coverageContentType', item)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
if aContentTypes.empty?
|
44
|
+
@NameSpace.issueWarning(41, 'mrc:contentType', outContext)
|
45
|
+
end
|
46
|
+
|
47
|
+
# attribute group - attribute [] (abstract)
|
48
|
+
aAttributes = hGroup[:attributes]
|
49
|
+
aAttributes.each do |hAttribute|
|
50
|
+
unless hAttribute.empty?
|
51
|
+
@xml.tag!('mrc:attribute') do
|
52
|
+
attributeClass.writeXML(hAttribute, outContext)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
if aAttributes.empty? && @hResponseObj[:writerShowTags]
|
57
|
+
@xml.tag!('mrc:attribute')
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
end # writeXML
|
64
|
+
end # AttributeGroup class
|
65
|
+
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# ISO <<Class>> BaseUnit
|
2
|
+
# 19115-1 writer output in XML
|
3
|
+
|
4
|
+
# History:
|
5
|
+
# Stan Smith 2019-04-08 copied from 19115_2 writer
|
6
|
+
|
7
|
+
module ADIWG
|
8
|
+
module Mdtranslator
|
9
|
+
module Writers
|
10
|
+
module Iso19115_1
|
11
|
+
|
12
|
+
class BaseUnit
|
13
|
+
|
14
|
+
def initialize(xml, hResponseObj)
|
15
|
+
@xml = xml
|
16
|
+
@hResponseObj = hResponseObj
|
17
|
+
end
|
18
|
+
|
19
|
+
def writeXML(hBase)
|
20
|
+
|
21
|
+
# create and identity for the unit
|
22
|
+
@hResponseObj[:writerMissingIdCount] = @hResponseObj[:writerMissingIdCount].succ
|
23
|
+
unitID = 'unit' + @hResponseObj[:writerMissingIdCount]
|
24
|
+
@xml.tag!('gml:BaseUnit', {'gml:id' => unitID}) do
|
25
|
+
@xml.tag!('gml:identifier', {'codeSpace' => hBase[:codeSpace]}, hBase[:identifier])
|
26
|
+
@xml.tag!('gml:name', hBase[:name])
|
27
|
+
@xml.tag!('gml:catalogSymbol', hBase[:catalogSymbol])
|
28
|
+
@xml.tag!('gml:unitsSystem', {'xlink:href' => hBase[:unitsSystem]})
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# ISO <<Class>> EX_GeographicBoundingBox
|
2
|
+
# 19115-1 writer output in XML
|
3
|
+
|
4
|
+
# History:
|
5
|
+
# Stan Smith 2019-03-19 original script
|
6
|
+
|
7
|
+
require_relative '../iso19115_1_writer'
|
8
|
+
|
9
|
+
module ADIWG
|
10
|
+
module Mdtranslator
|
11
|
+
module Writers
|
12
|
+
module Iso19115_1
|
13
|
+
|
14
|
+
class EX_GeographicBoundingBox
|
15
|
+
|
16
|
+
def initialize(xml, hResponseObj)
|
17
|
+
@xml = xml
|
18
|
+
@hResponseObj = hResponseObj
|
19
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_1
|
20
|
+
end
|
21
|
+
|
22
|
+
def writeXML(hBBox)
|
23
|
+
|
24
|
+
# bounding box - west longitude (required)
|
25
|
+
unless hBBox[:westLongitude].nil?
|
26
|
+
@xml.tag!('gex:westBoundLongitude') do
|
27
|
+
@xml.tag!('gco:Decimal', hBBox[:westLongitude])
|
28
|
+
end
|
29
|
+
end
|
30
|
+
if hBBox[:westLongitude].nil?
|
31
|
+
@NameSpace.issueError(10)
|
32
|
+
end
|
33
|
+
|
34
|
+
# bounding box - east longitude (required)
|
35
|
+
unless hBBox[:eastLongitude].nil?
|
36
|
+
@xml.tag!('gex:eastBoundLongitude') do
|
37
|
+
@xml.tag!('gco:Decimal', hBBox[:eastLongitude])
|
38
|
+
end
|
39
|
+
end
|
40
|
+
if hBBox[:eastLongitude].nil?
|
41
|
+
@NameSpace.issueError(11)
|
42
|
+
end
|
43
|
+
|
44
|
+
# bounding box - south latitude (required)
|
45
|
+
unless hBBox[:southLatitude].nil?
|
46
|
+
@xml.tag!('gex:southBoundLatitude') do
|
47
|
+
@xml.tag!('gco:Decimal', hBBox[:southLatitude])
|
48
|
+
end
|
49
|
+
end
|
50
|
+
if hBBox[:southLatitude].nil?
|
51
|
+
@NameSpace.issueError(12)
|
52
|
+
end
|
53
|
+
|
54
|
+
# bounding box - north latitude (required)
|
55
|
+
unless hBBox[:northLatitude].nil?
|
56
|
+
@xml.tag!('gex:northBoundLatitude') do
|
57
|
+
@xml.tag!('gco:Decimal', hBBox[:northLatitude])
|
58
|
+
end
|
59
|
+
end
|
60
|
+
if hBBox[:northLatitude].nil?
|
61
|
+
@NameSpace.issueError(13)
|
62
|
+
end
|
63
|
+
|
64
|
+
end # writeXML
|
65
|
+
end # EX_GeographicBoundingBox class
|
66
|
+
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,95 @@
|
|
1
|
+
# ISO <<Class>> MD_BrowseGraphic
|
2
|
+
# 19115-1 writer output in XML
|
3
|
+
|
4
|
+
# History:
|
5
|
+
# Stan Smith 2019-03-15 original script
|
6
|
+
|
7
|
+
require_relative '../iso19115_1_writer'
|
8
|
+
require_relative 'class_constraint'
|
9
|
+
require_relative 'class_onlineResource'
|
10
|
+
|
11
|
+
module ADIWG
|
12
|
+
module Mdtranslator
|
13
|
+
module Writers
|
14
|
+
module Iso19115_1
|
15
|
+
|
16
|
+
class MD_BrowseGraphic
|
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(hGraphic, inContext = nil)
|
25
|
+
|
26
|
+
# classes used
|
27
|
+
onlineClass = CI_OnlineResource.new(@xml, @hResponseObj)
|
28
|
+
constraintClass = Constraint.new(@xml, @hResponseObj)
|
29
|
+
|
30
|
+
outContext = 'browse graphic'
|
31
|
+
outContext = inContext + ' browse graphic' unless inContext.nil?
|
32
|
+
|
33
|
+
@xml.tag!('mcc:MD_BrowseGraphic') do
|
34
|
+
|
35
|
+
# browse graphic - file name (required)
|
36
|
+
unless hGraphic[:graphicName].nil?
|
37
|
+
@xml.tag!('mcc:fileName') do
|
38
|
+
@xml.tag!('gco:CharacterString', hGraphic[:graphicName])
|
39
|
+
end
|
40
|
+
end
|
41
|
+
if hGraphic[:graphicName].nil?
|
42
|
+
@NameSpace.issueWarning(20, 'mcc:fileName', outContext)
|
43
|
+
end
|
44
|
+
|
45
|
+
# browse graphic - file description
|
46
|
+
unless hGraphic[:graphicDescription].nil?
|
47
|
+
@xml.tag!('mcc:fileDescription') do
|
48
|
+
@xml.tag!('gco:CharacterString', hGraphic[:graphicDescription])
|
49
|
+
end
|
50
|
+
end
|
51
|
+
if hGraphic[:graphicDescription].nil? && @hResponseObj[:writerShowTags]
|
52
|
+
@xml.tag!('mcc:fileDescription')
|
53
|
+
end
|
54
|
+
|
55
|
+
# browse graphic - file type
|
56
|
+
unless hGraphic[:graphicType].nil?
|
57
|
+
@xml.tag!('mcc:fileType') do
|
58
|
+
@xml.tag!('gco:CharacterString', hGraphic[:graphicType])
|
59
|
+
end
|
60
|
+
end
|
61
|
+
if hGraphic[:graphicType].nil? && @hResponseObj[:writerShowTags]
|
62
|
+
@xml.tag!('mcc:fileType')
|
63
|
+
end
|
64
|
+
|
65
|
+
# browse graphic - image constraint []
|
66
|
+
# {MD_Constraints | MD_SecurityConstraints | MD_LegalConstraints}
|
67
|
+
aConstraint = hGraphic[:graphicConstraints]
|
68
|
+
aConstraint.each do |hCon|
|
69
|
+
@xml.tag!('mcc:imageConstraints') do
|
70
|
+
constraintClass.writeXML(hCon, outContext)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
if aConstraint.empty? && @hResponseObj[:writerShowTags]
|
74
|
+
@xml.tag!('mcc:imageConstraints')
|
75
|
+
end
|
76
|
+
|
77
|
+
# browse graphic - linkage [] {CI_OnlineResource}
|
78
|
+
aOnline = hGraphic[:graphicURI]
|
79
|
+
aOnline.each do |hOnline|
|
80
|
+
@xml.tag!('mcc:linkage') do
|
81
|
+
onlineClass.writeXML(hOnline, outContext)
|
82
|
+
end
|
83
|
+
end
|
84
|
+
if aOnline.empty? && @hResponseObj[:writerShowTags]
|
85
|
+
@xml.tag!('mcc:linkage')
|
86
|
+
end
|
87
|
+
|
88
|
+
end # MD_BrowseGraphic tag
|
89
|
+
end # writeXML
|
90
|
+
end # MD_BrowseGraphic class
|
91
|
+
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|