RailsでMySQLのgeometry型などを扱うためのちょいメモ。 Spatial Adapter for Railsを使うとマイグレーションとかでgeometry型を扱えるようになる。 geometry型とか絡むところは生のSQL書いてますよという場合でも、schema.rbにテーブル定義がちゃんと出力されるようになるので、それだけでも便利。 PostgreSQLでも使えるらしいです。 インストール GeoRubyに依存しているのでまずGeoRubyを入れる。 READMEではgeorubyになっているが、これは情報が古いようだ。 sudo gem install GeoRuby そのあとプラグインを入れる ruby script/plugin install git://github.com/fragility/spatial_adapter.git マイグレーション マイグレーシ