RGeo

RGeo is a geospatial data library for Ruby.

Summary

RGeo is a key component for writing location-aware applications in the Ruby programming language. At its core is an implementation of the industry standard OGC Simple Features Specification, which provides data representations of geometric objects such as points, lines, and polygons, along with a set of geometric analysis operations. This makes it ideal for modeling geolocation data. It also supports a suite of optional add-on modules that provide various geolocation-related services.

Use the core rgeo gem to:

Several optional modules are currently available:

Need help? Join the rgeo-users google group at: groups.google.com/group/rgeo-users

Dependencies

RGeo is known to work with the following Ruby implementations:

Some features also require the following:

Note: The build system assumes a unix-like environment. Windows builds may be possible, but not likely “out of the box”. I have heard that some Windows users have had success getting the ffi-geos implementation working, after suitably installing the Geos library. However, since I’m not a Windows user myself, I can’t provide any direct support for this configuration.

Installation

Install RGeo as a gem:

gem install rgeo

Note: By default, the gem installation looks for the GEOS library in the following locations: /usr/local, /usr/local/geos, /opt/local, /opt/geos, /opt, /usr, and /Library/Frameworks/GEOS.framework/unix. In other words, MacPorts, Homebrew, the Kyngchaos port, and building from source to /usr/local are supported out of the box.

If GEOS has been installed in a different location, you must provide its installation prefix directory using the “–with-geos-dir” option. This option must be preceded by “--” to separate it, as a build switch, from the switches interpreted by the gem command. For example:

gem install rgeo -- --with-geos-dir=/path/to/my/geos/installation

Similarly, the gem installation looks for the Proj4 library in the following locations by default: /usr/local, /usr/local/proj, /usr/local/proj4, /opt/local, /opt/proj, /opt/proj4, /opt, /usr, and /Library/Frameworks/PROJ.framework/unix.

If Proj4 is installed in a different location, you must provide its installation prefix directory using the “–with-proj-dir” option.

To-do list

The RGeo suite of tools is evolving rapidly. The current to-do list for the core library includes:

Each of the current add-on modules also has its own feature roadmap, and we are planning on introducing more add-on modules, including:

Development and support

Documentation is available at rgeo.github.com/rgeo/rdoc

Source code is hosted on Github at github.com/rgeo/rgeo

Contributions are welcome. Fork the project on Github.

Build status:

Report bugs on Github issues at github.org/rgeo/rgeo/issues

Support available on the rgeo-users google group at groups.google.com/group/rgeo-users

Contact the author at dazuma at gmail dot com.

Acknowledgments

RGeo is written by Daniel Azuma (www.daniel-azuma.com).

Development is supported by Pirq (www.pirq.com).

Continuous integration service provided by Travis-CI (travis-ci.org).

RGeo calls the GEOS library to handle most Cartesian geometric calculations, and the Proj4 library to handle projections and coordinate transformations. These libraries are maintained by the Open Source Geospatial Foundation; more information is available on OSGeo's web site (www.osgeo.org).

JRuby support is made possible by the ffi-geos (and upcoming ffi-proj4) gems, by J Smith (github.com/dark-panda).

License

Copyright 2010-2012 Daniel Azuma

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.