Sha256: 9fdd848a8201efbf6121495ce2670e5c78efa2d2daa630f66f956e041236dc0d

Contents?: true

Size: 296 Bytes

Versions: 2

Compression:

Stored size: 296 Bytes

Contents

module SpatialAdapter::Base::Mysql
  module SpatialColumn
    def string_to_geometry(string)
      return string unless string.is_a?(String)
      begin
        GeoRuby::SimpleFeatures::Geometry.from_ewkb(string[4..-1])
      rescue Exception => exception
        nil
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spatial_adapter-1.3.1 lib/spatial_adapter/base/mysql/spatial_column.rb
spatial_adapter-1.3.0 lib/spatial_adapter/base/mysql/spatial_column.rb