Skip to content

Commit

Permalink
latest updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dhardestylewis committed Oct 12, 2021
1 parent 327829e commit 51260c2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
Binary file modified src/dem2basin/.dem2basin.py.swp
Binary file not shown.
Binary file modified src/dem2basin/__pycache__/dem2basin.cpython-37.pyc
Binary file not shown.
21 changes: 11 additions & 10 deletions src/dem2basin/dem2basin.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,8 +823,8 @@ def find_raster_filenames(
)
if get_epsg:
fathom_file_epsg = fathom_file_crs[-1].to_epsg()
if get_geographic_crs:
## TODO: find correct function to get geographic CRS here
# if get_geographic_crs:
# fathom_file_geographic_crs = fathom_file_crs[-1].

fathom_filenames = pd.DataFrame(
Expand Down Expand Up @@ -1009,8 +1009,8 @@ def __init__(
def index_lidar_files(
self,
lidar_parent_directory,
hucs,
availability_file,
hucs = None,
new_availability_file = None,
drop_index_columns = True
):
Expand Down Expand Up @@ -1050,13 +1050,6 @@ def index_lidar_files(
if drop_index_columns:
availability = _drop_index_columns(availability)

availability = gpd.sjoin(
availability,
hucs[['HUC','geometry']].to_crs(availability.crs),
how = 'inner',
op = 'intersects'
)

filetypes = ('*.img', '*.dem', '*.tif')
lidardatafiles = []
for filetype in filetypes:
Expand Down Expand Up @@ -1086,7 +1079,7 @@ def index_lidar_files(
'dem',
row[1]
),
axis=1
axis = 1
)
availability['pathlower'] = availability['path'].apply(
lambda path: path.lower()
Expand All @@ -1100,6 +1093,14 @@ def index_lidar_files(
lambda fn: str(fn)
)

if hucs is not None:
availability = gpd.sjoin(
availability,
hucs[['HUC','geometry']].to_crs(availability.crs),
how = 'inner',
op = 'intersects'
)

if new_availability_file is not None:
availability.to_file(new_availability_file)

Expand Down

0 comments on commit 51260c2

Please sign in to comment.