GEOS 3.14.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
91 : g(p_g)
92 { }
93
95 : g(&p_g)
96 { }
97
99 locate(const geom::CoordinateXY* p) override
100 {
101 return locate(*p, g);
102 }
103
104private:
105
106 static geom::Location locateInGeometry(const geom::CoordinateXY& p,
107 const geom::Geometry* geom);
108
109 const geom::Geometry* g;
110
111};
112
113} // geos::algorithm::locate
114} // geos::algorithm
115} // geos
116
117
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:99
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:197
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:39