{"id":21091480,"url":"https://github.com/ographiesresearch/urbanplanr","last_synced_at":"2025-08-20T10:27:22.703Z","repository":{"id":220189180,"uuid":"750539523","full_name":"ographiesresearch/urbanplanr","owner":"ographiesresearch","description":"A set of R tools that automate various common data processing workflows in urban planning. Developed in collabroation with Utile Architecture and Planning.","archived":false,"fork":false,"pushed_at":"2025-05-07T03:36:09.000Z","size":2049,"stargazers_count":2,"open_issues_count":9,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T04:29:53.210Z","etag":null,"topics":["acs","census-data","lehd","mapping","sf","spatial-analysis","spatial-data","tidycensus","tidyverse","urban-planning"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ographiesresearch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-01-30T20:40:16.000Z","updated_at":"2025-05-07T03:36:11.000Z","dependencies_parsed_at":"2025-04-28T23:20:09.731Z","dependency_job_id":"610d1560-5f89-4d9e-ba8f-6c3bf933e33f","html_url":"https://github.com/ographiesresearch/urbanplanr","commit_stats":null,"previous_names":["ographies-research-design/urban-plannr","ographies-research-design/urbanplanr","ographies/urbanplanr","ographiesresearch/urbanplanr"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ographiesresearch/urbanplanr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ographiesresearch%2Furbanplanr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ographiesresearch%2Furbanplanr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ographiesresearch%2Furbanplanr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ographiesresearch%2Furbanplanr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ographiesresearch","download_url":"https://codeload.github.com/ographiesresearch/urbanplanr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ographiesresearch%2Furbanplanr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271302421,"owners_count":24736025,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["acs","census-data","lehd","mapping","sf","spatial-analysis","spatial-data","tidycensus","tidyverse","urban-planning"],"created_at":"2024-11-19T21:46:26.218Z","updated_at":"2025-08-20T10:27:22.694Z","avatar_url":"https://github.com/ographiesresearch.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# urbanplanR\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip) [![R-CMD-check](https://github.com/ographiesresearch/urbanplanr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ographiesresearch/urbanplanr/actions/workflows/R-CMD-check.yaml) [![Codecov test coverage](https://codecov.io/gh/ographiesresearch/urbanplanr/graph/badge.svg)](https://app.codecov.io/gh/ographiesresearch/urbanplanr) [![DOI](https://zenodo.org/badge/750539523.svg)](https://doi.org/10.5281/zenodo.15366842)\n\nSo far, the automated workflows download and process data from the **LEHD Origin-Destination Employment Statistics (LODES)** and the **5-year American Community Survey estimates**, including data necessary to produce ‘Petri Dish’ diagrams of place-based employment by industry and occupation. Developed in collaboration with [Utile Architecture and Planning](https://www.utiledesign.com/).\n\n\n## Setup\n\nCurrently, to set up the automated process, you modify `config.json` with the following parameters:\n\n+ **project – string** \\\nName of the project. Currently, this only appears as the name of the output geopackage (or results folder, if format is ‘shapefile’ or ‘geojson’).\n+ **states – array of strings** \\\nArray of states of interest using standard two-letter abbreviations. This can be understood as the 'region' of study in the broadest sense, allowing for analysis of, for example, commuter flows over state lines.\n+ **placenames – array of objects** \\\n_Optional._ An object containing towns/cities of interest. It/they must be in the states provided as ‘states’. Each object should have the following two properties...\n    + **place – string** \\\n    Name of each town/city of interest.\n    + **state – string** \\\n    Two-letter abreviation of state including indicated place.\n+ **crs – integer** \\\nCoordinate reference system EPSG code.\n+ **census_unit – string** \\\nEither ‘tracts’ or ‘block groups.’\n+ **year – integer** \\\nYear of interest. Need to identify ranges for each source. I’ve been using 2021.\n+ **format – string** \\\nOutput format. Current possible values are...\n    + `“gpkg”`: Geopackage.\n    + `“shp”`: Shapefile.\n    + `“geojson\"`: GeoJSON. \\\nIf `'shp'` or `'geojson'`, non-spatial tables are exported as CSVs.\n+ **datasets – array of strings** \\\nList of datasets to download and write. Current possible values are...\n    + `\"lodes\"`: Tables derviced from the LEHD origin-destination employment statistics database.\n    + `\"occ\"`: Occupation of civilian employed population 16 and over.\n    + `\"ind\"`: Industry of civilian employed population 16 and over.\n+ **census_api – string** \\\n_Optional._ Census API key. It’s good practice to access the Census’s API with a credentialing key, though the scripts will run without one. [Request one here](https://api.census.gov/data/key_signup.html).\n\nFor example, a `config.json` for a project focused on Salem, MA that also includes adjacent Beverly, MA  as a place of interest (and includes census data for all six states that make up the New England region) would look like this...\n\n```json\n{\n  \"project\": \"salem\",\n  \"states\": [\"MA\", \"ME\", \"NH\", \"VT\", \"CT\", \"RI\"],\n  \"placenames\": [\n    {\n      \"place\": \"Salem\",\n      \"state\": \"MA\"\n    },\n    {\n      \"place\": \"Beverly\",\n      \"state\": \"MA\"\n    }\n  ],\n  \"crs\": 2249,\n  \"census_unit\": \"tracts\",\n  \"year\": 2021,\n  \"format\": \"gpkg\",\n  \"datasets\": [\"lodes\", \"occ\", \"ind\"],\n  \"census_api\": \"your_api_key\"\n}\n```\n\n## Data Dictionary\n\n\n### census_unit 🌎\n\nBoundaries of a selected census unit in the state of interest: can be either block groups or tracts.\n\n\n#### Geometry\n\nMULTIPOLYGON\n\n\n#### Fields\n\n\n\n+ **unit_id – string** \\\nThe unique identifier (AKA the FIPS code, often called the GEOID)\n+ **name_long - string** \\\nPlace state pair used to uniquely identify tract's place.\n+ **pl_name – string** \\\nName of the place including the census geography.\n+ **selected – boolean** \\\nWhether geography lies within the selected place(s).\n\n\n### places 🌎\n\nBoundaries of, in the case of Massachusetts, all municipalities and in other cases, census designated places in the selected state.\n\n\n#### Geometry\n\nMULTIPOLYGON\n\n\n#### Fields\n\n\n\n+ **name_long - string** \\\nPlace state pair used to uniquely identify  place.\n+ **pl_name – string** \\\nName of the place.\n+ **state – string** \\\nTwo-letter abbreviation of state in which geography falls.\n+ **selected – boolean** \\\nWhether place is selected.\n\n\n### census_unit_lodes\n\nTable including measures derived from the LEHD Origin-Destination Employment Survey (LODES) data at the given census level. \n\n\n#### Geometry\n\nNone. 1-to-1 cardinality with census_unit by “unit_id” in both tables.\n\n\n#### Fields\n\n\n\n+ **unit_id – string** \\\nThe unique identifier (AKA the FIPS code, often called the GEOID)\n+ **work_res_{MUNI_NAME} – integer** \\\n_(optional, only present if there is a selected placename)_ \\\nThe number of workers who work in the selected municipality who commute from a home that lies within the given census geography.\n+ **res_work_{MUNI_NAME} – integer** \\\n_(optional, only present if there is a selected placename)_ \\\nThe number of workers who live in the selected municipality who commute to a workplace that lies within given census geography.\n+ **pct_w_in_town – float (%)** \\\nThe % of workers who work in the census geography who also live in the town that the census area is in.\n+ **pct_w_in_unit – float (%)** \\\nThe % of workers who work in the census geography who also live in that census geography.\n+ **pct_h_in_town – float (%)** \\\nThe % of workers who live in the census geography who also live in the town that the census area is in.\n+ **pct_h_in_unit – float (%)** \\\nThe % of workers who live in the census geography who also work in that census geography.\n\n### lodes_unit_lines 🌎\n\nNon-aggregated unit-to-unit flows based on the LODES data.\n\n\n#### Geometry\n\nLINESTRING\n\n\n#### Fields\n\n+ **h_unit  – string** \\\nCensus geography of work. 1-to-many cardinality with **census_units **by **unit_hd = h_unit**\n+ **h_selected  – boolean** \\\nUsed to select only commutes from a home in the selected place.\n+ **w_unit  – string** \\\nCensus geography of home. 1-to-many cardinality with **census_units **by **unit_id = w_unit**\n+ **w_selected  – boolean** \\\nUsed to select only commutes to workplaces in the selected place.\n+ **count – integer** \\\nThe number of workers commuting from **h_unit** to **w_unit**.\n\n\n### lodes_place_lines 🌎\n\nPlace-to-place (so, municipality-to-municipality) flows. This is much simpler to interpret because it's aggregated to the place.\n\n\n#### Geometry\n\nLINESTRING\n\n\n#### Fields\n\n+ **pl_n_h  – string** \\\nPlace name of home. 1-to-many cardinality with **places_{state} **by **pl_name = pl_n_h**\n+ **h_selected  – boolean** \\\nUsed to select only commutes from a home in the selected place.\n+ **pl_n_w  – string** \\\nPlace name of work. 1-to-many cardinality with **places_{state} **by **pl_name = pl_n_h**\n+ **w_selected  – boolean** \\\nUsed to select only commutes to workplaces in the selected place.\n+ **count – integer** \\\nThe number of workers commuting from pl_n_h to pl_n_w.\n\n\n### occ_{area_type}_{depth}\n\nThese tables break down employment by occupation at various depths, or degrees of granularity based on ACS 5-year estimates of [Occupation by Sex for the Civilian Employed Population 16 Years and Over](https://data.census.gov/table/ACSST5Y2022.S2401). **place** indicates that we're looking at census designated places (generally, cities and towns). **unit** indicates they’re at the census unit level.\n\nThe **{depth}** suffix indicates whether it’s looking at more generalized or more specific categories (i.e., where in the petri dish hierarchy it sits). Higher depth numbers indicate more specific categories, lower depth numbers are more general.\n\n\n#### Geometry\n\nNone. occ_unit_{depth} has 1-to-1 cardinality with **census_unit** by **unit_id** in both tables.\n\n\n#### Fields\n\nReference [this table](https://data.census.gov/table/ACSST5Y2022.S2401) for columns. They are stored as percentages of the total, so each row should sum to 100.\n\n\n### ind_{area_type}_{depth}\n\nThese tables break down employment by industry at various depths, or degrees of granularity based on ACS 5-year estimates of [Industry by Sex for the Civilian Employed Population 16 Years and Older](https://data.census.gov/table/ACSST5Y2022.S2403). **place** indicates that we're looking at census designated places (generally, cities and towns). **unit** indicates they’re at the census unit level.\n\nThe **{depth}** suffix indicates whether it’s looking at more generalized or more specific categories (i.e., where in the petri dish hierarchy it sits). Higher depth numbers indicate more specific categories, lower depth numbers are more general.\n\n\n#### Geometry\n\nNone. ind_unit_{depth} has 1-to-1 cardinality with census_unit by **unit_id** in both tables.\n\n\n#### Fields\n\nReference [this table](https://data.census.gov/table/ACSST5Y2022.S2403) for columns. They are stored as percentages of the total, so each row should sum to 100.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fographiesresearch%2Furbanplanr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fographiesresearch%2Furbanplanr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fographiesresearch%2Furbanplanr/lists"}