Class: MD_TopicCategoryCode

Inherits:
Object
  • Object
show all
Defined in:
lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_topicCategory.rb

Overview

from www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml History: Stan Smith 2013-10-21 original script

Instance Method Summary collapse

Constructor Details

#initialize(xml) ⇒ MD_TopicCategoryCode

Returns a new instance of MD_TopicCategoryCode.



9
10
11
# File 'lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_topicCategory.rb', line 9

def initialize(xml)
  @xml = xml
end

Instance Method Details

#writeXML(codeName) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_topicCategory.rb', line 13

def writeXML(codeName)
  case(codeName)
    when 'farming',
      'biota',
      'boundaries',
      'climatologyMeteorologyAtmosphere',
      'economy',
      'elevation',
      'environment',
      'geoscientificInformation',
      'health',
      'imageryBaseMapsEarthCover',
      'intelligenceMilitary',
      'inlandWaters',
      'location',
      'oceans',
      'planningCadastre',
      'society',
      'structure',
      'transportation',
      'utilitiesCommunication'
    else
      # topics not in the standard ISO list will not pass validation
      # the domain is validated by the XSD
      # this codelist cannot be extended
      return
  end

  # write xml
  @xml.tag!('gmd:MD_TopicCategoryCode',codeName)
end