geocoder
Version, currently master branch1 version
- master branchlatestMay 3, 2018
github.com/andre/geocoder
Simple Geocoding in Crystal
8 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
geocoder:
github: andre/geocoder
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
0.24.2- License
- MIT
- Author
- Andre Lewis <andre.lewis@gmail.com>
Dependencies
Development Dependencies
- webmock*github: manastech/webmock.cr, branch: masterdev
README
[](https://travis-ci.org/andre/geocoder)
# Geocoder (in Crystal)
Simplest possible geocoder shard for Crystal.
Geocoder options
1) Google. Get your API here: https://developers.google.com/maps/documentation/geocoding/get-api-key
2) Nominatim (OpenStreamMap). Doesn't need a key, but read usage policy carefully here: https://operations.osmfoundation.org/policies/nominatim/
## Installation
Add this to your application's `shard.yml`:
```yaml
dependencies:
geocoder:
github: andre/geocoder
```
## Usage
```crystal
require "geocoder"
g = Geocoder::GoogleGeocoder.new(YOUR_GOOGLE_API_KEY)
res = g.geocode("100 Main st, Denver, CO")
puts res.address
puts res.lat
puts res.lng
```
### Check the `success` method (returns true | false)
```crystal
puts res.success
```
### Multiple results are accessed via the `all_results` method:
```crystal
res = g.geocode("100 Main st")
all = res.all_results
puts all[0].address
puts all[1].address
```
## Nominatim / OpenStreetmap:
```crystal
require "geocoder"
g = Geocoder::NominatimGeocoder.new()
res = g.geocode("100 Main st, Denver, CO")
```
## Contributors
- [Andre Lewis](https://github.com/andre) - creator
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- May 3, 2018
- Crystal
0.24.2- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/andre/geocoder
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 14, 2026
- Synced
- Aug 14, 2026
- Versions
- 1