Sha256: 5851af5c8a90a8bcb085c6eedbe372e4542101d0143b40898b75ba0664942169

Contents?: true

Size: 472 Bytes

Versions: 6

Compression:

Stored size: 472 Bytes

Contents

# frozen_string_literal: true

# see https://dev.mysql.com/doc/refman/5.7/en/gis-data-formats.html
module Armg
  module Utils
    def mysql_geometry_to_wkb(mysql_geometry)
      mysql_geometry = mysql_geometry.b
      srid = mysql_geometry.slice!(0..3)
      mysql_geometry[4] = "\x20"
      mysql_geometry.insert(5, srid)
    end
    module_function :mysql_geometry_to_wkb

    def pack_srid(srid)
      [srid].pack('L<')
    end
    module_function :pack_srid
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
armg-0.11.0 lib/armg/utils.rb
armg-0.10.0 lib/armg/utils.rb
armg-0.9.0 lib/armg/utils.rb
armg-0.8.1 lib/armg/utils.rb
armg-0.8.0 lib/armg/utils.rb
armg-0.7.2 lib/armg/utils.rb