An ActiveRecord connection adapter that adds PostGIS spatial database support to Ruby on Rails applications.
ActiveRecord PostGIS Adapter is a Ruby gem that extends ActiveRecord's PostgreSQL adapter to support PostGIS, the spatial database extension. It allows Ruby on Rails applications to work with geospatial data types like points, lines, and polygons directly in ActiveRecord models, handling spatial migrations, type casting, and queries. It solves the problem of integrating advanced GIS capabilities into Rails applications without leaving the ActiveRecord ecosystem.
Ruby on Rails developers building applications that require geospatial data storage and analysis, such as mapping services, location-based apps, or geographic information systems (GIS).
Developers choose this adapter because it provides a seamless, ActiveRecord-native way to use PostGIS, with automatic spatial type casting to RGeo objects, spatial migration helpers, and query support. It's the standard, maintained solution for Rails/PostGIS integration, backed by the RGeo ecosystem.
ActiveRecord connection adapter for PostGIS, based on postgresql and rgeo
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Extends ActiveRecord's migration syntax to create spatial columns and indexes, and integrates spatial queries into Arel, making geospatial data feel native to Rails workflows.
Automatically casts PostGIS spatial types to RGeo geometry objects in Ruby, with configurable factories for coordinate systems, simplifying data manipulation without manual parsing.
Supports a wide range of PostGIS types and options like SRID, geographic vs geometric math, and Z/M coordinates, enabling detailed spatial data modeling directly in migrations.
Includes specific instructions for deploying PostGIS-enabled applications on Heroku, addressing common platform-specific challenges and reducing deployment friction.
Requires PostGIS installation and configuration on PostgreSQL, which can be complex and unsupported in some hosting environments, limiting database flexibility.
The README admits that spatial columns in joins don't automatically infer SRID and geographic options, requiring manual attribute definitions on models to avoid issues.
Upgrading between major versions (e.g., from 6.x) may require manual SpatialFactoryStore configuration changes, as noted in the README, increasing maintenance overhead.