GEOS  3.11.0rc0
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
21 namespace geos {
22 namespace geom {
23 class Geometry;
24 class Coordinate;
25 class Polygon;
26 }
27 }
28 
29 namespace geos {
30 namespace algorithm { // geos::algorithm
31 namespace locate { // geos::algorithm::locate
32 
47 
48 public:
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 
100 private:
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: Angle.h:25