GEOS 3.6.2
PointLocator.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2005-2011 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 * Last port: algorithm/PointLocator.java r320 (JTS-1.12)
17 *
18 **********************************************************************/
19
20#ifndef GEOS_ALGORITHM_POINTLOCATOR_H
21#define GEOS_ALGORITHM_POINTLOCATOR_H
22
23#include <geos/export.h>
24#include <geos/geom/Location.h> // for inlines
25
26// Forward declarations
27namespace geos {
28 namespace geom {
29 class Coordinate;
30 class Geometry;
31 class LinearRing;
32 class LineString;
33 class Polygon;
34 class Point;
35 }
36}
37
38namespace geos {
39namespace algorithm { // geos::algorithm
40
58class GEOS_DLL PointLocator {
59public:
60 PointLocator() {}
61 ~PointLocator() {}
62
74
85 }
86
87private:
88
89 bool isIn; // true if the point lies in or on any Geometry element
90
91 int numBoundaries; // the number of sub-elements whose boundaries the point lies in
92
93 void computeLocation(const geom::Coordinate& p, const geom::Geometry *geom);
94
95 void updateLocationInfo(int loc);
96
97 int locate(const geom::Coordinate& p, const geom::Point *pt);
98
99 int locate(const geom::Coordinate& p, const geom::LineString *l);
100
101 int locateInPolygonRing(const geom::Coordinate& p, const geom::LinearRing *ring);
102
103 int locate(const geom::Coordinate& p, const geom::Polygon *poly);
104
105};
106
107} // namespace geos::algorithm
108} // namespace geos
109
110
111#endif // GEOS_ALGORITHM_POINTLOCATOR_H
112
int locate(const geom::Coordinate &p, const geom::Geometry *geom)
bool intersects(const geom::Coordinate &p, const geom::Geometry *geom)
Definition PointLocator.h:83
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:60
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:167
Definition LineString.h:70
Models an OGC SFS LinearRing.
Definition LinearRing.h:57
@ EXTERIOR
Definition Location.h:63
Definition Point.h:68
Represents a linear polygon, which may include holes.
Definition Polygon.h:67
Classes which determine the Location of points in geometries.
Definition IndexedPointInAreaLocator.h:43
Contains classes and interfaces implementing fundamental computational geometry algorithms.
Definition Angle.h:33
Contains the Geometry interface hierarchy and supporting classes.
Definition IndexedNestedRingTester.h:26
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:25