Skip to content

Commit

Permalink
centerlineEvenlySpacedRelative -> centerline_evenly_spaced_relative
Browse files Browse the repository at this point in the history
  • Loading branch information
cyschneck committed Aug 17, 2024
1 parent c8dc973 commit 8ae4d79
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 15 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ The red pins represent the equal distance centerline coordinates produced by cen
* sinuosity (float): Sinuosity of the river based on evenly spaced centerline coordinates
* centerline_voronoi_relative (list of tuples): List of the relative distance coordinates of the centerline generated by Voronoi diagrams
* centerline_equal_distance_relative (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
* centerline_evenly_spaced_relative (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

<details closed>
Expand Down Expand Up @@ -315,7 +315,7 @@ Centerline coordinates are formed by Evenly Spaced vertices, set by `interpolate
```
river_object.centerline_evenly_spaced
```
| river_object.centerline_evenly_spaced | river_object.centerlineEvenlySpacedRelative |
| river_object.centerline_evenly_spaced | river_object.centerline_evenly_spaced_relative |
| ------------- | ------------- |
| ![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) |

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

if centerline_type == "Smoothed":
centerline_legend = "Smoothed Centerline Coordinates"
Expand Down
8 changes: 4 additions & 4 deletions centerline_width/pytests/test_verifyRiverCenterlineClass.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ def test_CenterlineWidth_default():
pytest.approx((-3.4084605052625445, 54.1351126169003)),
pytest.approx((-6.163506358375243, 53.60729340259522)),
]
assert river_class_example.centerlineEqualDistanceRelative == [
assert river_class_example.centerline_equal_distance_relative == [
pytest.approx((73.47047894946884, 72.32036803406206)),
pytest.approx((63.50393050487748, 73.13762693464152)),
pytest.approx((53.508195776029744, 72.84558714881928)),
Expand All @@ -513,7 +513,7 @@ def test_CenterlineWidth_default():
pytest.approx((6.039076670446599, 57.15074732117381)),
pytest.approx((-3.5642236371955707, 54.362087572923194))
]
assert river_class_example.centerlineEvenlySpacedRelative == [
assert river_class_example.centerline_evenly_spaced_relative == [
pytest.approx((73.47047894946884, 72.32036803406206)),
pytest.approx((70.49436362993764, 72.6058408175882)),
pytest.approx((67.51824832917079, 72.8913137541397)),
Expand Down Expand Up @@ -1977,7 +1977,7 @@ def test_CenterlineWidth_interpolateTrue():
pytest.approx((-3.4084605052625445, 54.1351126169003)),
pytest.approx((-6.163506358375243, 53.60729340259522))
]
assert river_class_example.centerlineEqualDistanceRelative == [
assert river_class_example.centerline_equal_distance_relative == [
pytest.approx((76.55076830013083, 72.09093998499534)),
pytest.approx((66.59044719216097, 72.9808857261491)),
pytest.approx((56.592933814925935, 73.20387960632621)),
Expand All @@ -1988,7 +1988,7 @@ def test_CenterlineWidth_interpolateTrue():
pytest.approx((8.958270139623515, 58.16146519825169)),
pytest.approx((-0.539383038040768, 55.03183517073071))
]
assert river_class_example.centerlineEvenlySpacedRelative == [
assert river_class_example.centerline_evenly_spaced_relative == [
pytest.approx((76.55076830013083, 72.09093998499534)),
pytest.approx((73.4584665012726, 72.32956453464425)),
pytest.approx((70.37172724666243, 72.6176042594705)),
Expand Down
12 changes: 11 additions & 1 deletion centerline_width/riverCenterlineClass.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ def __init__(self,

# Set the different types of Centerline coordinates
self.equal_distance = equal_distance

self.centerlineEqualDistance = centerline_width.equalDistanceCenterline(
centerline_coordinates=self.centerline_voronoi,
equal_distance=self.equal_distance,
Expand All @@ -172,12 +173,15 @@ def __init__(self,
centerline_coordinates=self.centerline_voronoi,
equal_distance=self.equal_distance,
ellipsoid=self.ellipsoid)

self.centerlineEvenlySpaced = centerline_width.evenlySpacedCenterline(
centerline_coordinates=self.centerline_voronoi,
number_of_fixed_points=self.interpolate_n_centerpoints)
number_of_fixed_points=self.interpolate_n_centerpoints
) # Pending Deprecation
self.centerline_evenly_spaced = centerline_width.evenlySpacedCenterline(
centerline_coordinates=self.centerline_voronoi,
number_of_fixed_points=self.interpolate_n_centerpoints)

self.centerlineSmoothed = centerline_width.smoothedCoordinates(
river_object=self,
centerline_coordinates=self.centerline_evenly_spaced,
Expand All @@ -194,15 +198,21 @@ def __init__(self,
self.centerline_voronoi_relative = centerline_width.relativeCenterlineCoordinates(
self.left_bank_coordinates[0], self.centerline_voronoi,
self.ellipsoid)

self.centerlineEqualDistanceRelative = centerline_width.relativeCenterlineCoordinates(
self.left_bank_coordinates[0], self.centerline_equal_distance,
self.ellipsoid) # Pending Deprecation
self.centerline_equal_distance_relative = centerline_width.relativeCenterlineCoordinates(
self.left_bank_coordinates[0], self.centerline_equal_distance,
self.ellipsoid)

self.centerlineEvenlySpacedRelative = centerline_width.relativeCenterlineCoordinates(
self.left_bank_coordinates[0], self.centerline_evenly_spaced,
self.ellipsoid) # Pending Deprecation
self.centerline_evenly_spaced_relative = centerline_width.relativeCenterlineCoordinates(
self.left_bank_coordinates[0], self.centerline_evenly_spaced,
self.ellipsoid)

self.centerlineSmoothedRelative = centerline_width.relativeCenterlineCoordinates(
self.left_bank_coordinates[0], self.centerline_smoothed,
self.ellipsoid)
Expand Down
4 changes: 2 additions & 2 deletions centerline_width/saveOutput.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def save_centerline_csv(river_object: centerline_width.CenterlineWidth = None,
if centerline_type == "Equal Distance":
centerline_coordinates_by_type = river_object.centerline_equal_distance_relative
if centerline_type == "Evenly Spaced":
centerline_coordinates_by_type = river_object.centerlineEvenlySpacedRelative
centerline_coordinates_by_type = river_object.centerline_evenly_spaced_relative
if centerline_type == "Smoothed":
centerline_coordinates_by_type = river_object.centerlineSmoothedRelative

Expand Down Expand Up @@ -129,7 +129,7 @@ def save_centerline_mat(river_object: centerline_width.CenterlineWidth = None,
if centerline_type == "Equal Distance":
centerline_coordinates_by_type = river_object.centerline_equal_distance_relative
if centerline_type == "Evenly Spaced":
centerline_coordinates_by_type = river_object.centerlineEvenlySpacedRelative
centerline_coordinates_by_type = river_object.centerline_evenly_spaced_relative
if centerline_type == "Smoothed":
centerline_coordinates_by_type = river_object.centerlineSmoothedRelative

Expand Down
5 changes: 2 additions & 3 deletions river_centerline_width_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,11 @@
river.centerline_voronoi_relative))
print("centerline_equal_distance_relative = {0}".format(
river.centerline_equal_distance_relative))
print("centerline_evenly_spaced_relative = {0}".format(
river.centerline_evenly_spaced_relative))
'''
print("Centerline Length = {0} m".format(river.centerlineLength * 1000))
print("ellipsoid = {0}".format(river.ellipsoid))
print("centerlineEvenlySpacedRelative = {0}".format(
river.centerlineEvenlySpacedRelative))
print("centerlineSmoothedRelative = {0}".format(
river.centerlineSmoothedRelative))
print(river.right_bank_relative_coordinates)
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 @@ -48,11 +48,11 @@
river.centerlineVoronoiRelative))
print("equalDistanceCenterlineRelative = {0}".format(
river.centerlineEqualDistanceRelative))
print("centerlineEvenlySpacedRelative = {0}".format(
river.centerlineEvenlySpacedRelative))
'''
print("Centerline Length = {0} m".format(river.centerlineLength * 1000))
print("ellipsoid = {0}".format(river.ellipsoid))
print("centerlineEvenlySpacedRelative = {0}".format(
river.centerlineEvenlySpacedRelative))
print("centerlineSmoothedRelative = {0}".format(
river.centerlineSmoothedRelative))
print(river.right_bank_relative_coordinates)
Expand Down

0 comments on commit 8ae4d79

Please sign in to comment.