How to update the json data files
- Get the latest mass shootings spreadsheet.
- Open the Google Sheets spreadsheet SHOOTINGS (MASS, SCHOOL)
- Create a new tab, name it after the current date (YYYYMMDD format).
- Compare the contents of the CSV you downloaded against the previous month's update. Import the CSV you downloaded into Google Sheets using the File --> Import menu command. From there choose the "Upload" tab, upload your CSV, and choose the "Replace current cells" option (or whatever sounds like that).
- This is janky. You'll need to copy the Incident Date column and paste that into an excel spreadsheet to get the dates formatted the way we format the dates in this project ("13-Mar-18"). Ugh, right? And that's not all:
- Since once Google Sheets identifies a table cell as containing a date, it obsessively holds onto that cell's formatting. The only way to fix the date formatting to what we want is to kill the original cell. In this case we delete the column.
- So: Delete the Incident Date column, then create a new column, then paste in that column from excel.
- Reorder the columns in your new tab. You want the columns in this order:
Incident Date Address City Or County State killed injured lat long url headline
- Batch geocode the new records. Add the records lat/long's to the spreadsheet.
- For the mass shootings we've written about, add the URL and headline.
- Convert the spreadsheet to JSON.
- Save the JSON in a new file named after the month it is, ala 201804.json for April 2018 or 201811.json for November 2018.
- Put that file in the www/data directory and add it to the repo.