GEOS 3.16.0dev
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 Surface;
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::CoordinateXY& p,
51 const geom::Geometry* geom);
52
72 static geom::Location locatePointInSurface(const geom::CoordinateXY& p,
73 const geom::Surface& poly);
74
87 static bool isContained(const geom::CoordinateXY& p,
88 const geom::Geometry* geom);
89
90 static bool isAnyPointContained(const geom::Geometry& pt, const geom::Geometry& areaGeom);
91
92 static bool isEveryPointContained(const geom::Geometry& pt, const geom::Geometry& areaGeom);
93
95 : g(p_g)
96 { }
97
99 : g(&p_g)
100 { }
101
103 locate(const geom::CoordinateXY* p) override
104 {
105 return locate(*p, g);
106 }
107
108private:
109
110 static geom::Location locateInGeometry(const geom::CoordinateXY& p,
111 const geom::Geometry* geom);
112
113 const geom::Geometry* g;
114
115};
116
117} // geos::algorithm::locate
118} // geos::algorithm
119} // geos
120
121
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::CoordinateXY *p) override
Definition SimplePointInAreaLocator.h:103
static bool isContained(const geom::CoordinateXY &p, const geom::Geometry *geom)
Determines whether a point is contained in a Geometry, or lies on its boundary.
static geom::Location locatePointInSurface(const geom::CoordinateXY &p, const geom::Surface &poly)
Determines the Location of a point in a Surface.
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:201
Definition Surface.h:27
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:38