Module: RGeo::ActiveRecord

Defined in:
lib/rgeo/active_record/version.rb,
lib/rgeo/active_record/geometry_mixin.rb,
lib/rgeo/active_record/spatial_expressions.rb,
lib/rgeo/active_record/arel_spatial_queries.rb,
lib/rgeo/active_record/spatial_factory_store.rb,
lib/rgeo/active_record/common_adapter_elements.rb

Defined Under Namespace

Modules: GeometryMixin, SpatialExpressions, SpatialToSql Classes: SpatialConstantNode, SpatialFactoryStore, SpatialNamedFunction

Constant Summary collapse

VERSION =
"7.0.1"

Class Method Summary collapse

Class Method Details

.geometric_type_from_name(name) ⇒ Object

Return a feature type module given a string type.



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/rgeo/active_record/common_adapter_elements.rb', line 6

def self.geometric_type_from_name(name)
  case name.to_s
  when /^geometrycollection/i then Feature::GeometryCollection
  when /^geometry/i then Feature::Geometry
  when /^linestring/i then Feature::LineString
  when /^multilinestring/i then Feature::MultiLineString
  when /^multipoint/i then Feature::MultiPoint
  when /^multipolygon/i then Feature::MultiPolygon
  when /^point/i then Feature::Point
  when /^polygon/i then Feature::Polygon
  end
end

.spatial_expressions_supported?Boolean

Returns true if spatial expressions (i.e. the methods in the SpatialExpressions module) are supported.

Returns:

  • (Boolean)


7
8
9
# File 'lib/rgeo/active_record/spatial_expressions.rb', line 7

def self.spatial_expressions_supported?
  defined?(Arel::Nodes::NamedFunction)
end