Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated static file generation #48

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions RAPIDpy/gis/muskingum.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def CreateMuskingumKfacFile(in_drainage_line,
open_shapefile(in_drainage_line, file_geodatabase)

number_of_features = ogr_drainage_line_shapefile_lyr.GetFeatureCount()
river_id_list = np.zeros(number_of_features, dtype=np.int32)
river_id_list = np.zeros(number_of_features, dtype=np.int64)

length_list = \
np.zeros(number_of_features, dtype=np.float32)
Expand Down Expand Up @@ -145,7 +145,7 @@ def CreateMuskingumKfacFile(in_drainage_line,
connectivity_table = np.loadtxt(in_connectivity_file,
delimiter=",",
ndmin=2,
dtype=int)
dtype=np.int64)

length_slope_array = []
kfac2_array = []
Expand Down
12 changes: 6 additions & 6 deletions RAPIDpy/gis/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def StreamIDNextDownIDToConnectivity(stream_id_array,
np.concatenate(
[np.array([hydroid, nextDownID, count_upstream]),
list_upstreamID]
).astype(int))
).astype(np.int64))

with open_csv(out_csv_file, 'w') as csvfile:
connectwriter = csv_writer(csvfile)
Expand All @@ -54,7 +54,7 @@ def StreamIDNextDownIDToConnectivity(stream_id_array,
row_list,
np.array([0 for _ in xrange(max_count_upstream - row_list[2])])
])
connectwriter.writerow(out.astype(int))
connectwriter.writerow(out.astype(np.int64))


def CreateNetworkConnectivity(in_drainage_line,
Expand Down Expand Up @@ -105,8 +105,8 @@ def CreateNetworkConnectivity(in_drainage_line,
stream_id_array.append(drainage_line_feature.GetField(river_id))
next_down_id_array.append(drainage_line_feature.GetField(next_down_id))

stream_id_array = np.array(stream_id_array, dtype=np.int32)
next_down_id_array = np.array(next_down_id_array, dtype=np.int32)
stream_id_array = np.array(stream_id_array, dtype=np.int64)
next_down_id_array = np.array(next_down_id_array, dtype=np.int64)

StreamIDNextDownIDToConnectivity(stream_id_array,
next_down_id_array,
Expand Down Expand Up @@ -312,9 +312,9 @@ def CreateSubsetFile(in_drainage_line,

del ogr_drainage_line_shapefile

hydroid_list = np.array(hydroid_list, dtype=np.int32)
hydroid_list = np.array(hydroid_list, dtype=np.int64)
if hydroseq_list:
hydroseq_list = np.array(hydroseq_list, dtype=np.int32)
hydroseq_list = np.array(hydroseq_list, dtype=np.int64)
sort_order = hydroseq_list.argsort()[::-1]
hydroid_list = hydroid_list[sort_order]
else:
Expand Down