Skip to content

flippakitten/orbital_defence_engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CircleCI

Orbital Defence Engine

Making NASA FIRMS data queryable by geo-location and augmenting it with Open Weather API data

Orbital Defence Demo

Getting Started

Grab a OpenWeatherMap API key here
Grab a Nasa EarthData Api Key here
The Engine has a dependancy on pagy for pagination and geokit-rails for geo based queries. The initializer files will be created during installation only if they do not exist.

Installation

Add this line to your application's Gemfile:

gem 'orb_def'

And then execute:

bundle

Generate the installation files: This will create the orb_def, pagy and geokit initializers, install migrations and mount the app to '/'

rails generate orb_def:install

Run migrations:

rails db:migrate

Populate the DB with required seed information:

rails orb_def:seed_db

Import all fires with their weather readings in a rails console:

OrbDef::Nasa::FirmsImport.all

You can then hit the api/v1/search endpoint:

http://localhost:3000/api/v1/fires/search?sw_bound_point=22,22&ne_bound_point=22.325,23.345345&page=1

or you can call the fire model directly:

OrbDef::Fire.in_last_24_hours.in_bounds([sw_bound_point, ne_bound_point])
OrbDef::Fire.in_last_24_hours.within(10, origin: [latitude, longitude])
OrbDef::Fire.within(10, origin: [latitude, longitude])

Contributing

Fell free to contribute by forking the repo and opening a PR.

License

The gem is available as open source under the terms of the MIT License.

About

Rails Engine to fetch and query Nasa Firms Data augmented with Open Weather API data

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors