Sha256: 429be6cb632d53b559013821a826575b43c4f2e704e3ef2e109d25bca2f5b5e0

Contents?: true

Size: 1.63 KB

Versions: 48

Compression:

Stored size: 1.63 KB

Contents

# mdJson 2.0 writer - spatial resolution

# History:
#  Stan Smith 2017-10-20 added coordinate resolution
#  Stan Smith 2017-10-20 added bearing distance resolution
#  Stan Smith 2017-10-20 added geographic resolution
#  Stan Smith 2017-03-15 original script

require 'jbuilder'
require_relative 'mdJson_measure'
require_relative 'mdJson_coordinateResolution'
require_relative 'mdJson_bearingDistanceResolution'
require_relative 'mdJson_geographicResolution'

module ADIWG
   module Mdtranslator
      module Writers
         module MdJson

            module SpatialResolution

               def self.build(hResolution)

                  Jbuilder.new do |json|
                     json.scaleFactor hResolution[:scaleFactor]
                     json.measure Measure.build(hResolution[:measure]) unless hResolution[:measure].empty?
                     unless hResolution[:coordinateResolution].empty?
                        json.coordinateResolution CoordinateResolution.build(hResolution[:coordinateResolution])
                     end
                     unless hResolution[:bearingDistanceResolution].empty?
                        json.bearingDistanceResolution BearingDistanceResolution.build(hResolution[:bearingDistanceResolution])
                     end
                     unless hResolution[:geographicResolution].empty?
                        json.geographicResolution GeographicResolution.build(hResolution[:geographicResolution])
                     end
                     json.levelOfDetail hResolution[:levelOfDetail]
                  end

               end # build
            end # SpatialResolution

         end
      end
   end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
adiwg-mdtranslator-2.9.1 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_spatialResolution.rb
adiwg-mdtranslator-2.9.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_spatialResolution.rb
adiwg-mdtranslator-2.8.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_spatialResolution.rb
adiwg-mdtranslator-2.7.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_spatialResolution.rb
adiwg-mdtranslator-2.6.1 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_spatialResolution.rb
adiwg-mdtranslator-2.6.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_spatialResolution.rb
adiwg-mdtranslator-2.5.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_spatialResolution.rb
adiwg-mdtranslator-2.4.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_spatialResolution.rb