Skip to content

Commit

Permalink
Fixes made to conform to iso19115-3 standard
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Oliveros committed Jun 17, 2024
1 parent 54e5dc6 commit 787b040
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def writeXML(hEvent)
passClass = MI_Pass.new(@xml, @hResponseObj)
instrumentClass = MI_Instrument.new(@xml, @hResponseObj)

@xml.tag!('mac:MI_Event') do
@xml.tag!('mac:MI_Event', id: hEvent[:eventId]) do

unless hEvent[:identifier].empty?
@xml.tag!('mac:identifier') do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require_relative 'class_codelist'
require_relative 'class_citation'
require_relative 'class_identifier'
require_relative 'class_platform'
Expand All @@ -18,7 +17,6 @@ def initialize(xml, hResponseObj)

def writeXML(hInstrument)

codelistClass = MD_Codelist.new(@xml, @hResponseObj)
citationClass = CI_Citation.new(@xml, @hResponseObj)
identifierClass = MD_Identifier.new(@xml, @hResponseObj)
platformClass = MI_Platform.new(@xml, @hResponseObj)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def writeXML(hInstrumentationEvent)
citationClass = CI_Citation.new(@xml, @hResponseObj)
extentClass = EX_Extent.new(@xml, @hResponseObj)
revisionClass = MI_Revision.new(@xml, @hResponseObj)
codeListClass = MD_Codelist.new(@xml, @hResponseObj)

@xml.tag!('mac:MI_InstrumentationEvent') do
unless hInstrumentationEvent[:citations].empty?
Expand Down Expand Up @@ -53,24 +54,24 @@ def writeXML(hInstrumentationEvent)
end

unless hInstrumentationEvent[:eventType].nil?
@xml.tag!('mac:eventType') do
@xml.tag!('gco:CharacterString', hInstrumentationEvent[:eventType])
@xml.tag!('mac:type') do
codeListClass.writeXML('mac', 'iso_eventTypeCode', hInstrumentationEvent[:eventType])
end
else
if @hResponseObj[:writerShowTags]
@xml.tag!('mac:eventType')
@xml.tag!('mac:type')
end
end

unless hInstrumentationEvent[:revisionHistories].empty?
hInstrumentationEvent[:revisionHistories].each do |hRevision|
@xml.tag!('mac:revision') do
@xml.tag!('mac:revisionHistory') do
revisionClass.writeXML(hRevision)
end
end
else
if @hResponseObj[:writerShowTags]
@xml.tag!('mac:revision')
@xml.tag!('mac:revisionHistory')
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def writeXML(hObjective)
passClass = MI_Pass.new(@xml, @hResponseObj)
instrumentClass = MI_Instrument.new(@xml, @hResponseObj)

@xml.tag!('mac:MI_Objective') do
@xml.tag!('mac:MI_Objective', id: hObjective[:objectiveId]) do
unless hObjective[:identifiers].empty?
hObjective[:identifiers].each do |hIdentifier|
@xml.tag!('mac:identifier') do
Expand All @@ -40,7 +40,7 @@ def writeXML(hObjective)

unless hObjective[:priority].nil?
@xml.tag!('mac:priority') do
@xml.tag!('gco:Integer', hObjective[:priority])
@xml.tag!('gco:CharacterString', hObjective[:priority])
end
else
if @hResponseObj[:writerShowTags]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def writeXML(hOperation)
platformClass = MI_Platform.new(@xml, @hResponseObj)
operationClass = MI_Operation.new(@xml, @hResponseObj)

@xml.tag!('mac:MI_Operation') do
@xml.tag!('mac:MI_Operation', id: hOperation[:operationId]) do

unless hOperation[:description].nil?
@xml.tag!('mac:description') do
Expand Down Expand Up @@ -55,7 +55,25 @@ def writeXML(hOperation)

unless hOperation[:status].nil?
@xml.tag!('mac:status') do
codelistClass.writeXML('mcc', 'iso_progress', hOperation[:status])
codelistClass.writeXML('mac', 'iso_progress', hOperation[:status])
end
end

unless hOperation[:operationType].nil?
@xml.tag!('mac:type') do
codelistClass.writeXML('mac', 'iso_operationTypeCode', hOperation[:operationType])
end
end

unless hOperation[:platforms].empty?
hOperation[:platforms].each do |hPlatform|
@xml.tag!('mac:platform') do
platformClass.writeXML(hPlatform)
end
end
else
if @hResponseObj[:writerShowTags]
@xml.tag!('mac:platform')
end
end

Expand Down Expand Up @@ -103,17 +121,6 @@ def writeXML(hOperation)
end
end

unless hOperation[:platforms].empty?
hOperation[:platforms].each do |hPlatform|
@xml.tag!('mac:platform') do
platformClass.writeXML(hPlatform)
end
end
else
if @hResponseObj[:writerShowTags]
@xml.tag!('mac:platform')
end
end
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def writeXML(hPlan)
operationClass = MI_Operation.new(@xml, @hResponseObj)
requirementClass = MI_Requirement.new(@xml, @hResponseObj)

@xml.tag!('mac:MI_Plan', type: hPlan[:planType], id: hPlan[:planId]) do
@xml.tag!('mac:MI_Plan', id: hPlan[:planId]) do
unless hPlan[:planType].nil?
@xml.tag!('mac:type') do
codelistClass.writeXML('mac', 'iso_geometryTypeCode', hPlan[:planType])
Expand All @@ -33,7 +33,7 @@ def writeXML(hPlan)

unless hPlan[:status].nil?
@xml.tag!('mac:status') do
codelistClass.writeXML('mcc', 'iso_progress', hPlan[:status])
codelistClass.writeXML('mac', 'iso_progress', hPlan[:status])
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def writeXML(hRequirement)
gcoDateTimeClass = GcoDateTime.new(@xml, @hResponseObj)
planClass = MI_Plan.new(@xml, @hResponseObj)

@xml.tag!('mac:MI_Requirement') do
@xml.tag!('mac:MI_Requirement', id: hRequirement[:requirementId]) do
unless hRequirement[:citation].empty?
@xml.tag!('mac:citation') do
citationClass.writeXML(hRequirement[:citation])
Expand All @@ -50,7 +50,7 @@ def writeXML(hRequirement)

unless hRequirement[:requestors].empty?
hRequirement[:requestors].each do |hResponsibility|
@xml.tag!('mac:request') do
@xml.tag!('mac:requestor') do
responsibilityClass.writeXML(hResponsibility)
end
end
Expand All @@ -66,7 +66,7 @@ def writeXML(hRequirement)

unless hRequirement[:priority].nil?
@xml.tag!('mac:priority') do
codelistClass.writeXML('mcc', 'iso_priorityCode', hRequirement[:priority])
codelistClass.writeXML('mac', 'iso_priorityCode', hRequirement[:priority])
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ def writeXML(hRevision)
end

unless hRevision[:responsibleParty].empty?
@xml.tag!('mac:responsibleParty') do
@xml.tag!('mac:author') do
responsibilityClass.writeXML(hRevision[:responsibleParty])
end
else
@xml.tag!('mac:responsibleParty')
@xml.tag!('mac:author')
end

unless hRevision[:dateInfo].empty?
Expand Down

0 comments on commit 787b040

Please sign in to comment.