Code Monkey home page Code Monkey logo

airports's Introduction

Grab FAA airport information and store in a back end and make data available via RESTful endpoints.

This project is implemented in Python and Django (including the Django REST Framework).

Possible Future enhancements:

Use a Spatial database (e.g. PostgreSQL with the PostGIS extension, or SQLite with the SpatiaLite extension for local development)

Use the GeoDjango extension https://docs.djangoproject.com/en/1.10/ref/contrib/gis/tutorial/

Setup

It is recommended to use a Python virtualenv (or equivalent) to manage Python dependencies for this project.

sudo pip install virtualenv
sudo pip install virtualenvwrapper

Create the virtual environment and activate it.

virtualenv venv
source venv/bin/activate

Install the Python dependencies for this project.

pip install -r requirements.txt

Change to the "aeroproject" Django site/project directory, and run the database migrations. By default, this will create a SQLite database, and install your schema objects (tables).

cd aeroproject
python manage.py migrate

Loading Data

This project implements Django management commands to load FAA Facilities (Airports) and Runway data.

Files can be downloaded from the FAA website. Location is subject to change (and has), but you would be looking for "Excel" files (tab separated text actually, but called xls). You're eventually looking for an NFDCFacilities and an NDFCRunways file.

https://www.faa.gov/air_traffic/flight_info/aeronav/aero_data/

Latest place I've found them is drilling down from here: https://www.faa.gov/air_traffic/flight_info/aeronav/aero_data/NASR_Subscription/

Once you finally locate the files, load them as follows:

python manage.py load_facilities --file=<downloaded facilities file>
python manage.py load_runways --file=<downloaded runways file>

Running

Activate the virtual environment.

source venv/bin/activate

Change to the "aeroproject" Django site/project directory, and run the server.

python manage.py runserver

Examples

In the following examples, change "localhost:8000" to whatever if you are not running locally with default port.

Test that the backend is working

http://localhost:8000/airports/test/

List of airports

http://localhost:8000/airports/facilities/

Find an airport by code

http://localhost:8000/airports/facility/<code>/

e.g.:

http://localhost:8000/airports/facility/SFO/

airports's People

Contributors

renegade9 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.