|
|
@ -18,9 +18,11 @@ def shapes_from_shp(shp_file):
|
|
|
|
:return:
|
|
|
|
:return:
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
shapes = []
|
|
|
|
shapes = []
|
|
|
|
for feat in fiona.open(shp_file):
|
|
|
|
ids = []
|
|
|
|
|
|
|
|
for feat in fiona.open(shp_file,'r'):
|
|
|
|
shapes.append(shape(feat['geometry']))
|
|
|
|
shapes.append(shape(feat['geometry']))
|
|
|
|
return shapes
|
|
|
|
ids.append(feat['id'])
|
|
|
|
|
|
|
|
return shapes, ids
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def convert_coord_systems(g1, in_coord_system='EPSG:4326', out_coord_system='EPSG:28356'):
|
|
|
|
def convert_coord_systems(g1, in_coord_system='EPSG:4326', out_coord_system='EPSG:28356'):
|
|
|
@ -126,12 +128,18 @@ def distance_to_intersection(lat, lon, orientation, line_strings):
|
|
|
|
|
|
|
|
|
|
|
|
# todo
|
|
|
|
# todo
|
|
|
|
def get_sites_dune_crest_toe():
|
|
|
|
def get_sites_dune_crest_toe():
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
Reads dune crest and toe files and creates a pandas dataframe with crest/toe locations at each site_
|
|
|
|
|
|
|
|
:return:
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Get site information
|
|
|
|
data_folder = './data/interim'
|
|
|
|
data_folder = './data/interim'
|
|
|
|
df_sites = pd.read_csv(os.path.join(data_folder, 'sites.csv'), index_col=[0])
|
|
|
|
df_sites = pd.read_csv(os.path.join(data_folder, 'sites.csv'), index_col=[0])
|
|
|
|
|
|
|
|
|
|
|
|
# Import
|
|
|
|
# Import our dune crest and toes
|
|
|
|
for f in ['./data/raw/profile_features/dune_crests.shp']:
|
|
|
|
for f in ['./data/raw/profile_features/dune_crests.shp']:
|
|
|
|
shapes = shapes_from_shp(f)
|
|
|
|
shapes, _ = shapes_from_shp(f)
|
|
|
|
shapes = [convert_coord_systems(x) for x in shapes]
|
|
|
|
shapes = [convert_coord_systems(x) for x in shapes]
|
|
|
|
|
|
|
|
|
|
|
|
# Iterate through each site
|
|
|
|
# Iterate through each site
|
|
|
|