GEOS  3.13.0dev
FuzzyPointLocator.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2006 Refractions Research Inc.
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/overlay/validate/FuzzyPointLocator.java rev. 1.1 (JTS-1.10)
16  *
17  **********************************************************************/
18 
19 #pragma once
20 
21 #include <geos/export.h>
22 #include <geos/algorithm/PointLocator.h> // for composition
23 #include <geos/geom/Geometry.h> // for unique_ptr visibility of dtor
24 #include <geos/geom/Location.h> // for Location::Value enum
25 
26 #include <vector>
27 #include <memory> // for unique_ptr
28 
29 #ifdef _MSC_VER
30 #pragma warning(push)
31 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
32 #endif
33 
34 // Forward declarations
35 namespace geos {
36 namespace geom {
37 class Geometry;
38 class Coordinate;
39 }
40 }
41 
42 namespace geos {
43 namespace operation { // geos::operation
44 namespace overlay { // geos::operation::overlay
45 namespace validate { // geos::operation::overlay::validate
46 
57 class GEOS_DLL FuzzyPointLocator {
58 
59 public:
60 
61  FuzzyPointLocator(const geom::Geometry& geom, double nTolerance);
62 
63  geom::Location getLocation(const geom::Coordinate& pt);
64 
65 private:
66 
67  const geom::Geometry& g;
68 
69  double tolerance;
70 
71  algorithm::PointLocator ptLocator;
72 
73  std::unique_ptr<geom::Geometry> linework;
74 
75  // this function has been obsoleted
76  std::unique_ptr<geom::Geometry> getLineWork(const geom::Geometry& geom);
77 
82  std::unique_ptr<geom::Geometry> extractLineWork(const geom::Geometry& geom);
83 
84  // Declare type as noncopyable
85  FuzzyPointLocator(const FuzzyPointLocator& other) = delete;
86  FuzzyPointLocator& operator=(const FuzzyPointLocator& rhs) = delete;
87 };
88 
89 } // namespace geos::operation::overlay::validate
90 } // namespace geos::operation::overlay
91 } // namespace geos::operation
92 } // namespace geos
93 
94 #ifdef _MSC_VER
95 #pragma warning(pop)
96 #endif
97 
Computes the topological relationship (Location) of a single point to a Geometry.
Definition: PointLocator.h:56
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:216
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:186
Finds the most likely Location of a point relative to the polygonal components of a geometry,...
Definition: FuzzyPointLocator.h:57
Location
Constants representing the location of a point relative to a geometry.
Definition: Location.h:32
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25