Module: SpatialAdapter::Base::Mysql::SpatialColumn

Included in:
ActiveRecord::ConnectionAdapters::SpatialMysql2Column, ActiveRecord::ConnectionAdapters::SpatialMysqlColumn
Defined in:
lib/spatial_adapter/base/mysql/spatial_column.rb

Instance Method Summary collapse

Instance Method Details

#string_to_geometry(string) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/spatial_adapter/base/mysql/spatial_column.rb', line 3

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