Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Ruby
  3. Geocoder

Geocoder

MITRuby

A complete Ruby geocoding solution with forward/reverse geocoding, IP address lookup, and ActiveRecord/Mongoid integration.

Visit WebsiteGitHubGitHub
6.4k stars1.2k forks0 contributors

What is Geocoder?

Geocoder is a Ruby gem that provides comprehensive geocoding functionality, including address-to-coordinate conversion, reverse geocoding, and IP address location lookup. It solves the problem of integrating multiple geocoding APIs into Ruby applications by offering a unified interface with support for over 40 services worldwide.

Target Audience

Ruby developers building location-aware applications who need to convert addresses to coordinates, find locations from IP addresses, or perform spatial database queries. Particularly useful for Rails developers using ActiveRecord or Mongoid.

Value Proposition

Developers choose Geocoder because it provides a complete, batteries-included solution with seamless ORM integration, extensive API support, and performance optimizations like caching—all through a clean Ruby API that abstracts away the complexities of different geocoding services.

Overview

Complete Ruby geocoding solution.

Use Cases

Best For

  • Adding location lookup to user profiles or business listings in Rails applications
  • Building store locators that find nearby points of interest
  • Implementing IP-based geographic content personalization
  • Performing spatial queries on ActiveRecord or Mongoid models
  • Batch processing large numbers of addresses for migration or data enrichment
  • Testing location features without hitting external API rate limits

Not Ideal For

  • Projects using MongoDB that require complex, native geospatial queries for performance and flexibility
  • Applications built on SQLite demanding high-precision distance calculations and accurate bearing results
  • High-traffic, real-time services needing sub-second geocoding responses without external API latency or rate limits
  • Non-Ruby environments or projects where introducing a Ruby dependency is not feasible

Pros & Cons

Pros

Extensive API Coverage

Supports over 40 geocoding services worldwide, allowing developers to switch or combine APIs based on region, accuracy, and cost, as detailed in the separate API Guide.

Seamless ORM Integration

Deeply integrates with ActiveRecord and Mongoid, enabling automatic geocoding via callbacks and spatial queries with scopes like `near`, reducing boilerplate code for Ruby on Rails applications.

Robust Performance Optimizations

Includes built-in caching support with configurable stores, database indexing guidance for faster queries, and batch geocoding to handle large datasets efficiently and minimize API usage.

Flexible Testing Support

Provides configurable test stubs to simulate geocoding responses without making external API calls, ensuring reliable testing and development without hitting service limits.

Cons

SQLite Inaccuracy Issues

Distance queries with SQLite use less accurate algorithms due to lack of trigonometric functions, leading to imprecise results and potential objects outside the specified radius, as admitted in the Technical Discussions.

MongoDB Query Limitations

For MongoDB-backed models, the README explicitly advises against using Geocoder's `near` scope, recommending MongoDB's native geospatial features instead, which limits Geocoder's utility for advanced NoSQL spatial operations.

External API Dependency

Geocoding performance and reliability are tied to third-party services, introducing latency, rate limiting risks, and downtime that require complex error handling and caching strategies to mitigate.

Configuration Overhead

Setting up multiple geocoding services with different API keys, parameters, and region-specific lookups can be complex and error-prone, especially for applications with diverse geographic needs.

Frequently Asked Questions

Quick Stats

Stars6,446
Forks1,201
Contributors0
Open Issues44
Last commit3 months ago
CreatedSince 2009

Tags

#mongoid#rails#geocoding#ip-geolocation#geospatial#location-services#ruby-gem#active-record#spatial-queries#api-integration

Built With

M
MySQL
S
SQLite
R
Ruby
P
PostgreSQL
M
MongoDB
A
ActiveRecord
R
Redis

Links & Resources

Website

Included in

Ruby14.1k
Auto-fetched 4 hours ago

Related Projects

Google Maps for RailsGoogle Maps for Rails

Enables easy Google map + overlays creation in Ruby apps

Stars2,249
Forks376
Last commit8 years ago
GeokitGeokit

Official Geokit Gem. Geokit gem provides geocoding and distance/heading calculations. Pair with the geokit-rails plugin for full-fledged location-based app functionality.

Stars1,629
Forks358
Last commit2 years ago
rgeorgeo

Geospatial data library for Ruby

Stars1,061
Forks158
Last commit2 months ago
geoipgeoip

The Ruby gem for querying Maxmind.com's GeoIP database, which returns the geographic location of a server given its IP address

Stars723
Forks82
Last commit7 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub