21 #include <geos/export.h>
22 #include <geos/algorithm/distance/PointPairDistance.h>
23 #include <geos/algorithm/distance/DistanceToPoint.h>
24 #include <geos/util/IllegalArgumentException.h>
25 #include <geos/geom/Geometry.h>
26 #include <geos/util/math.h>
27 #include <geos/geom/CoordinateFilter.h>
28 #include <geos/geom/CoordinateSequenceFilter.h>
35 #pragma warning(disable: 4251)
123 return ptDist.getDistance();
129 computeOrientedDistance(g0, g1, ptDist);
130 return ptDist.getDistance();
133 const std::array<geom::CoordinateXY, 2>
134 getCoordinates()
const
136 return ptDist.getCoordinates();
147 filter_ro(
const geom::CoordinateXY* pt)
override
149 minPtDist.initialize();
150 DistanceToPoint::computeDistance(geom, *pt,
152 maxPtDist.setMaximum(minPtDist);
155 const PointPairDistance&
156 getMaxPointDistance()
const
162 PointPairDistance maxPtDist;
163 PointPairDistance minPtDist;
164 DistanceToPoint euclideanDist;
165 const geom::Geometry& geom;
168 MaxPointDistanceFilter(
const MaxPointDistanceFilter& other);
169 MaxPointDistanceFilter& operator=(
const MaxPointDistanceFilter& rhs);
172 class MaxDensifiedByFractionDistanceFilter
173 :
public geom::CoordinateSequenceFilter {
176 MaxDensifiedByFractionDistanceFilter(
177 const geom::Geometry& p_geom,
double fraction)
181 numSubSegs(std::size_t(util::
round(1.0 / fraction)))
185 void filter_ro(
const geom::CoordinateSequence& seq,
186 std::size_t index)
override;
189 isGeometryChanged()
const override
195 isDone()
const override
200 const PointPairDistance&
201 getMaxPointDistance()
const
207 PointPairDistance maxPtDist;
208 PointPairDistance minPtDist;
209 const geom::Geometry& geom;
210 std::size_t numSubSegs;
213 MaxDensifiedByFractionDistanceFilter(
const MaxDensifiedByFractionDistanceFilter& other);
214 MaxDensifiedByFractionDistanceFilter& operator=(
const MaxDensifiedByFractionDistanceFilter& rhs);
220 compute(
const geom::Geometry& p_g0,
221 const geom::Geometry& p_g1)
223 computeOrientedDistance(p_g0, p_g1, ptDist);
224 computeOrientedDistance(p_g1, p_g0, ptDist);
227 void computeOrientedDistance(
const geom::Geometry& discreteGeom,
228 const geom::Geometry& geom,
229 PointPairDistance& ptDist);
231 const geom::Geometry& g0;
233 const geom::Geometry& g1;
235 PointPairDistance ptDist;
241 DiscreteHausdorffDistance(
const DiscreteHausdorffDistance& other) =
delete;
242 DiscreteHausdorffDistance& operator=(
const DiscreteHausdorffDistance& rhs) =
delete;
An algorithm for computing a distance metric which is an approximation to the Hausdorff Distance base...
Definition: DiscreteHausdorffDistance.h:91
void setDensifyFraction(double dFrac)
Geometry classes support the concept of applying a coordinate filter to every coordinate in the Geome...
Definition: CoordinateFilter.h:43
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:197
double round(double val)
Definition: math.h:36
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25