GEOS  3.9.1dev
IndexedFacetDistance.h
Go to the documentation of this file.
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 
23 
24 namespace geos {
25 namespace operation {
26 namespace distance {
27 
48 public:
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 
101 private:
102  std::unique_ptr<geos::index::strtree::STRtree> cachedTree;
103 
104 };
105 }
106 }
107 }
108 
109 #endif //GEOS_INDEXEDFACETDISTANCE_H
#define GEOS_DLL
Definition: export.h:28
Computes the distance between the facets (segments and vertices) of two Geometrys using a Branch-and-...
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:188
Basic namespace for all GEOS functionalities.
std::unique_ptr< geos::index::strtree::STRtree > cachedTree
IndexedFacetDistance(const geom::Geometry *g)
Creates a new distance-finding instance for a given target geom::Geometry.