|
3 | 3 | The MySQL2 Spatial \ActiveRecord Adapter is an \ActiveRecord connection |
4 | 4 | adapter based on the standard mysql2 adapter. It extends the standard |
5 | 5 | adapter to provide support for spatial columns and indexes in MySQL, |
6 | | -using the {RGeo}[http://github.com/dazuma/rgeo] library to represent |
| 6 | +using the {RGeo}[http://github.com/rgeo/rgeo] library to represent |
7 | 7 | spatial data in Ruby. Like the standard mysql2 adapter, this adapter |
8 | 8 | requires the mysql2 gem. |
9 | 9 |
|
10 | 10 | == What This Adapter Provides |
11 | 11 |
|
12 | 12 | === Spatial Migrations |
13 | 13 |
|
14 | | -First, this adapter extends the migration syntax to support creating |
| 14 | +First, this adapter extends the migration syntax to support creating |
15 | 15 | spatial columns and indexes. To create a spatial column, use the |
16 | 16 | <tt>:geometry</tt> type, or any of the OGC spatial types such as |
17 | 17 | <tt>:point</tt> or <tt>:line_string</tt>. To create a spatial index, set |
18 | 18 | the <tt>:spatial</tt> option to true. Remember that, on some versions of |
19 | 19 | MySQL, only the MyISAM engine supports spatial indexes, and the indexed |
20 | 20 | column may need to be NOT NULL. |
21 | 21 |
|
22 | | -Examples: |
| 22 | +Examples (require update): |
23 | 23 |
|
24 | 24 | create_table :my_spatial_table, :options => 'ENGINE=MyISAM' do |t| |
25 | 25 | t.column :latlon, :point, :null => false |
@@ -55,13 +55,13 @@ the "rgeo-activerecord" gem. |
55 | 55 | Examples, given the spatial table defined above: |
56 | 56 |
|
57 | 57 | class MySpatialTable < ActiveRecord::Base |
58 | | - |
| 58 | + |
59 | 59 | # By default, use the GEOS implementation for spatial columns. |
60 | 60 | self.rgeo_factory_generator = RGeo::Geos.method(:factory) |
61 | | - |
| 61 | + |
62 | 62 | # But use a geographic implementation for the :latlon column. |
63 | 63 | set_rgeo_factory_for_column(:latlon, RGeo::Geographic.spherical_factory) |
64 | | - |
| 64 | + |
65 | 65 | end |
66 | 66 |
|
67 | 67 | Now you can interact with the data using the RGeo types: |
@@ -98,13 +98,13 @@ write more complex queries in SQL. |
98 | 98 |
|
99 | 99 | This adapter has the following requirements: |
100 | 100 |
|
101 | | -* Ruby 1.8.7 or later. Ruby 1.9.2 or later preferred. |
| 101 | +* Ruby 1.9.3 or later. Ruby 2.0.0 or later preferred. |
102 | 102 | * MySQL server 5.0 or later required for spatial extensions. |
103 | | -* \ActiveRecord 3.0.3 or later. Earlier versions will not work. |
104 | | - Should be compatible with Rails versions through 3.2.x. |
| 103 | +* \ActiveRecord 4.0.0 or later. Earlier versions will not work. |
| 104 | + Should be compatible with Rails versions through 4.0.x-4.1.x. |
105 | 105 | * mysql2 gem 0.2.13 or later. |
106 | 106 | * rgeo gem 0.3.15 or later. |
107 | | -* rgeo-activerecord gem 0.4.5 or later. |
| 107 | +* rgeo-activerecord gem 1.x. |
108 | 108 |
|
109 | 109 | Install this adapter as a gem: |
110 | 110 |
|
@@ -149,18 +149,16 @@ Rails as of Rails 3.0.3, so we hope it will get rectified at some point. |
149 | 149 |
|
150 | 150 | === Development and support |
151 | 151 |
|
152 | | -Documentation is available at http://dazuma.github.com/activerecord-mysql2spatial-adapter/rdoc |
| 152 | +Documentation is available at http://rgeo.github.com/activerecord-mysql2spatial-adapter/rdoc |
153 | 153 |
|
154 | | -Source code is hosted on Github at http://github.com/dazuma/activerecord-mysql2spatial-adapter |
| 154 | +Source code is hosted on Github at http://github.com/rgeo/activerecord-mysql2spatial-adapter |
155 | 155 |
|
156 | 156 | Contributions are welcome. Fork the project on Github. |
157 | 157 |
|
158 | | -Report bugs on Github issues at http://github.org/dazuma/activerecord-mysql2spatial-adapter/issues |
| 158 | +Report bugs on Github issues at http://github.org/rgeo/activerecord-mysql2spatial-adapter/issues |
159 | 159 |
|
160 | 160 | Support available on the rgeo-users google group at http://groups.google.com/group/rgeo-users |
161 | 161 |
|
162 | | -Contact the author at dazuma at gmail dot com. |
163 | | - |
164 | 162 | === Acknowledgments |
165 | 163 |
|
166 | 164 | The Mysql2Spatial Adapter and its supporting libraries (including RGeo) |
|
0 commit comments