Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[53] Add historic districts #78

Merged
merged 2 commits into from
Aug 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 19 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,50 +25,49 @@ In the following section, we define the terms that will be used throughout this
**District:** one division of an administrative boundary
**District Unique Identifier:** a number or name to uniquely identify a district

## Architecture

The NYC Boundaries Map is a landing page that displays a Carto basemap and outlines for each row of twelve shapefiles (representing an administrative boundary) stored in BetaNYC's Carto account: 1) NYC Community Districts, 2) NYC Police Precincts, 3) NYC Sanitation Districts, 4) NYC Fire Battilions, 5) NYC School Districts, 6) NYC Health Center Disticts, 7) NYC Council Districts, 8) Congressional Districts, 9) State Assembly Districts, 10) State Senate Districts, 11) Neighborhood Tabulation Areas, and 12) Business Improvement Districts. Selecting an administrative boundary from the "Query Overlapping Districts" dropdown turns off all layers except the selected layer; it then queries the dataset representing that administrative boundary in Carto to select the unique identifiers for each district within that adminstrative boundary and lists these districts in a separate doropdown. Selecting one of the unique identifiers from the resulting dropdown queries each of the eleven datasets to determent which administrative boundary districts overlap with the selected district. Searching for a NYC location queries the City's Geoclient API for the geo-coordinates that correspond to the entered address, repositions the map to this location, and then queries each of the eleven datasets to determine which geometries the geo-coordinates are located within. Datasets in Carto need to be updated as the geographic parameters change.

## Backend Services

### carto
### Carto

Most of the data for Boundaries Map is stored in BetaNYC's carto account.
Most of the data for Boundaries Map is stored in BetaNYC's Carto account.

- `nycd`
- `cd`
- Shapefile of community districts
- [Published](https://data.cityofnewyork.us/City-Government/Community-Districts/yfnk-k7r4) on the NYC Open Data Portal
- `nypp`
- `pp`
- Shapefile of police precincts
- [Published](https://data.cityofnewyork.us/Public-Safety/Police-Precincts/78dh-3ptz) on the NYC Open Data Portal
- `dsny`
- Shapefile of sanitation districts
- [Published](https://data.cityofnewyork.us/City-Government/DSNY-Districts/6j86-5s7z) on the NYC Open Data Portal
- `nyfb`
- `fb`
- Shapefile of fire battilions
- [Published](https://data.cityofnewyork.us/Public-Safety/Fire-Battalions/uh7r-6nya) on the NYC Open Data Portal
- `nysd`
- `sd`
- Shapefile of school districts
- [Published](https://data.cityofnewyork.us/Education/School-Districts/r8nu-ymqj) on the NYC Open Data Portal
- `nyhc`
- `hc`
- Shapefile of health center districts
- [Published](https://data.cityofnewyork.us/Health/Health-Center-Districts/b55q-34ps) on the NYC Open Data Portal
- `nycc`
- `cc`
- Shapefile of city council districts
- [Published](https://data.cityofnewyork.us/City-Government/City-Council-Districts/yusd-j4xi) on the NYC Open Data Portal
- `nycongress`
- Shapefile of Congressional Districts
- [Published](https://data.cityofnewyork.us/City-Government/Congressional-Districts/qd3c-zuu7) on the NYC Open Data Portal
- `nysa`
- `sa`
- Shapefile of State Assembly Districts
- [Published](https://data.cityofnewyork.us/City-Government/State-Assembly-Districts/pf5b-73bw) on the NYC Open Data Portal
- `nyss`
- `ss`
- Shapefile of State Senate Districts
- [Published](https://data.cityofnewyork.us/City-Government/State-Senate-Districts/h4i2-acfi) on the NYC Open Data Portal
- `nynta`
- `nta`
- Shapefile of Neighborhood Tabulation Areas
- [Published](https://data.cityofnewyork.us/City-Government/Neighborhood-Tabulation-Areas/cpf4-rkhq) on the NYC Open Data Portal
- `bids`
- `hd`
- Shapefile of Historic Districts
- [Published](https://data.cityofnewyork.us/Housing-Development/Historic-Districts/xbvj-gfnw) on the NYC Open Data Portal
- `bid`
- Shapefile of Business Improvement Districts
- [Published](https://data.cityofnewyork.us/Business/Business-Improvement-Districts/ejxk-d93y) on the NYC Open Data Portal

Expand All @@ -94,6 +93,10 @@ We use the Fetch API for browser-based Web requests to the Carto SQL API and the

## Change Log

### v1.1

- Add historic districts

### v1.0

- Application completely rewritten to use [Svelte](https://svelte.dev/), [TypeScript](https://www.typescriptlang.org/) and [Mapbox](https://www.mapbox.com/)
Expand Down
13 changes: 10 additions & 3 deletions script/datasets.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
{
"id": "fb",
"datasetName": "Fire Battilion",
"datasetName": "Fire Battalions",
"url": "https://data.cityofnewyork.us/api/geospatial/uh7r-6nya?method=export&format=Shapefile",
"nameCol": "fire_bn",
"nameAlt": null
Expand Down Expand Up @@ -99,16 +99,23 @@
},
{
"id": "nta",
"datasetName": "Neighborhood Tabulation Area",
"datasetName": "Neighborhood Tabulation Areas",
"url": "https://data.cityofnewyork.us/api/geospatial/cpf4-rkhq?method=export&format=Shapefile",
"nameCol": "ntaname",
"nameAlt": "ntacode"
},
{
"id": "zipcode",
"datasetName": "Zip Code",
"datasetName": "Zip Codes",
"url": "https://data.cityofnewyork.us/download/i8iw-xf4u/application%2Fzip",
"nameCol": "ZIPCODE",
"nameAlt": null
},
{
"id": "hd",
"datasetName": "Historic Districts",
"url": "https://data.cityofnewyork.us/api/geospatial/xbvj-gfnw?method=export&format=Shapefile",
"nameCol": "area_name",
"nameAlt": null
}
]
10 changes: 9 additions & 1 deletion src/assets/boundaries/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ export type BoundaryId =
| 'sa'
| 'sd'
| 'ss'
| 'zipcode';
| 'zipcode'
| 'hd';

export interface ILayer {
/** Human-readable name, e.g. "Community District" */
Expand Down Expand Up @@ -122,6 +123,13 @@ export const layers: ILayers = {
icon: '🏘',
formatContent: name => format_default(name)
},
hd: {
name: 'Historic District',
name_plural: 'Historic Districts',
sql: `SELECT * FROM all_bounds WHERE id = 'hd'`,
icon: '🗝',
formatContent: name => format_default(name)
},
bid: {
name: 'Business Improvement District',
name_plural: 'Business Improvement Districts',
Expand Down