Sha256: baa3afce5afc0d324db87b2f52839b6da7e90431a5362c654b710c1820355b44

Contents?: true

Size: 1.28 KB

Versions: 7

Compression:

Stored size: 1.28 KB

Contents

# ISO <<Class>> EX_TemporalExtent
# writer output in XML

# History:
# 	Stan Smith 2013-11-15 original script
#   Stan Smith 2014-06-03 add support for date as time instant
#   Stan Smith 2014-07-08 modify require statements to function in RubyGem structure

require 'class_timeInstant'
require 'class_timePeriod'

class EX_TemporalExtent

	def initialize(xml)
		@xml = xml
	end

	def writeXML(hTempEle)

		# classes used by MD_Metadata
		intMetadataClass = InternalMetadata.new
		timeInstClass = TimeInstant.new(@xml)
		timePeriodClass = TimePeriod.new(@xml)

		@xml.tag!('gmd:EX_TemporalExtent') do

			# temporal extent - date - not supported by ISO
			# ... convert date to time instant
			hDate =  hTempEle[:date]
			unless hDate.empty?
				intTimeInst = intMetadataClass.newTimeInstant
				intTimeInst[:timePosition] = hDate
				@xml.tag!('gmd:extent') do
					timeInstClass.writeXML(intTimeInst)
				end
			end

			# temporal extent - time instant
			hTimeInst = hTempEle[:timeInstant]
			unless hTimeInst.empty?
				@xml.tag!('gmd:extent') do
					timeInstClass.writeXML(hTimeInst)
				end
			end

			# temporal extent - time period
			hTimePeriod = hTempEle[:timePeriod]
			unless hTimePeriod.empty?
				@xml.tag!('gmd:extent') do
					timePeriodClass.writeXML(hTimePeriod)
				end
			end

		end

	end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
adiwg-mdtranslator-0.10.2 lib/adiwg/mdtranslator/writers/iso/classes/class_temporalExtent.rb
adiwg-mdtranslator-0.9.0 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_temporalExtent.rb
adiwg-mdtranslator-0.8.6 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_temporalExtent.rb
adiwg-mdtranslator-0.8.5 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_temporalExtent.rb
adiwg-mdtranslator-0.8.2 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_temporalExtent.rb
adiwg-mdtranslator-0.8.1 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_temporalExtent.rb
adiwg-mdtranslator-0.8.0 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_temporalExtent.rb