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)
48namespace intervalrtree {
131 return ptDist.getDistance();
137 computeOrientedDistance(g0, g1, ptDist);
138 return ptDist.getDistance();
141 const std::array<geom::Coordinate, 2>
142 getCoordinates()
const
144 return ptDist.getCoordinates();
155 filter_ro(
const geom::Coordinate* pt)
override
157 minPtDist.initialize();
158 DistanceToPoint::computeDistance(geom, *pt,
160 maxPtDist.setMaximum(minPtDist);
163 const PointPairDistance&
164 getMaxPointDistance()
const
170 PointPairDistance maxPtDist;
171 PointPairDistance minPtDist;
172 DistanceToPoint euclideanDist;
173 const geom::Geometry& geom;
176 MaxPointDistanceFilter(
const MaxPointDistanceFilter& other);
177 MaxPointDistanceFilter& operator=(
const MaxPointDistanceFilter& rhs);
180 class MaxDensifiedByFractionDistanceFilter
181 :
public geom::CoordinateSequenceFilter {
184 MaxDensifiedByFractionDistanceFilter(
185 const geom::Geometry& p_geom,
double fraction)
189 numSubSegs(std::size_t(util::
round(1.0 / fraction)))
193 void filter_ro(
const geom::CoordinateSequence& seq,
194 std::size_t index)
override;
197 isGeometryChanged()
const override
203 isDone()
const override
208 const PointPairDistance&
209 getMaxPointDistance()
const
215 PointPairDistance maxPtDist;
216 PointPairDistance minPtDist;
217 const geom::Geometry& geom;
218 std::size_t numSubSegs;
221 MaxDensifiedByFractionDistanceFilter(
const MaxDensifiedByFractionDistanceFilter& other);
222 MaxDensifiedByFractionDistanceFilter& operator=(
const MaxDensifiedByFractionDistanceFilter& rhs);
228 compute(
const geom::Geometry& p_g0,
229 const geom::Geometry& p_g1)
231 computeOrientedDistance(p_g0, p_g1, ptDist);
232 computeOrientedDistance(p_g1, p_g0, ptDist);
235 void computeOrientedDistance(
const geom::Geometry& discreteGeom,
236 const geom::Geometry& geom,
237 PointPairDistance& ptDist);
239 const geom::Geometry& g0;
241 const geom::Geometry& g1;
243 PointPairDistance ptDist;
249 DiscreteHausdorffDistance(
const DiscreteHausdorffDistance& other) =
delete;
250 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:99
void setDensifyFraction(double dFrac)
Geometry classes support the concept of applying a coordinate filter to every coordinate in the Geome...
Definition: CoordinateFilter.h:41
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:186
double round(double val)
Definition: math.h:36
Basic namespace for all GEOS functionalities.
Definition: geos.h:39