<jupyter_start><jupyter_text>Creating two road networks1. Removing the South Road and its neighboring roads2. Strengthening the capacity of South Road<jupyter_code>import geopandas as gpd
import pandas as pd
import numpy as np
data_mount = '/Users/shenhaowang/Dropbox (MIT)/project_media_lab_South_Australia/SA data/'

all_roads = gpd.read_file(data_mount + 'dataSA/roads/Roads_GDA2020.shp')
South_road = gpd.read_file(data_mount + 'dataSA/roads/South_Road_Highway.shp')

all_roads.crs
South_road.crs
all_roads.shape
South_road.shape
South_road.plot()
all_roads.plot()
all_roads.head()
South_road.head()
all_roads_HWY=all_roads.loc[all_roads['class'] == 'HWY', :]
all_roads_rest=all_roads.loc[all_roads['class'] != 'HWY', :]
all_roads_HWY_without_south_road = all_roads_HWY.loc[~all_roads_HWY['geometry'].isin(South_road['geometry']), :]
# combine
all_roads_rest_without_sr = pd.concat([all_roads_rest, all_roads_HWY_without_south_road], axis=0)
print(all_roads_rest_without_sr.shape)<jupyter_output>(457411, 36)<jupyter_text>Save the file<jupyter_code># Save
all_roads_rest_without_sr.to_file(data_mount + 'dataSA/roads/Roads_GDA2020_without_South_Road.shp')
# save
all_roads_HWY_without_south_road.to_file(data_mount + 'dataSA/roads/HWY_without_South_Road.shp')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1136890951276102, 'fraction_numerical': 0.014694508894044857, 'mean_word_length': 9.435483870967742, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '341470', 'license': 'MIT', 'n_tokens_mistral': 552, 'n_tokens_neox': 500, 'n_words': 68, 'path': 'notebooks/sw/Create_Two_Road_Networks.ipynb', 'repo_name': 'cjsyzwsh/South_Australia_Transport_Econ', 'size': '1293'}