-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add markdown and new clean notebook for the script
- Loading branch information
Showing
4 changed files
with
192 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Converting Jsons to Shapefiles for Accessibility Analysis | ||
|
||
Use these steps to convert jsons to a zipped shape file: | ||
1. Upload json file to folder in Jupyter Notebook | ||
2. Open notebook `project_location_to_shapefiles.ipynb` | ||
3. Add the following information for the uploaded to the function `json_to_shpfile`: | ||
* json file, | ||
* name for geojson | ||
* then the name of the zip file output | ||
4. Download your zipped shape file from the Cal-ITP GCS bucket or from the folder [zipped_locations](data-analyses/project_prioritization/accessibility/zipped_locations). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
111 changes: 111 additions & 0 deletions
111
project_prioritization/accessibility/project_location_to_shapefiles.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "20aaf3ca-9186-47ab-bb5a-2779c43de265", | ||
"metadata": {}, | ||
"source": [ | ||
"# Converting Jsons to Zipped GeoJsons" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"id": "6fcea931-86eb-4cc5-947a-3444e71485a7", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import pandas as pd\n", | ||
"import geopandas as gpd\n", | ||
"import matplotlib.pyplot as plt\n", | ||
"\n", | ||
"import _utils\n", | ||
"\n", | ||
"import json\n", | ||
"import re \n", | ||
"import ast\n", | ||
"import gcsfs\n", | ||
"import os" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "17f7db63-e65e-4821-a467-5a4628c998be", | ||
"metadata": {}, | ||
"source": [ | ||
"### Use function in _utils" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "e011563b-e4d8-4738-90f6-761499accfd3", | ||
"metadata": {}, | ||
"source": [ | ||
"Add the following information for the uploaded to the function `json_to_shpfile`:\n", | ||
"* json file, \n", | ||
"* name for geojson \n", | ||
"* then the name of the zip file output \n", | ||
"\n", | ||
"\n", | ||
"Download your zipped shape file from the Cal-ITP GCS bucket or from the folder [zipped_locations](data-analyses/project_prioritization/accessibility/zipped_locations). \n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "05afd750-4490-4485-b2e4-14c46047de2b", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"_utils.json_to_shpfile('.json', ##json file upload here\n", | ||
" '' ##local file name\n", | ||
" 'test_zipped_us101cc' ###name of the final zip file\n", | ||
" )" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "34e1d063-d483-4f38-a702-5fd4130f8930", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "f3ca5cc4-2529-4f1a-87b6-d28a3282a51b", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.9.13" | ||
}, | ||
"widgets": { | ||
"application/vnd.jupyter.widget-state+json": { | ||
"state": {}, | ||
"version_major": 2, | ||
"version_minor": 0 | ||
} | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
Oops, something went wrong.