GEOS  3.8.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 #ifndef GEOS_ALGORITHM_LOCATE_SIMPLEPOINTINAREALOCATOR_H
17 #define GEOS_ALGORITHM_LOCATE_SIMPLEPOINTINAREALOCATOR_H
18 
19 #include <geos/algorithm/locate/PointOnGeometryLocator.h> // inherited
20 
21 // Forward declarations
22 namespace geos {
23 namespace geom {
24 class Geometry;
25 class Coordinate;
26 class Polygon;
27 }
28 }
29 
30 namespace geos {
31 namespace algorithm { // geos::algorithm
32 namespace locate { // geos::algorithm::locate
33 
48 
49 public:
50 
51  static int locate(const geom::Coordinate& p,
52  const geom::Geometry* geom);
53 
63  static int locatePointInPolygon(const geom::Coordinate& p,
64  const geom::Polygon* poly);
65 
67  : g(p_g)
68  { }
69 
70  int
71  locate(const geom::Coordinate* p) override
72  {
73  return locate(*p, g);
74  }
75 
76 private:
77 
78  static int locateInGeometry(const geom::Coordinate& p,
79  const geom::Geometry* geom);
80 
81  const geom::Geometry* g;
82 
83 };
84 
85 } // geos::algorithm::locate
86 } // geos::algorithm
87 } // geos
88 
89 
90 #endif // GEOS_ALGORITHM_LOCATE_SIMPLEPOINTINAREALOCATOR_H
int locate(const geom::Coordinate *p) override
Definition: SimplePointInAreaLocator.h:71
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
Computes the location of points relative to an areal Geometry, using a simple O(n) algorithm...
Definition: SimplePointInAreaLocator.h:47
An interface for classes which determine the Location of points in Polygon or MultiPolygon geometries...
Definition: PointOnGeometryLocator.h:35
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:187
Represents a linear polygon, which may include holes.
Definition: Polygon.h:65
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
static int locatePointInPolygon(const geom::Coordinate &p, const geom::Polygon *poly)