Sha256: f0a1dd9739485a13a9c50931759875fc2f433ee9b6b9df2712b11e6fa776d627

Contents?: true

Size: 739 Bytes

Versions: 7

Compression:

Stored size: 739 Bytes

Contents

# ISO <<Class>> RS_Identifier
# writer
# output for ISO 19115-2 XML

# History:
# 	Stan Smith 2014-09-03 original script

class RS_Identifier

	def initialize(xml)
		@xml = xml
	end

	def writeXML(refId, refType)

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

			# identity - code - required
			# identifiers can be name, epsg number, wkt
			case refType
				when 'name'
					@xml.tag!('gmd:code') do
						@xml.tag!('gco:CharacterString', refId)
					end

				when 'epsg'
					@xml.tag!('gmd:code') do
						s = 'urn:ocg:def:crs:EPSG::' + refId.to_s
						@xml.tag!('gco:CharacterString', s)
					end

				when 'wkt'
					@xml.tag!('gmd:code') do
						s = 'WKT::' + refId
						@xml.tag!('gco:CharacterString', s)
					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_referenceIdentifier.rb
adiwg-mdtranslator-0.9.0 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_referenceIdentifier.rb
adiwg-mdtranslator-0.8.6 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_referenceIdentifier.rb
adiwg-mdtranslator-0.8.5 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_referenceIdentifier.rb
adiwg-mdtranslator-0.8.2 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_referenceIdentifier.rb
adiwg-mdtranslator-0.8.1 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_referenceIdentifier.rb
adiwg-mdtranslator-0.8.0 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_referenceIdentifier.rb