[geos-devel] GEOS extensions for Ruby released

J Smith jay at zoocasa.com
Thu Feb 17 17:46:49 EST 2011

G'day list!

A couple of months ago I had posted[1] about some extensions to the
Ruby GEOS bindings that we at Zoocasa were interested in releasing as
free software. Well, I finally got a bit of time to finish up a
release, and the code and the gems have all been pushed to github and

Without further ado, here's the code and the gems:



The extensions themselves include...

- a bunch of utility methods and helpers to make working with
geometries a little easier. The Geos.read method for instance
recognizes WKT, WKB and a number of Google Maps-based input formats
and makes conversions on the fly as necessary, and methods like
Geos::Geometry#to_wkt, to_wkb, to_g_lat_lng, etc. allow for quick
conversions for output.

- ActiveRecord scopes for DE-9DIM and the like, allowing you to make
calls like MyModel.st_contains('POINT(20 20)').st_disjoint('POINT(10

- ActiveRecord accessors that automatically make conversions for you
via the above input and output methods.

- some 70+ helper methods in all.

The extensions work with both the native GEOS bindings as well as the
FFI-based bindings I've been working on[2], as well as both Rails 2.3
and 3. The ActiveRecord integration really only works with PostgreSQL
and PostGIS at the moment, although other databases could be added
with a bit of re-jiggering.

We've been using these extensions on zoocasa.com for quite a while
now, so the library has been pretty well tested in a production
application running on Rails 2.3, and we hope that these extensions
prove useful to the GEOS and Ruby communities.



[1] http://lists.osgeo.org/pipermail/geos-devel/2010-December/thread.html
[2] https://github.com/dark-panda/ffi-geos

More information about the geos-devel mailing list