SLA Mapper (SLAM) – is a tool that aggregates data that community boards often have to gather in order to review liquor license applications and sidewalk cafe applications. Displaying this information in a unified view saves community boards considerable time and resources.
How to Contribute
File an issue via this repo's issue cue.
Request a feature via this repo's issue cue.
Comment on issues.
Write code to fix issues or to create new features. When contributing code, please be sure to:
- Fork this repository, modify the code (changing only one thing at a time), and then issue a pull request for each change.
- Follow the project's coding style (using K&R-style indentation and bracketing, commenting above each feature, and using snake case for variables).
- Test your code locally before issuing a pull request.
- Clearly state the purpose of your change in the description field for each commit.
SLAM is a landing page that displays a Carto basemap and markers for each row of four datasets stored in BetaNYC's Carto account (1) 311 complaints about a club/restaurant/bar since 2017, 2) active SLA licenses, 3) sidewalk cafe licenses, and 4) the location of restaurant inspections). It also displays polygons representing buildings DCP has classed as schools and churches. Clicking on a marker further queries the datasets stored in Carto for additional information about the complaint/license/inspection. Datasets in in Carto are regularly automatically synced with datasets stored in the NYC or the NYS Open Data Portals. Searching for a NYC location queries NYC Planning Labs' GeoSearch for the geo-coordinates that correspond to the entered address, and the map repositions to this location.
cp .env.example .env
Then you run to install node.js packages
You can either build by running
npm run build or run live development environment by running
npm run dev, then opening localhost:5000 in your browser.
Most of the data for SLAM is stored in BetaNYC's carto account.
- Dataset of all NYC 311 complaints made about a club/restaurant/bar since 2019
- Published as a BetaNYC-filtered view on NYC's Open Data Portal
- Data is updated in the Open Data Portal daily and synced wtih BetaNYC's Carto account daily.
- Dataset of all current, pending, and expired sidewalk cafe licenses in NYC
- Published by the Department of Consumer Affairs on NYC's Open Data Portal
- Data is updated in the Open Data Portal weekly and synced wtih BetaNYC's Carto account weekly.
- Dataset of locations of NYC inspected restaurants
- Published by the Department of Health and Mental Hyegine on NYC's Open Data Portal and filtered for 2018 and after.
- Health grades for a NYC restaurant can be found in the Department and Health and Mental Hygiene's Restaurant Inspection Results dataset, published on the City's Open Data Portal. This dataset is organized so that each row represents one violation raised during a restaurant's health inspection. The row also reports the date of the inspection and the resulting grade. If restaurants had more than one violation during the inspection, there will be multiple rows representing that particular inspection, each reporting different violations but all reporting the same grade. If a restaurant has had more than one inspection, there will be multiple rows representing the restaurant's violations and grades given on different inspection dates. When the page loads, however, we do not need to display all of this information. In fact, the dataset is so large that we can't display all of that information on the page load. We only need to display the location of a restaurant that has been inspected. Later a user can click on the restaurant to trigger a query to gather more information about the restaurant's inspection history.
- The DOHMH inspection restults dataset does not include geo-coordinates - only a building number, street name, and zip code. To get the locations in a format where they can be displayed on a map, we need to download the dataset and use the City's Batch GeoSupport software to get the geo-coordinates. Since the same restaurants are often listed many times in the DOHMH inspection results dataset, to reduce processing time, we first remove rows representing the same restaurant from the dataset using R or Excel. We configure the GeoSupport software to read the filtered dataset and return the restaurant's name, unique identifier, address, lat, and lon.
- Data is downloaded from Socrata, geo-coded, and manually uplaoded to Carto weekly.
- Dataset of NYC restaurant inspection results
- Published by the Department of Health and Mental Hyegine on NYC's Open Data Portal
- Data is updated in the Open Data Portal weekly and synced with BetaNYC's Carto account weekly
- This dataset is only referenced once a user clicks on a resturant on the map. The query reads the unique identifier for the clicked on restaurant and then queries the restaurant inspection results dataset to get the inspection, violation, and grade history for the restaurant.
- Shapefile of all lots in NYC
- Published by the Department of City Planning on City Planning's Website
- DCP updates the data bi-annually and needs to be manually replaced in Carto when updated
NYC Boundaries Map (Community and city council districts)
- From Boundaries-Map
We use Carto.js to create and style map layers from data stored in the BetaNYC Carto account.
We use leaflet.js for additional JS-based mapping features such as re-centering the map to certain geographic coordinates on a location search.
We use Chart.js to display a pie chart depicting the breakdown of 311 complaints made about a particular club/bar/restaurant according to their descriptors and a line chart depicting the number of 311 complaints made per year at a particular club/bar/restaurant.
NYC Planning Labs' GeoSearch API
When users enter a text address into the location search field, the system queries GeoSearch for the lat/lon of that location. The map re-centers to this lat/lon.
NYC Geoclient API
We use the City's Geoclient API to query for the Building Identification Number (BIN) of the address listed for that liquor license. Having the establishment's BIN, we can construct a URL to the Certificate of Occupancy of the building, hosted on the DOB's website.
We use Svelte, a component framework to help manage the reactivity of the various libraries and components of the tool.
- Added Open Restaurants applicants and 311 complaint layers
- Reorder layers to feature new layers
- SLA dataset has to be manually geocoded due to georeference column not being filled out in the State ODP
- Added Leaflet.Locate library to allow for geo-location of the user when first visiting the page
- Refactor to use Svelte for better component, layers, and state management
- Added a github action to automate build to gh-pages branch
- Updates address search to use NYC Planning Labs' GeoSearch API
- Added days_hours_of_operation and method_of_operation to infobox
- Changes to panels for a more responsive tool
-  Remove API Keys from Public Code using rollup.js
-  Update Liquor License data (format changed)
- Fixes to DOHMN layer to use ABCEatsRestaurants that replaced NYC Restaurant Inspection
-  Added Community and city council districts
-  Upated SQL queries to match column names in SLA dataset
-  Added point to map when searching for a specific address.
-  Display schools and churches as polygons on the map.
-  Set the scroll on both info-boxes to scroll on the div only.
-  Added a BetaNYC logo and header information.
-  Changed the bar chart for complaints by year to a line chart.
-  Added Link to Certificate of Occupancy for each Liquor License
-  Added Instructions to the Main Info-box
- ,  Restyled the Info-boxes
-  Changed the basemap
-  Style adjustments for mobile devices
-  Icon sizes now scale according to the zoom.
-  The Main Infobox now includes a color-coded legend.
- Restaurants and liquor licenses that were overlapping are now stacking on top of each other.
-  Added a close link on the info window, making it easier to use the webpage on a mobile phone.
-  The previous version only filtered to On-Premise liquor licenses. The current version filters to SW, SB, SL, VL, RL, HL, CL, CT, EL, TL, CR, RW, HW, CW, TW, WC, EB, and MR, which were identified to us as licence class codes, community boards often review.
-  A location search bar was added.
Please see license file for details.
- Non-code, Creative Commons Attribution 4.0
- Code, GNU General Public License
Zhi Keng He, and Noel Hidalgo.