Module: ActiveRecord::ConnectionAdapters::PostGISAdapter::CommonAdapterMethods
- Included in:
- MainAdapter
- Defined in:
- lib/active_record/connection_adapters/postgis_adapter/shared/common_adapter_methods.rb
Overview
:nodoc:
Instance Method Summary collapse
- #adapter_name ⇒ Object
- #default_srid ⇒ Object
- #postgis_lib_version ⇒ Object
- #quote(value_, column_ = nil) ⇒ Object
- #set_rgeo_factory_settings(factory_settings_) ⇒ Object
- #spatial_column_constructor(name_) ⇒ Object
- #srs_database_columns ⇒ Object
Instance Method Details
#adapter_name ⇒ Object
16 17 18 |
# File 'lib/active_record/connection_adapters/postgis_adapter/shared/common_adapter_methods.rb', line 16 def adapter_name PostGISAdapter::ADAPTER_NAME end |
#default_srid ⇒ Object
28 29 30 |
# File 'lib/active_record/connection_adapters/postgis_adapter/shared/common_adapter_methods.rb', line 28 def default_srid DEFAULT_SRID end |
#postgis_lib_version ⇒ Object
24 25 26 |
# File 'lib/active_record/connection_adapters/postgis_adapter/shared/common_adapter_methods.rb', line 24 def postgis_lib_version @postgis_lib_version ||= select_value("SELECT PostGIS_Lib_Version()") end |
#quote(value_, column_ = nil) ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'lib/active_record/connection_adapters/postgis_adapter/shared/common_adapter_methods.rb', line 36 def quote(value_, column_=nil) if ::RGeo::Feature::Geometry.check_type(value_) "'#{::RGeo::WKRep::WKBGenerator.new(:hex_format => true, :type_format => :ewkb, :emit_ewkb_srid => true).generate(value_)}'" elsif value_.is_a?(::RGeo::Cartesian::BoundingBox) "'#{value_.min_x},#{value_.min_y},#{value_.max_x},#{value_.max_y}'::box" else super end end |
#set_rgeo_factory_settings(factory_settings_) ⇒ Object
12 13 14 |
# File 'lib/active_record/connection_adapters/postgis_adapter/shared/common_adapter_methods.rb', line 12 def set_rgeo_factory_settings(factory_settings_) @rgeo_factory_settings = factory_settings_ end |
#spatial_column_constructor(name_) ⇒ Object
20 21 22 |
# File 'lib/active_record/connection_adapters/postgis_adapter/shared/common_adapter_methods.rb', line 20 def spatial_column_constructor(name_) PostGISAdapter::SPATIAL_COLUMN_CONSTRUCTORS[name_] end |
#srs_database_columns ⇒ Object
32 33 34 |
# File 'lib/active_record/connection_adapters/postgis_adapter/shared/common_adapter_methods.rb', line 32 def srs_database_columns {:srtext_column => 'srtext', :proj4text_column => 'proj4text', :auth_name_column => 'auth_name', :auth_srid_column => 'auth_srid'} end |