Sha256: 65fa827fa01edb19bcc8a322e7bcc7cdf20a3db007a28fe4356c427fe83f38d0

Contents?: true

Size: 388 Bytes

Versions: 3

Compression:

Stored size: 388 Bytes

Contents

class Armg::WkbDeserializer
  DEFAULT_OPTIONS = {
    support_ewkb: true,
  }

  def initialize(factory = nil, options = {})
    options = DEFAULT_OPTIONS.merge(options)
    @wkb_parser = RGeo::WKRep::WKBParser.new(factory, options)
  end

  def deserialize(wkb)
    wkb = wkb.b
    srid = wkb.slice!(0..3)
    wkb[4] = "\x20"
    wkb.insert(5, srid)
    @wkb_parser.parse(wkb)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
armg-0.5.2 lib/armg/wkb_deserializer.rb
armg-0.5.1 lib/armg/wkb_deserializer.rb
armg-0.5.0 lib/armg/wkb_deserializer.rb