GEOS 3.11.1
SimplePointInAreaLocator.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2005-2006 Refractions Research Inc.
7 * Copyright (C) 2001-2002 Vivid Solutions Inc.
8 *
9 * This is free software; you can redistribute and/or modify it under
10 * the terms of the GNU Lesser General Public Licence as published
11 * by the Free Software Foundation.
12 * See the COPYING file for more information.
13 *
14 **********************************************************************/
15
16#pragma once
17
18#include <geos/algorithm/locate/PointOnGeometryLocator.h> // inherited
19
20// Forward declarations
21namespace geos {
22namespace geom {
23class Geometry;
24class Coordinate;
25class Polygon;
26}
27}
28
29namespace geos {
30namespace algorithm { // geos::algorithm
31namespace locate { // geos::algorithm::locate
32
47
48public:
49
50 static geom::Location locate(const geom::Coordinate& p,
51 const geom::Geometry* geom);
52
73 const geom::Polygon* poly);
74
87 static bool isContained(const geom::Coordinate& p,
88 const geom::Geometry* geom);
89
91 : g(p_g)
92 { }
93
95 locate(const geom::Coordinate* p) override
96 {
97 return locate(*p, g);
98 }
99
100private:
101
102 static geom::Location locateInGeometry(const geom::Coordinate& p,
103 const geom::Geometry* geom);
104
105 const geom::Geometry* g;
106
107};
108
109} // geos::algorithm::locate
110} // geos::algorithm
111} // geos
112
113
An interface for classes which determine the Location of points in Polygon or MultiPolygon geometries...
Definition: PointOnGeometryLocator.h:36
Computes the location of points relative to a polygonal Geometry, using a simple O(n) algorithm.
Definition: SimplePointInAreaLocator.h:46
geom::Location locate(const geom::Coordinate *p) override
Definition: SimplePointInAreaLocator.h:95
static geom::Location locatePointInPolygon(const geom::Coordinate &p, const geom::Polygon *poly)
Determines the Location of a point in a Polygon.
static bool isContained(const geom::Coordinate &p, const geom::Geometry *geom)
Determines whether a point is contained in a Geometry, or lies on its boundary.
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:58
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:186
Represents a linear polygon, which may include holes.
Definition: Polygon.h:61
Location
Constants representing the location of a point relative to a geometry.
Definition: Location.h:32
Basic namespace for all GEOS functionalities.
Definition: geos.h:39