Sha256: ed5a08c3b2045d2b33027b28aa10eb3e99e72fc69532943bd1e626914ed43d12

Contents?: true

Size: 1.35 KB

Versions: 7

Compression:

Stored size: 1.35 KB

Contents

# ISO <<Class>> GenericMetaData
# writer output in XML
# generic metadata only supports ...
	# time instant
	# time period

# History:
# 	Stan Smith 2013-11-04 original script
#   Stan Smith 2014-07-08 class no longer used
#   ... use replaced by creating new geographic extents for geometries
#   ... containing supplemental identifier, temporal, and vertical information
#   Stan Smith 2014-07-08 modify require statements to function in RubyGem structure

require 'module_dateTimeFun'
require 'class_timeInstant'
require 'class_timePeriod'

class GenericMetaData

	def initialize(xml)
		@xml = xml
	end

	def writeXML(aTempExt)

		# classes used
		timeIClass = TimeInstant.new(@xml)
		timePClass = TimePeriod.new(@xml)

		@xml.tag!('gml:GenericMetaData') do

			aTempExt.each do |hTempExt|

				# metadata - data
				hTimeD = hTempExt[:date]
				unless hTimeD.empty?
					date = hTimeD[:dateTime]
					dateResolution = hTimeD[:dateResolution]
					s = AdiwgDateTimeFun.stringDateFromDateTime(date, dateResolution)
					if s != 'ERROR'
						@xml.tag!('gco:Date', s)
					end
				end

				# metadata - time instant
				hTimeI = hTempExt[:timeInstant]
				unless hTimeI.empty?
					timeIClass.writeXML(hTimeI)
				end

				# metadata - time period
				hTimeP = hTempExt[:timePeriod]
				unless hTimeP.empty?
					timePClass.writeXML(hTimeP)
				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_genericMetaData.rb
adiwg-mdtranslator-0.9.0 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_genericMetaData.rb
adiwg-mdtranslator-0.8.6 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_genericMetaData.rb
adiwg-mdtranslator-0.8.5 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_genericMetaData.rb
adiwg-mdtranslator-0.8.2 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_genericMetaData.rb
adiwg-mdtranslator-0.8.1 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_genericMetaData.rb
adiwg-mdtranslator-0.8.0 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_genericMetaData.rb