GEOS 3.9.1
IndexedFacetDistance.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2016 Daniel Baston
7 *
8 * This is free software; you can redistribute and/or modify it under
9 * the terms of the GNU Lesser General Public Licence as published
10 * by the Free Software Foundation.
11 * See the COPYING file for more information.
12 *
13 **********************************************************************
14 *
15 * Last port: operation/distance/IndexedFacetDistance.java (f6187ee2 JTS-1.14)
16 *
17 **********************************************************************/
18
19#ifndef GEOS_INDEXEDFACETDISTANCE_H
20#define GEOS_INDEXEDFACETDISTANCE_H
21
22#include <geos/operation/distance/FacetSequenceTreeBuilder.h>
23
24namespace geos {
25namespace operation {
26namespace distance {
27
47class GEOS_DLL IndexedFacetDistance {
48public:
49
62 cachedTree(FacetSequenceTreeBuilder::build(g))
63 {}
64
73 static double distance(const geom::Geometry* g1, const geom::Geometry* g2);
74
80 static std::vector<geom::Coordinate> nearestPoints(const geom::Geometry* g1, const geom::Geometry* g2);
81
87 double distance(const geom::Geometry* g) const;
88
93 std::vector<GeometryLocation> nearestLocations(const geom::Geometry* g) const;
94
99 std::vector<geom::Coordinate> nearestPoints(const geom::Geometry* g) const;
100
101private:
102 std::unique_ptr<geos::index::strtree::STRtree> cachedTree;
103
104};
105}
106}
107}
108
109#endif //GEOS_INDEXEDFACETDISTANCE_H
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:188
Computes the distance between the facets (segments and vertices) of two Geometrys using a Branch-and-...
Definition IndexedFacetDistance.h:47
double distance(const geom::Geometry *g) const
Computes the distance from the base geometry to the given geometry.
static std::vector< geom::Coordinate > nearestPoints(const geom::Geometry *g1, const geom::Geometry *g2)
Computes the nearest points of the facets of two geometries.
static double distance(const geom::Geometry *g1, const geom::Geometry *g2)
Computes the distance between facets of two geometries.
std::vector< GeometryLocation > nearestLocations(const geom::Geometry *g) const
Computes the nearest locations on the base geometry and the given geometry.
std::vector< geom::Coordinate > nearestPoints(const geom::Geometry *g) const
Compute the nearest locations on the target geometry and the given geometry.
IndexedFacetDistance(const geom::Geometry *g)
Creates a new distance-finding instance for a given target geom::Geometry.
Definition IndexedFacetDistance.h:61
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:26