Sha256: 1b1e02af29fd9309d4e0ced177776eee610c47875da6e0eda1d28c8dc8042a7a

Contents?: true

Size: 1.52 KB

Versions: 9

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 = $IsoNS::EX_GeographicBoundingBox.new(@xml)
                        geoBPolyClass = $IsoNS::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

9 entries across 9 versions & 1 rubygems

Version Path
adiwg-mdtranslator-1.2.1 lib/adiwg/mdtranslator/writers/iso/classes/class_geographicElement.rb
adiwg-mdtranslator-1.2.0 lib/adiwg/mdtranslator/writers/iso/classes/class_geographicElement.rb
adiwg-mdtranslator-1.1.1 lib/adiwg/mdtranslator/writers/iso/classes/class_geographicElement.rb
adiwg-mdtranslator-1.1.0 lib/adiwg/mdtranslator/writers/iso/classes/class_geographicElement.rb
adiwg-mdtranslator-1.0.0 lib/adiwg/mdtranslator/writers/iso/classes/class_geographicElement.rb
adiwg-mdtranslator-1.0.0rc4 lib/adiwg/mdtranslator/writers/iso/classes/class_geographicElement.rb
adiwg-mdtranslator-1.0.0rc3 lib/adiwg/mdtranslator/writers/iso/classes/class_geographicElement.rb
adiwg-mdtranslator-1.0.0rc2 lib/adiwg/mdtranslator/writers/iso/classes/class_geographicElement.rb
adiwg-mdtranslator-1.0.0rc1 lib/adiwg/mdtranslator/writers/iso/classes/class_geographicElement.rb