Sha256: 7419bc020ea72dc6124ebad63ca26f68c6e4bb51936d97ade38ee156b61cf669

Contents?: true

Size: 384 Bytes

Versions: 4

Compression:

Stored size: 384 Bytes

Contents

class Armg::WkbGenerator
  DEFAULT_OPTIONS = {
    type_format: :ewkb,
    little_endian: true,
  }

  def initialize(options = {})
    options = DEFAULT_OPTIONS.merge(options)
    @generator = RGeo::WKRep::WKBGenerator.new(options)
  end

  def generate(deserialized_value)
    srid = [deserialized_value.srid].pack('L<')
    srid + @generator.generate(deserialized_value)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
armg-0.4.4 lib/armg/wkb_generator.rb
armg-0.4.3 lib/armg/wkb_generator.rb
armg-0.4.2 lib/armg/wkb_generator.rb
armg-0.4.1 lib/armg/wkb_generator.rb