Sha256: 26555621952153e7bf00b0a280d6f6697067f1db6b37ca8f3643a85fbce39a88

Contents?: true

Size: 1.19 KB

Versions: 6

Compression:

Stored size: 1.19 KB

Contents

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

# History:
# 	Stan Smith 2013-11-04 original script
#   Stan Smith 2014-07-08 modify require statements to function in RubyGem structure

require 'module_dateTimeFun'

class TimePeriod

	def initialize(xml)
		@xml = xml
	end

	def writeXML(hTempP)

		timeID = hTempP[:timeID]
		if timeID.nil?
			$idCount = $idCount.succ
			timeID = 'timePeriod' + $idCount
		end

		@xml.tag!('gml:TimePeriod',{'gml:id'=>timeID}) do

			# time period - description
			s = hTempP[:description]
			if !s.nil?
				@xml.tag!('gml:description',s)
			elsif $showAllTags
				@xml.tag!('gml:description')
			end

			# time period - begin position
			hDateTime = hTempP[:beginTime]
			timeInstant = hDateTime[:dateTime]
			timeResolution = hDateTime[:dateResolution]
			dateStr = AdiwgDateTimeFun.stringDateTimeFromDateTime(timeInstant,timeResolution)
			@xml.tag!('gml:beginPosition',dateStr)

			# time period - begin position
			hDateTime = hTempP[:endTime]
			timeInstant = hDateTime[:dateTime]
			timeResolution = hDateTime[:dateResolution]
			dateStr = AdiwgDateTimeFun.stringDateTimeFromDateTime(timeInstant,timeResolution)
			@xml.tag!('gml:endPosition',dateStr)

		end

	end

end


Version data entries

6 entries across 6 versions & 1 rubygems

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