Skip to content

Commit

Permalink
centerlineVoronoiRelative -> centerline_voronoi_relative
Browse files Browse the repository at this point in the history
  • Loading branch information
cyschneck committed Aug 17, 2024
1 parent 4cd9460 commit f6a9775
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ The red pins represent the equal distance centerline coordinates produced by cen
* left_bank_length (float): Length of the left bank of the river (in km)
* area (float): Area contained within river bank polygon (in km^2)
* sinuosity (float): Sinuosity of the river based on evenly spaced centerline coordinates
* centerlineVoronoiRelative (list of tuples): List of the relative distance coordinates of the centerline generated by Voronoi diagrams
* centerline_voronoi_relative (list of tuples): List of the relative distance coordinates of the centerline generated by Voronoi diagrams
* centerlineEqualDistanceRelative (list of tuples): List of the relative distance coordinates of the centerline generated by equal distances between coordinates from the Voronoi diagrams
* centerlineEvenlySpacedRelative (list of tuples): List of the relative distance coordinates of the centerline generated by evenly spacing out points generated by the Voronoi diagrams
* centerlineSmoothedRelative (list of tuples): List of the relative distance coordinates of the centerline generated by smoothing out the evenly spaced out points generated by the Voronoi diagrams
Expand Down Expand Up @@ -299,7 +299,7 @@ Centerline coordinates are formed by the Voronoi vertices
```
river_object.centerline_voronoi
```
| river_object.centerline_voronoi | river_object.centerlineVoronoiRelative |
| river_object.centerline_voronoi | river_object.centerline_voronoi_relative |
| ------------- | ------------- |
| ![centerlineVoronoi+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/voronoi_centerline.png) | ![centerlineVoronoiRelative+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/voronoi_centerline_relative.png) |

Expand Down
2 changes: 1 addition & 1 deletion centerline_width/plotDiagrams.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def plotCenterlineBackend(
if coordinate_unit == "Decimal Degrees":
centerline_coordinates_by_type = river_object.centerline_voronoi
if coordinate_unit == "Relative Distance":
centerline_coordinates_by_type = river_object.centerlineVoronoiRelative
centerline_coordinates_by_type = river_object.centerline_voronoi_relative

if centerline_type == "Equal Distance":
centerline_legend = "Equal Distance Centerline Coordinates"
Expand Down
4 changes: 2 additions & 2 deletions centerline_width/pytests/test_verifyRiverCenterlineClass.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ def test_CenterlineWidth_default():
pytest.approx((-92.86800440657967, 30.03755104077941)),
pytest.approx((-92.86801062016116, 30.037525395801037))
]
assert river_class_example.centerlineVoronoiRelative == [
assert river_class_example.centerline_voronoi_relative == [
pytest.approx((73.47047894946884, 72.32036803406206)),
pytest.approx((66.19109452005578, 73.01861616268259)),
pytest.approx((65.91411844882091, 73.04069054140477)),
Expand Down Expand Up @@ -1945,7 +1945,7 @@ def test_CenterlineWidth_interpolateTrue():
pytest.approx((-92.86800423779859, 30.037552027025324)),
pytest.approx((-92.86801078861649, 30.03752549183515))
]
assert river_class_example.centerlineVoronoiRelative == [
assert river_class_example.centerline_voronoi_relative == [
pytest.approx((76.55076830013083, 72.09093998499534)),
pytest.approx((74.6098789520801, 72.23550251163009)),
pytest.approx((73.4721576636839, 72.32834938994927)),
Expand Down
3 changes: 3 additions & 0 deletions centerline_width/riverCenterlineClass.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ def __init__(self,

# Relative Distance from bottom left bank point to each Centerline coordinates
self.centerlineVoronoiRelative = centerline_width.relativeCenterlineCoordinates(
self.left_bank_coordinates[0], self.centerline_voronoi,
self.ellipsoid) # Pending Deprecation
self.centerline_voronoi_relative = centerline_width.relativeCenterlineCoordinates(
self.left_bank_coordinates[0], self.centerline_voronoi,
self.ellipsoid)
self.centerlineEqualDistanceRelative = centerline_width.relativeCenterlineCoordinates(
Expand Down
4 changes: 2 additions & 2 deletions centerline_width/saveOutput.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def save_centerline_csv(river_object: centerline_width.CenterlineWidth = None,
centerline_coordinates_by_type = river_object.centerline_smoothed
if coordinate_unit == "Relative Distance":
if centerline_type == "Voronoi":
centerline_coordinates_by_type = river_object.centerlineVoronoiRelative
centerline_coordinates_by_type = river_object.centerline_voronoi_relative
if centerline_type == "Equal Distance":
centerline_coordinates_by_type = river_object.centerlineEqualDistanceRelative
if centerline_type == "Evenly Spaced":
Expand Down Expand Up @@ -125,7 +125,7 @@ def save_centerline_mat(river_object: centerline_width.CenterlineWidth = None,
centerline_coordinates_by_type = river_object.centerline_smoothed
if coordinate_unit == "Relative Distance":
if centerline_type == "Voronoi":
centerline_coordinates_by_type = river_object.centerlineVoronoiRelative
centerline_coordinates_by_type = river_object.centerline_voronoi_relative
if centerline_type == "Equal Distance":
centerline_coordinates_by_type = river_object.centerlineEqualDistanceRelative
if centerline_type == "Evenly Spaced":
Expand Down
4 changes: 2 additions & 2 deletions river_centerline_width_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
print("\nCenterline Length = {0} km".format(river.centerline_length))
print("Right Bank Length = {0} km".format(river.right_bank_length))
print("Left Bank Length = {0} km".format(river.left_bank_length))
print("centerline_voronoi_relative = {0}".format(
river.centerline_voronoi_relative))
'''
print("Centerline Length = {0} m".format(river.centerlineLength * 1000))
print("ellipsoid = {0}".format(river.ellipsoid))
print("centerlineVoronoiRelative = {0}".format(
river.centerlineVoronoiRelative))
print("equalDistanceCenterlineRelative = {0}".format(
river.centerlineEqualDistanceRelative))
print("centerlineEvenlySpacedRelative = {0}".format(
Expand Down
4 changes: 2 additions & 2 deletions river_centerline_width_example_deprecation.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
print("\nCenterline Length = {0} km".format(river.centerlineLength))
print("Right Bank Length = {0} km".format(river.rightBankLength))
print("Left Bank Length = {0} km".format(river.leftBankLength))
print("centerlineVoronoiRelative = {0}".format(
river.centerlineVoronoiRelative))
'''
print("Centerline Length = {0} m".format(river.centerlineLength * 1000))
print("ellipsoid = {0}".format(river.ellipsoid))
print("centerlineVoronoiRelative = {0}".format(
river.centerlineVoronoiRelative))
print("equalDistanceCenterlineRelative = {0}".format(
river.centerlineEqualDistanceRelative))
print("centerlineEvenlySpacedRelative = {0}".format(
Expand Down

0 comments on commit f6a9775

Please sign in to comment.