Oracle Spatial support in spatial_adapter for ActiveRecord

Written by pete

Topics: Uncategorized

I’ve recently made public the first cut of functionality for Oracle Spatial support in Fragility’s Spatial Adapter for ActiveRecord. It’s not ready for prime time, but it’s useful enough to open up to collaboration. As soon as I finish up complete spec tests and a couple of refactorings, I plan to issue a pull request and get the functionality included in the main fork of spatial_adapter on Github.

I won’t go too far into how to use the adapter until it’s ready for prime time. This message is intended to encourage collaboration among anyone else who is in the unfortunate boat of having to use Oracle Spatial and Rails without built in driver support (which is not fun).

To use the functionality, install Oracle, Install GeoRuby , then install my fork of the spatial_adapter.

Then you can do this:

   create_table :points_of_interest do |t|
      t.geometry :location
      t.string :venue_name 
   add_index :points_of_interest, [:location], :spatial => true

Then all of the relevant rows will be set up for you in SDO_GEOM_METADATA, SDO_INDEX_METADATA, and SDO_INDEX_METADATA_TABLE.

Currently, there is only support for geometry types. Explicit point, polygon, line, and multipolygon types will come later.

Feedback is encouraged.

P.S. To everyone wondering what happened to the VoteFu major upgrade, it’s imminent. Thanks to everyone who has submitted patches in the past few months. It’ll be released *real soon now*

  • M Khalifeh

    Hello and thanks for your effort to bring Oracle spatial into Rails.
    In my new project, i have to use Oracle spatial+Rails, so we are in the same boat :)
    do you still work on this adapter? do you need some help doing so?