Skip to content

Commit 8ca0a47

Browse files
committed
centerlineEqualDistance -> centerline_equal_distance
1 parent f5a430d commit 8ca0a47

7 files changed

+19
-15
lines changed

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Find the centerline and width of rivers based on the latitude and longitude posi
2222
* plot_centerline_width()
2323
* width()
2424
* centerline_voronoi
25-
* centerlineEqualDistance
25+
* centerline_equal_distance
2626
* centerlineEvenlySpaced
2727
* centerlineSmoothed
2828
* centerlineLength
@@ -226,7 +226,7 @@ The red pins represent the equal distance centerline coordinates produced by cen
226226
**Object (class) useful attributes:**
227227

228228
* centerline_voronoi (list of tuples): List of the latitude and longitude coordinates of the centerline generated by Voronoi diagrams
229-
* centerlineEqualDistance (list of tuples): List of the latitude and longitude coordinates of the centerline generated by equal distances between coordinates from the Voronoi diagrams
229+
* 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
230230
* 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
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)
@@ -248,8 +248,8 @@ The red pins represent the equal distance centerline coordinates produced by cen
248248
<li>left_bank_relative_coordinates (list of tuples): list of relative distances coordinates of the left bank, measured as the distance in meters from the first point on the left bank (`[(x, y), (x, y)]`)</li>
249249
<li>right_bank_relative_coordinates (list of tuples): list of relative distances coordinates of the right bank, measured as the distance in meters from the first point on the left bank (`[(x, y), (x, y)]`)</li>
250250
<li>df_len (int): Length of the data frame of the csv data (spliced by the cutoff)</li>
251-
<li>equal_distance (int): Distance between points (in meters) used in centerlineEqualDistance, defaults to points every 10 meters</li>
252-
<li>ellipsoid (string): Built-in ellipsoid definition of Earth to determine how degrees are converted to meters used by centerlineEqualDistance, defaults to "WGS84"</li>
251+
<li>equal_distance (int): Distance between points (in meters) used in centerline_equal_distance, defaults to points every 10 meters</li>
252+
<li>ellipsoid (string): Built-in ellipsoid definition of Earth to determine how degrees are converted to meters used by centerline_equal_distance, defaults to "WGS84"</li>
253253
<li>bank_polygon (Shapley Polygon): Multi-sided polygon generated to encapsulate the latitude/longitude coordinate riverbank (used to define an inside and an outside of the river)</li>
254254
<li>bank_polygon_relative (Shapley Polygon): Multi-sided polygon generated to encapsulate the relative distance coordinate riverbank (used to define an inside and an outside of the river)</li>
255255
<li>top_bank (Shapley Linestring): Linestring that represents the top of the river/polygon for the latitude/longitude coordinate system</li>
@@ -305,9 +305,9 @@ river_object.centerline_voronoi
305305

306306
Centerline coordinates are formed by Equally Distanced vertices, set by `equal_distance`
307307
```
308-
river_object.centerlineEqualDistance
308+
river_object.centerline_equal_distance
309309
```
310-
| river_object.centerlineEqualDistance | river_object.centerlineEqualDistanceRelative |
310+
| river_object.centerline_equal_distance | river_object.centerlineEqualDistanceRelative |
311311
| ------------- | ------------- |
312312
| ![centerlineEqualDistance+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/equal_distance_centerline.png) | ![centerlineEqualDistanceRelative+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/equal_distance_centerline_relative.png) |
313313

centerline_width/plotDiagrams.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def plotCenterlineBackend(
108108
if centerline_type == "Equal Distance":
109109
centerline_legend = "Equal Distance Centerline Coordinates"
110110
if coordinate_unit == "Decimal Degrees":
111-
centerline_coordinates_by_type = river_object.centerlineEqualDistance
111+
centerline_coordinates_by_type = river_object.centerline_equal_distance
112112
if coordinate_unit == "Relative Distance":
113113
centerline_coordinates_by_type = river_object.centerlineEqualDistanceRelative
114114

centerline_width/pytests/test_verifyRiverCenterlineClass.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ def test_CenterlineWidth_default():
406406
assert river_class_example.centerlineLength == pytest.approx(
407407
0.08284102060354828)
408408
assert river_class_example.equal_distance == 10
409-
assert river_class_example.centerlineEqualDistance == [
409+
assert river_class_example.centerline_equal_distance == [
410410
pytest.approx((-92.86781887353752, 30.03824341873465)),
411411
pytest.approx((-92.86781040076286, 30.03815351096445)),
412412
pytest.approx((-92.867813429355, 30.038063339971036)),
@@ -1872,7 +1872,7 @@ def test_CenterlineWidth_interpolateTrue():
18721872
assert river_class_example.centerlineLength == pytest.approx(
18731873
0.08592777952584983)
18741874
assert river_class_example.equal_distance == 10
1875-
assert river_class_example.centerlineEqualDistance == [
1875+
assert river_class_example.centerline_equal_distance == [
18761876
pytest.approx((-92.86782125207236, 30.03827120587997)),
18771877
pytest.approx((-92.86781202566551, 30.03818135428244)),
18781878
pytest.approx((-92.86780971432128, 30.038091167213576)),

centerline_width/riverCenterlineClass.py

+4
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ def __init__(self,
159159
centerline_coordinates=self.centerline_voronoi,
160160
equal_distance=self.equal_distance,
161161
ellipsoid=self.ellipsoid)
162+
self.centerline_equal_distance = centerline_width.equalDistanceCenterline(
163+
centerline_coordinates=self.centerline_voronoi,
164+
equal_distance=self.equal_distance,
165+
ellipsoid=self.ellipsoid)
162166
self.centerlineEvenlySpaced = centerline_width.evenlySpacedCenterline(
163167
centerline_coordinates=self.centerline_voronoi,
164168
number_of_fixed_points=self.interpolate_n_centerpoints)

centerline_width/saveOutput.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def save_centerline_csv(river_object: centerline_width.CenterlineWidth = None,
5555
if centerline_type == "Voronoi":
5656
centerline_coordinates_by_type = river_object.centerline_voronoi
5757
if centerline_type == "Equal Distance":
58-
centerline_coordinates_by_type = river_object.centerlineEqualDistance
58+
centerline_coordinates_by_type = river_object.centerline_equal_distance
5959
if centerline_type == "Evenly Spaced":
6060
centerline_coordinates_by_type = river_object.centerlineEvenlySpaced
6161
if centerline_type == "Smoothed":
@@ -118,7 +118,7 @@ def save_centerline_mat(river_object: centerline_width.CenterlineWidth = None,
118118
if centerline_type == "Voronoi":
119119
centerline_coordinates_by_type = river_object.centerline_voronoi
120120
if centerline_type == "Equal Distance":
121-
centerline_coordinates_by_type = river_object.centerlineEqualDistance
121+
centerline_coordinates_by_type = river_object.centerline_equal_distance
122122
if centerline_type == "Evenly Spaced":
123123
centerline_coordinates_by_type = river_object.centerlineEvenlySpaced
124124
if centerline_type == "Smoothed":

river_centerline_width_example.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
#print(river)
3636
#print(river.__dict__.keys())
3737
print("centerline_voronoi = {0}".format(river.centerline_voronoi))
38+
print("centerline_equal_distance = {0}".format(
39+
river.centerline_equal_distance))
3840
'''
3941
print("\nCenterline Length = {0} km".format(river.centerlineLength))
4042
print("Centerline Length = {0} m".format(river.centerlineLength * 1000))
@@ -43,8 +45,6 @@
4345
print("ellipsoid = {0}".format(river.ellipsoid))
4446
print("centerlineVoronoiRelative = {0}".format(
4547
river.centerlineVoronoiRelative))
46-
print("equalDistanceCenterline = {0}".format(
47-
river.centerlineEqualDistance))
4848
print("equalDistanceCenterlineRelative = {0}".format(
4949
river.centerlineEqualDistanceRelative))
5050
print("centerlineEvenlySpaced = {0}".format(river.centerlineEvenlySpaced))

river_centerline_width_example_deprecation.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
#print(river)
3838
#print(river.__dict__.keys())
3939
print("centerlineVoronoi = {0}".format(river.centerlineVoronoi))
40+
print("equalDistanceCenterline = {0}".format(
41+
river.centerlineEqualDistance))
4042
'''
4143
print("\nCenterline Length = {0} km".format(river.centerlineLength))
4244
print("Centerline Length = {0} m".format(river.centerlineLength * 1000))
@@ -45,8 +47,6 @@
4547
print("ellipsoid = {0}".format(river.ellipsoid))
4648
print("centerlineVoronoiRelative = {0}".format(
4749
river.centerlineVoronoiRelative))
48-
print("equalDistanceCenterline = {0}".format(
49-
river.centerlineEqualDistance))
5050
print("equalDistanceCenterlineRelative = {0}".format(
5151
river.centerlineEqualDistanceRelative))
5252
print("centerlineEvenlySpaced = {0}".format(river.centerlineEvenlySpaced))

0 commit comments

Comments
 (0)