Sha256: cd858e977fb9fd2700cc5053bef4830c9ebef4de95c9cf5e1966b377e4828a88

Contents?: true

Size: 1.52 KB

Versions: 2

Compression:

Stored size: 1.52 KB

Contents

# ISO <<Class>> geographicElement {abstract}
# writer output in XML

# History:
# 	Stan Smith 2014-05-29 original script
#   Stan Smith 2014-05-30 added multi-point, multi-linestring, multi-polygon support
#   Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
#   Stan Smith 2014-12-12 refactored to handle namespacing readers and writers

require 'class_geographicBoundingBox'
require 'class_boundingPolygon'

module ADIWG
    module Mdtranslator
        module Writers
            module Iso

                class GeographicElement

                    def initialize(xml)
                        @xml = xml
                    end

                    def writeXML(hGeoElement)

                        # classes used
                        geoBBoxClass = $WriterNS::EX_GeographicBoundingBox.new(@xml)
                        geoBPolyClass = $WriterNS::EX_BoundingPolygon.new(@xml)

                        geoType = hGeoElement[:elementGeometry][:geoType]
                        case geoType
                            when 'BoundingBox'
                                geoBBoxClass.writeXML(hGeoElement)
                            when 'Point', 'LineString', 'Polygon', 'MultiPoint', 'MultiLineString', 'MultiPolygon'
                                geoBPolyClass.writeXML(hGeoElement)
                            when 'MultiGeometry'
                                geoBPolyClass.writeXML(hGeoElement)
                        end

                    end

                end

            end
        end
    end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
adiwg-mdtranslator-0.12.1 lib/adiwg/mdtranslator/writers/iso/classes/class_geographicElement.rb
adiwg-mdtranslator-0.12.0 lib/adiwg/mdtranslator/writers/iso/classes/class_geographicElement.rb