Skip to content

Commit

Permalink
update boundaries to version 24b (#338)
Browse files Browse the repository at this point in the history
updates for a new version of political boundaries files has been released by DCP (24b) and adds a script to help with creating all of the test data, which needs to be done with each update of the version.
  • Loading branch information
austensen committed Jun 12, 2024
1 parent 640fd7c commit 11515a4
Show file tree
Hide file tree
Showing 30 changed files with 70 additions and 60 deletions.
120 changes: 60 additions & 60 deletions src/nycdb/datasets/boundaries.yml
Original file line number Diff line number Diff line change
@@ -1,125 +1,125 @@
---
files:
- url: https://s-media.nyc.gov/agencies/dcp/assets/files/zip/data-tools/bytes/nyad_23d.zip
dest: nyad_23d.zip
- url: https://s-media.nyc.gov/agencies/dcp/assets/files/zip/data-tools/bytes/nycg_23d.zip
dest: nycg_23d.zip
- url: https://s-media.nyc.gov/agencies/dcp/assets/files/zip/data-tools/bytes/nyss_23d.zip
dest: nyss_23d.zip
- url: https://s-media.nyc.gov/agencies/dcp/assets/files/zip/data-tools/bytes/nymc_23d.zip
dest: nymc_23d.zip
- url: https://s-media.nyc.gov/agencies/dcp/assets/files/zip/data-tools/bytes/nycc_23d.zip
dest: nycc_23d.zip
- url: https://s-media.nyc.gov/agencies/dcp/assets/files/zip/data-tools/bytes/nyed_23d.zip
dest: nyed_23d.zip
- url: https://s-media.nyc.gov/agencies/dcp/assets/files/zip/data-tools/bytes/nybb_23d.zip
dest: nybb_23d.zip
- url: https://s-media.nyc.gov/agencies/dcp/assets/files/zip/data-tools/bytes/nycd_23d.zip
dest: nycd_23d.zip
- url: https://s-media.nyc.gov/agencies/dcp/assets/files/zip/data-tools/bytes/nysd_23d.zip
dest: nysd_23d.zip
- url: https://s-media.nyc.gov/agencies/dcp/assets/files/zip/data-tools/bytes/nypp_23d.zip
dest: nypp_23d.zip
- url: https://s-media.nyc.gov/agencies/dcp/assets/files/zip/data-tools/bytes/nyha_23d.zip
dest: nyha_23d.zip
- url: https://s-media.nyc.gov/agencies/dcp/assets/files/zip/data-tools/bytes/nyhc_23d.zip
dest: nyhc_23d.zip
- url: https://s-media.nyc.gov/agencies/dcp/assets/files/zip/data-tools/bytes/nyfc_23d.zip
dest: nyfc_23d.zip
- url: https://s-media.nyc.gov/agencies/dcp/assets/files/zip/data-tools/bytes/nyfb_23d.zip
dest: nyfb_23d.zip
- url: https://s-media.nyc.gov/agencies/dcp/assets/files/zip/data-tools/bytes/nyfd_23d.zip
dest: nyfd_23d.zip
- url: https://s-media.nyc.gov/agencies/dcp/assets/files/zip/data-tools/bytes/nyad_24b.zip
dest: nyad_24b.zip
- url: https://s-media.nyc.gov/agencies/dcp/assets/files/zip/data-tools/bytes/nycg_24b.zip
dest: nycg_24b.zip
- url: https://s-media.nyc.gov/agencies/dcp/assets/files/zip/data-tools/bytes/nyss_24b.zip
dest: nyss_24b.zip
- url: https://s-media.nyc.gov/agencies/dcp/assets/files/zip/data-tools/bytes/nymc_24b.zip
dest: nymc_24b.zip
- url: https://s-media.nyc.gov/agencies/dcp/assets/files/zip/data-tools/bytes/nycc_24b.zip
dest: nycc_24b.zip
- url: https://s-media.nyc.gov/agencies/dcp/assets/files/zip/data-tools/bytes/nyed_24b.zip
dest: nyed_24b.zip
- url: https://s-media.nyc.gov/agencies/dcp/assets/files/zip/data-tools/bytes/nybb_24b.zip
dest: nybb_24b.zip
- url: https://s-media.nyc.gov/agencies/dcp/assets/files/zip/data-tools/bytes/nycd_24b.zip
dest: nycd_24b.zip
- url: https://s-media.nyc.gov/agencies/dcp/assets/files/zip/data-tools/bytes/nysd_24b.zip
dest: nysd_24b.zip
- url: https://s-media.nyc.gov/agencies/dcp/assets/files/zip/data-tools/bytes/nypp_24b.zip
dest: nypp_24b.zip
- url: https://s-media.nyc.gov/agencies/dcp/assets/files/zip/data-tools/bytes/nyha_24b.zip
dest: nyha_24b.zip
- url: https://s-media.nyc.gov/agencies/dcp/assets/files/zip/data-tools/bytes/nyhc_24b.zip
dest: nyhc_24b.zip
- url: https://s-media.nyc.gov/agencies/dcp/assets/files/zip/data-tools/bytes/nyfc_24b.zip
dest: nyfc_24b.zip
- url: https://s-media.nyc.gov/agencies/dcp/assets/files/zip/data-tools/bytes/nyfb_24b.zip
dest: nyfb_24b.zip
- url: https://s-media.nyc.gov/agencies/dcp/assets/files/zip/data-tools/bytes/nyfd_24b.zip
dest: nyfd_24b.zip
sql:
- boundaries.sql
schema:
# State Assembly Districts
- table_name: nyad
path: nyad_23d/nyad
dest: nyad_23d.zip
path: nyad_24b/nyad
dest: nyad_24b.zip
type: shapefile
srid: 2263
# Congressional Districts
- table_name: nycg
path: nycg_23d/nycg
dest: nycg_23d.zip
path: nycg_24b/nycg
dest: nycg_24b.zip
type: shapefile
srid: 2263
# State Senate Districts
- table_name: nyss
path: nyss_23d/nyss
dest: nyss_23d.zip
path: nyss_24b/nyss
dest: nyss_24b.zip
type: shapefile
srid: 2263
# Municipal Court Districts
- table_name: nymc
path: nymc_23d/nymc
dest: nymc_23d.zip
path: nymc_24b/nymc
dest: nymc_24b.zip
type: shapefile
srid: 2263
# City Council Districts
- table_name: nycc
path: nycc_23d/nycc
dest: nycc_23d.zip
path: nycc_24b/nycc
dest: nycc_24b.zip
type: shapefile
srid: 2263
# Election Districts
- table_name: nyed
path: nyed_23d/nyed
dest: nyed_23d.zip
path: nyed_24b/nyed
dest: nyed_24b.zip
type: shapefile
srid: 2263
# Borough Boundaries
- table_name: nybb
path: nybb_23d/nybb
dest: nybb_23d.zip
path: nybb_24b/nybb
dest: nybb_24b.zip
type: shapefile
srid: 2263
# Community Districts
- table_name: nycd
path: nycd_23d/nycd
dest: nycd_23d.zip
path: nycd_24b/nycd
dest: nycd_24b.zip
type: shapefile
srid: 2263
# School Districts
- table_name: nysd
path: nysd_23d/nysd
dest: nysd_23d.zip
path: nysd_24b/nysd
dest: nysd_24b.zip
type: shapefile
srid: 2263
# Police Precincts
- table_name: nypp
path: nypp_23d/nypp
dest: nypp_23d.zip
path: nypp_24b/nypp
dest: nypp_24b.zip
type: shapefile
srid: 2263
# Health Area
- table_name: nyha
path: nyha_23d/nyha
dest: nyha_23d.zip
path: nyha_24b/nyha
dest: nyha_24b.zip
type: shapefile
srid: 2263
# Health Center
- table_name: nyhc
path: nyhc_23d/nyhc
dest: nyhc_23d.zip
path: nyhc_24b/nyhc
dest: nyhc_24b.zip
type: shapefile
srid: 2263
# Fire Companies
- table_name: nyfc
path: nyfc_23d/nyfc
dest: nyfc_23d.zip
path: nyfc_24b/nyfc
dest: nyfc_24b.zip
type: shapefile
srid: 2263
# Fire Battalions
- table_name: nyfb
path: nyfb_23d/nyfb
dest: nyfb_23d.zip
path: nyfb_24b/nyfb
dest: nyfb_24b.zip
type: shapefile
srid: 2263
# Fire Divisions
- table_name: nyfd
path: nyfd_23d/nyfd
dest: nyfd_23d.zip
path: nyfd_24b/nyfd
dest: nyfd_24b.zip
type: shapefile
srid: 2263
10 changes: 10 additions & 0 deletions src/scripts/boundaries-test-data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cd "tests/integration/data"
VERSION=24b

for table in "nyad" "nycg" "nyss" "nymc" "nycc" "nyed" "nybb" "nycd" "nysd" "nypp" "nyha" "nyhc" "nyfc" "nyfb" "nyfd"
do
mkdir -p "${table}_${VERSION}"
pgsql2shp -f "${table}_${VERSION}/${table}.shp" -h "host.docker.internal" -p "5432" -u "nycdb" -P "nycdb" "nycdb" "select * from ${table} limit 5"
zip -r "${table}_${VERSION}.zip" "${table}_${VERSION}"
rm -rf "${table}_${VERSION}"
done
Binary file removed src/tests/integration/data/nyad_23d.zip
Binary file not shown.
Binary file added src/tests/integration/data/nyad_24b.zip
Binary file not shown.
Binary file removed src/tests/integration/data/nybb_23d.zip
Binary file not shown.
Binary file added src/tests/integration/data/nybb_24b.zip
Binary file not shown.
Binary file removed src/tests/integration/data/nycc_23d.zip
Binary file not shown.
Binary file added src/tests/integration/data/nycc_24b.zip
Binary file not shown.
Binary file removed src/tests/integration/data/nycd_23d.zip
Binary file not shown.
Binary file added src/tests/integration/data/nycd_24b.zip
Binary file not shown.
Binary file removed src/tests/integration/data/nycg_23d.zip
Binary file not shown.
Binary file added src/tests/integration/data/nycg_24b.zip
Binary file not shown.
Binary file removed src/tests/integration/data/nyed_23d.zip
Binary file not shown.
Binary file added src/tests/integration/data/nyed_24b.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed src/tests/integration/data/nyfd_23d.zip
Binary file not shown.
Binary file added src/tests/integration/data/nyfd_24b.zip
Binary file not shown.
Binary file removed src/tests/integration/data/nyha_23d.zip
Binary file not shown.
Binary file added src/tests/integration/data/nyha_24b.zip
Binary file not shown.
Binary file removed src/tests/integration/data/nyhc_23d.zip
Binary file not shown.
Binary file added src/tests/integration/data/nyhc_24b.zip
Binary file not shown.
Binary file removed src/tests/integration/data/nymc_23d.zip
Binary file not shown.
Binary file added src/tests/integration/data/nymc_24b.zip
Binary file not shown.
Binary file removed src/tests/integration/data/nypp_23d.zip
Binary file not shown.
Binary file added src/tests/integration/data/nypp_24b.zip
Binary file not shown.
Binary file removed src/tests/integration/data/nysd_23d.zip
Binary file not shown.
Binary file added src/tests/integration/data/nysd_24b.zip
Binary file not shown.
Binary file removed src/tests/integration/data/nyss_23d.zip
Binary file not shown.
Binary file added src/tests/integration/data/nyss_24b.zip
Binary file not shown.

0 comments on commit 11515a4

Please sign in to comment.