Skip to content

DSSG-Firebird/interactive-map

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 

Repository files navigation

#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

About

3. This code will help you build an interactive map, using Mapbox and D3, to visualize the property inspections and fires.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published