https://github.com/madmatvey/geojson-locations-api
GeoJSON with Rails PostgreSQL and PostGIS
https://github.com/madmatvey/geojson-locations-api
api postgis postgresql rails ruby
Last synced: 3 months ago
JSON representation
GeoJSON with Rails PostgreSQL and PostGIS
- Host: GitHub
- URL: https://github.com/madmatvey/geojson-locations-api
- Owner: madmatvey
- Created: 2019-10-05T08:13:44.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-19T15:11:00.000Z (over 3 years ago)
- Last Synced: 2025-08-31T12:34:06.671Z (10 months ago)
- Topics: api, postgis, postgresql, rails, ruby
- Language: Ruby
- Homepage: https://geojson-rails.herokuapp.com/
- Size: 87.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GeoJSON with Rails PostgreSQL and PostGIS 📐🌍🔍
## API-only Ruby on Rails app.
The goal of the application is to determine whether an incoming geographical Location is inside at least one of the given areas.
### Source code
[github.com/madmatvey/geojson-locations-api](https://github.com/madmatvey/geojson-locations-api)
### Code status
[](https://circleci.com/gh/madmatvey/geojson-locations-api/tree/master) [](https://coveralls.io/github/madmatvey/geojson-locations-api?branch=master)
### API endpoints
`GET /api/v1/areas` fetch list of the given areas in GeoJSON format
`POST /api/v1/locations` create a location
IN: location name (text)
OUT: ID of created location
`GET /api/v1/locations/:id` fetch location by ID
IN: Location ID
OUT: Location name, coordinates, inside? (true/false)
### Setup environment
- **Ruby 2.5.0**
It is recommended to use [rbenv](https://github.com/rbenv/rbenv) with [ruby-build](https://github.com/rbenv/ruby-build) and then run
`$ rbenv install 2.5.0`
- **Bundler**
`$ gem install bundler`
- **[Overmind](https://github.com/DarthSim/overmind)** to run processes from Procfile in dev.
```
$ brew install tmux
$ brew install overmind
```
- **Postgres 9.6 and Postgis 2.5**
[install with Clover Health's Homebrew Tap](https://github.com/CloverHealth/homebrew-tap#installing-postgres-96-and-postgis-25)
### Setup project
```
$ bundle
$ rails db:create
$ rails db:gis:setup
$ rails db:migrate
$ rails db:seed
```
### To run app in development
```
$ overmind start
```
And open url: [localhost:3333](http://localhost:3333)
### To run the test suite
```
$ bundle exec rspec
```
### Deployment instructions
Application will [deploy to Heroku with CircleCI](https://circleci.com/docs/2.0/deployment-integrations/#heroku) automaticaly when all RSpec tests are green and code coverage 100% in master branch.
Forks can setup Heroku manually and deploy with:
```
$ git push heroku master
```