Download state borders shapefiles and urban / rural areas shapefiles from our azure blob storage account.
Create a shapefile for USA Tamu loadzones:
Use lat-lon data to create a GeoDataFrame of USA Tamu substations
Approximate the shapes of the USA Tamu loadzones by generating the convex hull polygon of substations within each zone.
Trim these new shapes to fit inside USA state borders
Use translate_zone_set() to generate a matrix translation from the urban/rural data to the newly created USA Tamu data
Testing
Unit tests in test_generate_rural_shapefiles.py
I tested all the code except the translate_urban_rural_to_usa_tamu() because that function requires lots of downloading / writing / reading files.
Where to look
create_usa_tamu_convex_hull_shapefile() has the most important code.
Usage Example/Visuals
How the code can be used and/or images of any graphs, tables or other visuals (not always applicable).
Pull Request doc
Purpose
Create a matrix that can be used to transform urban and rural USA data to USA tamu data. Currently this transformation is strictly based on area.
The USA Tamu shapefiles can be found here: https://besciences.blob.core.windows.net/shapefiles/USA/usa-tamu-loadzones-convex-hull/usa-tamu-loadzones-convex-hull.shp
The resulting matrix generated by this script currently lives here: https://www.dropbox.com/s/y2oopigjg0bxrhb/translate-urban-rural-to-usa-tamu.csv
What the code is doing
translate_zone_set()
to generate a matrix translation from the urban/rural data to the newly created USA Tamu dataTesting
Unit tests in
test_generate_rural_shapefiles.py
I tested all the code except thetranslate_urban_rural_to_usa_tamu()
because that function requires lots of downloading / writing / reading files.Where to look
create_usa_tamu_convex_hull_shapefile()
has the most important code.Usage Example/Visuals
How the code can be used and/or images of any graphs, tables or other visuals (not always applicable).
Time estimate
20 mins