-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstore.py
36 lines (29 loc) · 1.33 KB
/
store.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import os
import sys
from variables import *
import geopandas as gpd
import requests
def import_github(user='nicholasmartino', repository='morphology', branch='master', file='main.py'):
r = requests.get(f"https://raw.githubusercontent.com/{user}/{repository}/{branch}/{file}")
with open(f"models/{file}", "wb") as f:
f.write(r.content)
return
import_github(repository='morphology', file='ShapeTools.py')
import_github(repository='city', file='Network.py')
# Local settings
GRID_GDF = gpd.read_file(f'data/geojson/{GRID_FILE}')
# Server settings
if sys.platform == 'win32':
SERVER_DIR = f'S:/Research/eLabs/50_projects/20_City_o_Vancouver/SSHRC Partnership Engage'
else:
SERVER_DIR = f'/Volumes/SALA/Research/eLabs/50_projects/20_City_o_Vancouver/SSHRC Partnership Engage'
# GRID_DIR = f'{SERVER_DIR}/Data/gmm_grids'
# GRID_FILES = ['dunbar_baseline.geojson', 'kitsilano_baseline.geojson']
# OUT_DIR = f'{SERVER_DIR}/Sandbox/shp/City-Wide'
if 'streets_utm_cov.feather' in os.listdir('data/feather'):
STREETS = gpd.read_feather(f'data/feather/streets_utm_cov.feather')
else:
STREETS = gpd.read_file(f'{SERVER_DIR}/Sandbox/shp/COV/Data/COV/streets_utm_cov.shp')
STREETS.to_feather('data/feather/streets_utm_cov.feather')
TILE_GDF = gpd.read_feather('data/feather/all_tiles.feather')
NET_GDF = gpd.read_feather('data/feather/all_tiles_network.feather')