Skip to content

Commit 5a18e3b

Browse files
committed
v1.2.0 coordinate_type -> coordinate_unit
1 parent 581e155 commit 5a18e3b

3 files changed

Lines changed: 27 additions & 25 deletions

File tree

-4.44 KB
Loading

river_centerline_width_example.py

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212

1313
# Valid Examples
1414
cutoff = None
15-
#cutoff = 10
15+
cutoff = 10
1616
#cutoff = 15 # valid centerline, valid path, valid polygon, valid starting node, valid ending node
1717
#cutoff = 30
1818
#cutoff = 100 # valid centerline, valid path, valid polygon, valid starting node, valid ending node
19-
cutoff = 550 # valid centerline, valid path, valid polygon, valid starting node, valid ending node
19+
#cutoff = 550 # valid centerline, valid path, valid polygon, valid starting node, valid ending node
2020
# Invalid Examples
2121
#cutoff = 5 # invalid centerline, invalid path, valid polygon, invalid starting node, invalid ending nodes
2222
#cutoff = 250 # valid centerline, valid path, invalid polygon, valid starting node, valid ending nodes
@@ -27,32 +27,34 @@
2727
river = centerline_width.riverCenterline(csv_data="data/river_coords.csv",
2828
optional_cutoff=cutoff,
2929
interpolate_data=False,
30-
interpolate_n=10,
31-
interpolate_n_centerpoints=None,
32-
equal_distance=20,
30+
interpolate_n=200,
31+
interpolate_n_centerpoints=200,
32+
equal_distance=10,
3333
ellipsoid="WGS84")
3434

3535
#print(river)
3636
#print(river.__dict__.keys())
37-
print("\nCenterline Length = {0} km".format(river.centerlineLength))
38-
print("Centerline Length = {0} m".format(river.centerlineLength*1000))
39-
print("Right Bank Length = {0} km".format(river.rightBankLength))
40-
print("Left Bank Length = {0} km".format(river.leftBankLength))
37+
#print("\nCenterline Length = {0} km".format(river.centerlineLength))
38+
#print("Centerline Length = {0} m".format(river.centerlineLength*1000))
39+
#print("Right Bank Length = {0} km".format(river.rightBankLength))
40+
#print("Left Bank Length = {0} km".format(river.leftBankLength))
4141
#print("ellipsoid = {0}".format(river.ellipsoid))
4242
#print("centerlineVoronoi = {0}".format(river.centerlineVoronoi))
43+
#print("centerlineVoronoiRelative = {0}".format(river.centerlineVoronoiRelative))
4344
#print("equalDistanceCenterline = {0}".format(river.centerlineEqualDistance))
45+
#print("equalDistanceCenterlineRelative = {0}".format(river.centerlineEqualDistanceRelative))
4446
#print("centerlineEvenlySpaced = {0}".format(river.centerlineEvenlySpaced))
47+
#print("centerlineEvenlySpacedRelative = {0}".format(river.centerlineEvenlySpacedRelative))
4548
#print("centerlineSmoothed = {0}".format(river.centerlineSmoothed))
46-
#print("centerlineVoronoi = {0}".format(len(river.centerlineVoronoi)))
47-
#print("equalDistanceCenterline = {0}".format(len(river.centerlineEqualDistance)))
48-
#print("centerlineEvenlySpaced = {0}".format(len(river.centerlineEvenlySpaced)))
49-
#print("centerlineSmoothed = {0}".format(len(river.centerlineSmoothed)))
49+
#print("centerlineSmoothedRelative = {0}".format(river.centerlineSmoothedRelative))
50+
#print(river.left_bank_relative_coordinates)
5051

51-
coord_type = "reLATIVE DiSTANCE"
52+
#coord_type = "relative DIStance"
53+
coord_type = "Decimal Degrees"
5254
center_type = "Voronoi"
5355

54-
river.saveCenterlineCSV(save_to_csv="centerline_for_csv.csv", centerline_type=center_type, coordinate_type=coord_type)
55-
river.saveCenterlineMAT(save_to_mat="centerline_for_matlab.mat", centerline_type=center_type, coordinate_type=coord_type)
56+
river.saveCenterlineCSV(save_to_csv="centerline_for_csv.csv", centerline_type=center_type, coordinate_unit=coord_type)
57+
river.saveCenterlineMAT(save_to_mat="centerline_for_matlab.mat", centerline_type=center_type, coordinate_unit=coord_type)
5658
#river.saveCenterlineCSV(save_to_csv="centerline_for_csv.csv", latitude_header="lat", longitude_header="long", centerline_type="Equal Distance")
5759
#river.saveCenterlineMAT(save_to_mat="centerline_for_matlab.mat", latitude_header="lat", longitude_header="long", centerline_type="Evenly Spaced")
5860

@@ -61,27 +63,27 @@
6163
centerline_type=center_type,
6264
marker_type="scatter",
6365
centerline_color="black",
64-
display_all_possible_paths=True,
66+
display_all_possible_paths=False,
6567
display_voronoi=False,
6668
plot_title=None,
67-
coordinate_type=coord_type)
69+
coordinate_unit=coord_type)
6870
transect = 3
6971

7072
# Plot river bank width line
7173
river.plotCenterlineWidth(save_plot_name=None,
7274
plot_title=None,
73-
display_true_centerline=True,
75+
display_true_centerline=False,
7476
transect_span_distance=transect,
7577
apply_smoothing=True,
7678
flag_intersections=True,
77-
remove_intersections=True,
78-
coordinate_type=coord_type)
79+
remove_intersections=False,
80+
coordinate_unit=coord_type)
7981

8082
# Return width line for each centerline coordinates
8183
river_width_dict = river.riverWidthFromCenterline(transect_span_distance=transect,
8284
apply_smoothing=True,
83-
remove_intersections=True,
84-
save_to_csv="width_for_csv.csv",
85-
coordinate_type=coord_type)
85+
remove_intersections=False,
86+
save_to_csv=None,
87+
coordinate_unit=coord_type)
8688

8789
print("\nriver width dict = {0}\n".format(river_width_dict))

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Python Package Setup
44
from setuptools import setup, find_namespace_packages
55

6-
VERSION="1.1.0"
6+
VERSION="1.2.0"
77
DESCRIPTION="A Python package to find the centerline and width of rivers based on the latitude and longitude of the right and left bank"
88

99
with open("README.md", "r") as f:

0 commit comments

Comments
 (0)