Code Monkey home page Code Monkey logo

interactive-map's Introduction

#Interactive Map #

The Firebird framework is designed to help municipal fire departments:

  1. Discover new properties for inspection
  2. Predict fire risk for properties and assign them a risk score
  3. Visualize property inspections on an interactive map

More information on the Firebird project can be found here.

This repository has scripts to help you build an interactive map, using Mapbox and D3, to visualize the property inspections and fires. Make sure you have completed the Property Joining process (Step 1) and built the Risk Model (Step 2) before building the Interactive Map.

======

What:

The AFRD_Map folder is the main website folder.

  • This is what you should upload to your website directory.

Files included in this folder:

  • index.html - This is the main map page, including the HTML, CSS, and Javascript to run the map.
  • README_index.md - Explains how to use the index.html file
  • SQL_query.php - This php file queries your SQL database to pull in information about the properties.
  • README_SQLquery.md - Explains how to use the SQL_query.php file
  • NPU.json - This is the json file for the NPU overlays.
  • Battalions.json - This is the json file for the Battalion overlays.
  • council_districts.json - This is the json file for the Council District overlays.
  • css Folder - This folder contains all of the external stylesheets for imported UI widgets like the DateRange Slider (iThing.css), and the Dropdown menu (chosen.css).
  • js Folder - This folder contains all of the Javascript and JQuery external scripts needed to run the map. This includes d3.js (for the d3 functionality), jQDateRangeSlider, moment.js (for date/time conversion functions), chosen.jquery.js (for the dropdown menu), and others.

The Misc Map folder contains miscellaneous map files

Files included in this folder:

  • READMEUpdatingMapData.md - Explains how to create the back-end SQL server to host the map data on your server, and how to update that data to keep the map useful in the longer term.
  • dropdownWriter.py - This Python script allows you to automatically create new dropdown menu lists, without typing out 100+ entries. Use this if you want to use the Property_list_long with all 190 FSAF types.
  • READMEdropdownWriter.md - Explains how to use the dropdownWriter.py file
  • AFRD_SQL.csv - This should be imported to your SQL server, into a table called “Fire_Incidents” [so the SQL_query.php file can access it].
  • AFRD_SQL_Columns - This explains what each of the AFRD_SQL columns are.
  • Property_list_short.csv - This should be imported to your SQL server, into a table called “Current_And_Potential_Inspections” [so the SQL_query.php file can access it].
    • NOTE: This file is NOT in this folder, but you can generate your own version from your own data with the code in the property-joins Github repo.

How:

After you join your various property data sets (Step 1), and generate a fire risk score for each property (Step 2), you are ready to build your interactive map to visualize the fires and inspections.

  1. First, upload your joined property data set to a SQL server, as explained here.
  2. Then, create the appropriate SQL query for your database as explained here.
  3. Then, build the interactive map as explained here.
  4. If necessary, change the property types listed in the dropdown menus using the script, explained here.





written by Michael Madaio, with Xiang Cheng, Oliver Haimson, and Wenwen Zhang
on behalf of Data Science for Social Good, Atlanta
for Atlanta Fire Rescue Department

interactive-map's People

Contributors

dssg-firebird avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.