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