Skip to content

Commit 1ea59d9

Browse files
committed
centerlineEvenlySpaced -> centerline_evenly_spaced
1 parent 8ca0a47 commit 1ea59d9

10 files changed

+26
-21
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Find the centerline and width of rivers based on the latitude and longitude posi
2323
* width()
2424
* centerline_voronoi
2525
* centerline_equal_distance
26-
* centerlineEvenlySpaced
26+
* centerline_evenly_spaced
2727
* centerlineSmoothed
2828
* centerlineLength
2929
* **Return river features**
@@ -227,7 +227,7 @@ The red pins represent the equal distance centerline coordinates produced by cen
227227

228228
* centerline_voronoi (list of tuples): List of the latitude and longitude coordinates of the centerline generated by Voronoi diagrams
229229
* centerline_equal_distance (list of tuples): List of the latitude and longitude coordinates of the centerline generated by equal distances between coordinates from the Voronoi diagrams
230-
* centerlineEvenlySpaced (list of tuples): List of the latitude and longitude coordinates of the centerline generated by evenly spacing out points generated by the Voronoi diagrams
230+
* centerline_evenly_spaced (list of tuples): List of the latitude and longitude coordinates of the centerline generated by evenly spacing out points generated by the Voronoi diagrams
231231
* centerlineSmoothed (list of tuples): List of the latitude and longitude coordinates of the centerline generated by smoothing out the evenly spaced-out points generated by the Voronoi diagrams
232232
* centerlineLength (float): Length of the centerline of the river (in km)
233233
* rightBankLength (float): Length of the right bank of the river (in km)
@@ -313,9 +313,9 @@ river_object.centerline_equal_distance
313313

314314
Centerline coordinates are formed by Evenly Spaced vertices, set by `interpolate_n_centerpoints`
315315
```
316-
river_object.centerlineEvenlySpaced
316+
river_object.centerline_evenly_spaced
317317
```
318-
| river_object.centerlineEvenlySpaced | river_object.centerlineEvenlySpacedRelative |
318+
| river_object.centerline_evenly_spaced | river_object.centerlineEvenlySpacedRelative |
319319
| ------------- | ------------- |
320320
| ![centerlineEvenlySpaced+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/evenly_spaced_centerline.png) | ![centerlineEvenlySpacedRelative+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/evenly_spaced_centerline_relative.png) |
321321

centerline_width/plotDiagrams.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def plotCenterlineBackend(
115115
if centerline_type == "Evenly Spaced":
116116
centerline_legend = "Evenly Spaced Centerline Coordinates"
117117
if coordinate_unit == "Decimal Degrees":
118-
centerline_coordinates_by_type = river_object.centerlineEvenlySpaced
118+
centerline_coordinates_by_type = river_object.centerline_evenly_spaced
119119
if coordinate_unit == "Relative Distance":
120120
centerline_coordinates_by_type = river_object.centerlineEvenlySpacedRelative
121121

@@ -352,7 +352,8 @@ def plot_centerline_width(
352352
# recreate the centerline with evenly spaced points
353353
right_width_coordinates, left_width_coordinates, num_intersection_coordinates = centerline_width.riverWidthFromCenterlineCoordinates(
354354
river_object=river_object,
355-
centerline_coordinates=river_object.centerlineEvenlySpaced,
355+
centerline_coordinates=river_object.
356+
centerline_evenly_spaced,
356357
transect_span_distance=transect_span_distance,
357358
transect_slope=transect_slope,
358359
remove_intersections=remove_intersections,

centerline_width/pytests/test_verifyRiverCenterlineClass.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ def test_CenterlineWidth_default():
417417
pytest.approx((-92.86797615799243, 30.037635124296454)),
418418
pytest.approx((-92.86800507153629, 30.037548493536658))
419419
]
420-
assert river_class_example.centerlineEvenlySpaced == [
420+
assert river_class_example.centerline_evenly_spaced == [
421421
pytest.approx((-92.86781887353752, 30.03824341873465)),
422422
pytest.approx((-92.86781591391708, 30.038216571334427)),
423423
pytest.approx((-92.86781295429665, 30.038189723934206)),
@@ -1883,7 +1883,7 @@ def test_CenterlineWidth_interpolateTrue():
18831883
pytest.approx((-92.8679656786269, 30.037661458145394)),
18841884
pytest.approx((-92.86799812738784, 30.037575780441053))
18851885
]
1886-
assert river_class_example.centerlineEvenlySpaced == [
1886+
assert river_class_example.centerline_evenly_spaced == [
18871887
pytest.approx((-92.86782125207236, 30.03827120587997)),
18881888
pytest.approx((-92.86781877818767, 30.03824331037043)),
18891889
pytest.approx((-92.8678157919604, 30.038215465037222)),

centerline_width/pytests/test_verifyWidth.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ def generate_testRiver():
4141
def generate_expectedCenterline(span_distance=None):
4242
# group points inclusive of previous point: [A, B, C, D] = [A, B], [B, C], [C, D]
4343
groups_of_n_points = []
44-
for i in range(0, len(test_river.centerlineEvenlySpaced), span_distance):
44+
for i in range(0, len(test_river.centerline_evenly_spaced), span_distance):
4545
if i == 0:
4646
groups_of_n_points.append(
47-
test_river.centerlineEvenlySpaced[0:span_distance])
47+
test_river.centerline_evenly_spaced[0:span_distance])
4848
else:
4949
groups_of_n_points.append(
50-
test_river.centerlineEvenlySpaced[i - 1:i + span_distance])
50+
test_river.centerline_evenly_spaced[i - 1:i + span_distance])
5151

5252
centerline_slope_expected = []
5353
for group_points in groups_of_n_points:

centerline_width/riverCenterlineClass.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,12 @@ def __init__(self,
166166
self.centerlineEvenlySpaced = centerline_width.evenlySpacedCenterline(
167167
centerline_coordinates=self.centerline_voronoi,
168168
number_of_fixed_points=self.interpolate_n_centerpoints)
169+
self.centerline_evenly_spaced = centerline_width.evenlySpacedCenterline(
170+
centerline_coordinates=self.centerline_voronoi,
171+
number_of_fixed_points=self.interpolate_n_centerpoints)
169172
self.centerlineSmoothed = centerline_width.smoothedCoordinates(
170173
river_object=self,
171-
centerline_coordinates=self.centerlineEvenlySpaced,
174+
centerline_coordinates=self.centerline_evenly_spaced,
172175
interprolate_num=self.interpolate_n_centerpoints)
173176

174177
# Relative Distance from bottom left bank point to each Centerline coordinates
@@ -179,15 +182,15 @@ def __init__(self,
179182
self.left_bank_coordinates[0], self.centerlineEqualDistance,
180183
self.ellipsoid)
181184
self.centerlineEvenlySpacedRelative = centerline_width.relativeCenterlineCoordinates(
182-
self.left_bank_coordinates[0], self.centerlineEvenlySpaced,
185+
self.left_bank_coordinates[0], self.centerline_evenly_spaced,
183186
self.ellipsoid)
184187
self.centerlineSmoothedRelative = centerline_width.relativeCenterlineCoordinates(
185188
self.left_bank_coordinates[0], self.centerlineSmoothed,
186189
self.ellipsoid)
187190

188191
# Overall Sinuosity
189192
self.sinuosity = centerline_width.calculateSinuosity(
190-
self.centerlineEvenlySpaced, self.ellipsoid)
193+
self.centerline_evenly_spaced, self.ellipsoid)
191194

192195
def incremental_sinuosity(self,
193196
incremental_points: int = 10,

centerline_width/riverFeatures.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ def incremental_sinuosity(
8484
incremental_points=incremental_points,
8585
save_to_csv=save_to_csv)
8686

87-
if river_object.centerlineEvenlySpaced is None:
87+
if river_object.centerline_evenly_spaced is None:
8888
return {}
8989

9090
# Ignore the first and last point in the coordinates
91-
centerline_coordinates = river_object.centerlineEvenlySpaced[1:-1]
91+
centerline_coordinates = river_object.centerline_evenly_spaced[1:-1]
9292

9393
# Separate centerline in groups of incremental_points long
9494
centerline_groups = list(

centerline_width/saveOutput.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def save_centerline_csv(river_object: centerline_width.CenterlineWidth = None,
5757
if centerline_type == "Equal Distance":
5858
centerline_coordinates_by_type = river_object.centerline_equal_distance
5959
if centerline_type == "Evenly Spaced":
60-
centerline_coordinates_by_type = river_object.centerlineEvenlySpaced
60+
centerline_coordinates_by_type = river_object.centerline_evenly_spaced
6161
if centerline_type == "Smoothed":
6262
centerline_coordinates_by_type = river_object.centerlineSmoothed
6363
if coordinate_unit == "Relative Distance":
@@ -120,7 +120,7 @@ def save_centerline_mat(river_object: centerline_width.CenterlineWidth = None,
120120
if centerline_type == "Equal Distance":
121121
centerline_coordinates_by_type = river_object.centerline_equal_distance
122122
if centerline_type == "Evenly Spaced":
123-
centerline_coordinates_by_type = river_object.centerlineEvenlySpaced
123+
centerline_coordinates_by_type = river_object.centerline_evenly_spaced
124124
if centerline_type == "Smoothed":
125125
centerline_coordinates_by_type = river_object.centerlineSmoothed
126126
if coordinate_unit == "Relative Distance":

centerline_width/width.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ def width(river_object: centerline_width.CenterlineWidth = None,
370370
else:
371371
right_width_coordinates, left_width_coordinates, num_intersection_coordinates = centerline_width.riverWidthFromCenterlineCoordinates(
372372
river_object=river_object,
373-
centerline_coordinates=river_object.centerlineEvenlySpaced,
373+
centerline_coordinates=river_object.centerline_evenly_spaced,
374374
transect_span_distance=transect_span_distance,
375375
remove_intersections=remove_intersections,
376376
coordinate_unit="Decimal Degrees")

river_centerline_width_example.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
print("centerline_voronoi = {0}".format(river.centerline_voronoi))
3838
print("centerline_equal_distance = {0}".format(
3939
river.centerline_equal_distance))
40+
print("centerline_evenly_spaced = {0}".format(
41+
river.centerline_evenly_spaced))
4042
'''
4143
print("\nCenterline Length = {0} km".format(river.centerlineLength))
4244
print("Centerline Length = {0} m".format(river.centerlineLength * 1000))
@@ -47,7 +49,6 @@
4749
river.centerlineVoronoiRelative))
4850
print("equalDistanceCenterlineRelative = {0}".format(
4951
river.centerlineEqualDistanceRelative))
50-
print("centerlineEvenlySpaced = {0}".format(river.centerlineEvenlySpaced))
5152
print("centerlineEvenlySpacedRelative = {0}".format(
5253
river.centerlineEvenlySpacedRelative))
5354
print("centerlineSmoothed = {0}".format(river.centerlineSmoothed))

river_centerline_width_example_deprecation.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
print("centerlineVoronoi = {0}".format(river.centerlineVoronoi))
4040
print("equalDistanceCenterline = {0}".format(
4141
river.centerlineEqualDistance))
42+
print("centerlineEvenlySpaced = {0}".format(river.centerlineEvenlySpaced))
4243
'''
4344
print("\nCenterline Length = {0} km".format(river.centerlineLength))
4445
print("Centerline Length = {0} m".format(river.centerlineLength * 1000))
@@ -49,7 +50,6 @@
4950
river.centerlineVoronoiRelative))
5051
print("equalDistanceCenterlineRelative = {0}".format(
5152
river.centerlineEqualDistanceRelative))
52-
print("centerlineEvenlySpaced = {0}".format(river.centerlineEvenlySpaced))
5353
print("centerlineEvenlySpacedRelative = {0}".format(
5454
river.centerlineEvenlySpacedRelative))
5555
print("centerlineSmoothed = {0}".format(river.centerlineSmoothed))

0 commit comments

Comments
 (0)