|
12 | 12 |
|
13 | 13 | # Valid Examples |
14 | 14 | cutoff = None |
15 | | - #cutoff = 10 |
| 15 | + cutoff = 10 |
16 | 16 | #cutoff = 15 # valid centerline, valid path, valid polygon, valid starting node, valid ending node |
17 | 17 | #cutoff = 30 |
18 | 18 | #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 |
20 | 20 | # Invalid Examples |
21 | 21 | #cutoff = 5 # invalid centerline, invalid path, valid polygon, invalid starting node, invalid ending nodes |
22 | 22 | #cutoff = 250 # valid centerline, valid path, invalid polygon, valid starting node, valid ending nodes |
|
27 | 27 | river = centerline_width.riverCenterline(csv_data="data/river_coords.csv", |
28 | 28 | optional_cutoff=cutoff, |
29 | 29 | 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, |
33 | 33 | ellipsoid="WGS84") |
34 | 34 |
|
35 | 35 | #print(river) |
36 | 36 | #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)) |
41 | 41 | #print("ellipsoid = {0}".format(river.ellipsoid)) |
42 | 42 | #print("centerlineVoronoi = {0}".format(river.centerlineVoronoi)) |
| 43 | + #print("centerlineVoronoiRelative = {0}".format(river.centerlineVoronoiRelative)) |
43 | 44 | #print("equalDistanceCenterline = {0}".format(river.centerlineEqualDistance)) |
| 45 | + #print("equalDistanceCenterlineRelative = {0}".format(river.centerlineEqualDistanceRelative)) |
44 | 46 | #print("centerlineEvenlySpaced = {0}".format(river.centerlineEvenlySpaced)) |
| 47 | + #print("centerlineEvenlySpacedRelative = {0}".format(river.centerlineEvenlySpacedRelative)) |
45 | 48 | #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) |
50 | 51 |
|
51 | | - coord_type = "reLATIVE DiSTANCE" |
| 52 | + #coord_type = "relative DIStance" |
| 53 | + coord_type = "Decimal Degrees" |
52 | 54 | center_type = "Voronoi" |
53 | 55 |
|
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) |
56 | 58 | #river.saveCenterlineCSV(save_to_csv="centerline_for_csv.csv", latitude_header="lat", longitude_header="long", centerline_type="Equal Distance") |
57 | 59 | #river.saveCenterlineMAT(save_to_mat="centerline_for_matlab.mat", latitude_header="lat", longitude_header="long", centerline_type="Evenly Spaced") |
58 | 60 |
|
|
61 | 63 | centerline_type=center_type, |
62 | 64 | marker_type="scatter", |
63 | 65 | centerline_color="black", |
64 | | - display_all_possible_paths=True, |
| 66 | + display_all_possible_paths=False, |
65 | 67 | display_voronoi=False, |
66 | 68 | plot_title=None, |
67 | | - coordinate_type=coord_type) |
| 69 | + coordinate_unit=coord_type) |
68 | 70 | transect = 3 |
69 | 71 |
|
70 | 72 | # Plot river bank width line |
71 | 73 | river.plotCenterlineWidth(save_plot_name=None, |
72 | 74 | plot_title=None, |
73 | | - display_true_centerline=True, |
| 75 | + display_true_centerline=False, |
74 | 76 | transect_span_distance=transect, |
75 | 77 | apply_smoothing=True, |
76 | 78 | flag_intersections=True, |
77 | | - remove_intersections=True, |
78 | | - coordinate_type=coord_type) |
| 79 | + remove_intersections=False, |
| 80 | + coordinate_unit=coord_type) |
79 | 81 |
|
80 | 82 | # Return width line for each centerline coordinates |
81 | 83 | river_width_dict = river.riverWidthFromCenterline(transect_span_distance=transect, |
82 | 84 | 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) |
86 | 88 |
|
87 | 89 | print("\nriver width dict = {0}\n".format(river_width_dict)) |
0 commit comments