GEOS 3.8.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 {
27class GEOS_DLL IndexedFacetDistance {
28public:
29 IndexedFacetDistance(const geom::Geometry* g) :
30 cachedTree(FacetSequenceTreeBuilder::build(g))
31 {}
32
33 static double distance(const geom::Geometry* g1, const geom::Geometry* g2);
34
35 static std::vector<geom::Coordinate> nearestPoints(const geom::Geometry* g1, const geom::Geometry* g2);
36
37 double distance(const geom::Geometry* g) const;
38
39 std::vector<GeometryLocation> nearestLocations(const geom::Geometry* g) const;
40 std::vector<geom::Coordinate> nearestPoints(const geom::Geometry* g) const;
41
42 ~IndexedFacetDistance();
43
44private:
45 std::unique_ptr<geos::index::strtree::STRtree> cachedTree;
46
47};
48}
49}
50}
51
52#endif //GEOS_INDEXEDFACETDISTANCE_H
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25