From 0605f02dd44ecc5e648bf5d528a0a4492e32ab41 Mon Sep 17 00:00:00 2001 From: Paul Ramsey Date: Fri, 4 Nov 2022 12:12:54 -0700 Subject: [PATCH] Fix spelling error in getFrechetDistance, closes #725 --- .../algorithm/distance/DiscreteFrechetDistance.h | 2 +- src/algorithm/distance/DiscreteFrechetDistance.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/geos/algorithm/distance/DiscreteFrechetDistance.h b/include/geos/algorithm/distance/DiscreteFrechetDistance.h index 906df23e06..da72b382c8 100644 --- a/include/geos/algorithm/distance/DiscreteFrechetDistance.h +++ b/include/geos/algorithm/distance/DiscreteFrechetDistance.h @@ -146,7 +146,7 @@ class GEOS_DLL DiscreteFrechetDistance { private: geom::Coordinate getSegmentAt(const geom::CoordinateSequence& seq, std::size_t index); - PointPairDistance& getFrecheDistance(std::vector< std::vector >& ca, std::size_t i, std::size_t j, + PointPairDistance& getFrechetDistance(std::vector< std::vector >& ca, std::size_t i, std::size_t j, const geom::CoordinateSequence& p, const geom::CoordinateSequence& q); void compute(const geom::Geometry& discreteGeom, const geom::Geometry& geom); diff --git a/src/algorithm/distance/DiscreteFrechetDistance.cpp b/src/algorithm/distance/DiscreteFrechetDistance.cpp index 923f2afc92..8987aacda5 100644 --- a/src/algorithm/distance/DiscreteFrechetDistance.cpp +++ b/src/algorithm/distance/DiscreteFrechetDistance.cpp @@ -100,7 +100,7 @@ DiscreteFrechetDistance::getSegmentAt(const CoordinateSequence& seq, std::size_t } PointPairDistance& -DiscreteFrechetDistance::getFrecheDistance(std::vector< std::vector >& ca, std::size_t i, std::size_t j, +DiscreteFrechetDistance::getFrechetDistance(std::vector< std::vector >& ca, std::size_t i, std::size_t j, const CoordinateSequence& p, const CoordinateSequence& q) { PointPairDistance p_ptDist; @@ -112,17 +112,17 @@ DiscreteFrechetDistance::getFrecheDistance(std::vector< std::vector 0 && j == 0) { - PointPairDistance nextDist = getFrecheDistance(ca, i - 1, 0, p, q); + PointPairDistance nextDist = getFrechetDistance(ca, i - 1, 0, p, q); ca[i][j] = (nextDist.getDistance() > p_ptDist.getDistance()) ? nextDist : p_ptDist; } else if(i == 0 && j > 0) { - PointPairDistance nextDist = getFrecheDistance(ca, 0, j - 1, p, q); + PointPairDistance nextDist = getFrechetDistance(ca, 0, j - 1, p, q); ca[i][j] = (nextDist.getDistance() > p_ptDist.getDistance()) ? nextDist : p_ptDist; } else { - PointPairDistance d1 = getFrecheDistance(ca, i - 1, j, p, q), - d2 = getFrecheDistance(ca, i - 1, j - 1, p, q), - d3 = getFrecheDistance(ca, i, j - 1, p, q); + PointPairDistance d1 = getFrechetDistance(ca, i - 1, j, p, q), + d2 = getFrechetDistance(ca, i - 1, j - 1, p, q), + d3 = getFrechetDistance(ca, i, j - 1, p, q); PointPairDistance& minDist = (d1.getDistance() < d2.getDistance()) ? d1 : d2; if(d3.getDistance() < minDist.getDistance()) { minDist = d3; @@ -156,7 +156,7 @@ DiscreteFrechetDistance::compute( ca[i][j].initialize(); } } - ptDist = getFrecheDistance(ca, pSize - 1, qSize - 1, *lp, *lq); + ptDist = getFrechetDistance(ca, pSize - 1, qSize - 1, *lp, *lq); } } // namespace geos.algorithm.distance