[Georuby-devel] Spatial adapter and PostgreSQL views

J Smith jay at zoocasa.com
Wed Mar 19 12:35:13 EDT 2008

Hello list.

I recently ran into a problem (which I guess is kind of both a Rails problem 
as well as a spatial adapter problem) where I was unable to get the proper 
geometry column information for a geometry field in a PostgreSQL view.

After hacking ActiveRecord's PostgreSQLAdapter to recognize views properly, I 
ended up hacking at the PostgreSQLAdapter extensions in GeoRuby to grab the 
geometry field information from the geometry_columns table rather than 
pg_constraints. This of course required that I make an entry in the 
geometry_columns table for my view, which may or may not be 
considered "proper", but when all is said and done, it works.

I don't know if this is all that useful, but I figured I'd send along the 
patch anyway.

Cheers, and thanks for GeoRuby, it's been quite useful on our little venture 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: post_gis_adapter.rb.patch
Type: text/x-diff
Size: 2959 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/georuby-devel/attachments/20080319/72db9ad9/attachment.bin 

More information about the Georuby-devel mailing list