GEOS 3.6.2
IndexedPointInAreaLocator.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2006 Refractions Research Inc.
7 *
8 * This is free software; you can redistribute and/or modify it under
9 * the terms of the GNU Lesser General Public Licence as published
10 * by the Free Software Foundation.
11 * See the COPYING file for more information.
12 *
13 *
14 **********************************************************************/
15
16#ifndef GEOS_ALGORITHM_LOCATE_INDEXEDPOINTINAREALOCATOR_H
17#define GEOS_ALGORITHM_LOCATE_INDEXEDPOINTINAREALOCATOR_H
18
19#include <geos/algorithm/locate/PointOnGeometryLocator.h> // inherited
20#include <geos/index/ItemVisitor.h> // inherited
21
22#include <vector> // composition
23
24namespace geos {
25 namespace algorithm {
27 }
28 namespace geom {
29 class Geometry;
30 class Coordinate;
31 class CoordinateSequence;
32 class LineSegment;
33 }
34 namespace index {
35 namespace intervalrtree {
37 }
38 }
39}
40
41namespace geos {
42namespace algorithm { // geos::algorithm
43namespace locate { // geos::algorithm::locate
44
55class IndexedPointInAreaLocator : public PointOnGeometryLocator
56{
57private:
58 class IntervalIndexedGeometry
59 {
60 private:
62
63 void init( const geom::Geometry & g);
64 void addLine( geom::CoordinateSequence * pts);
65
66 // To keep track of allocated LineSegments
67 std::vector< geom::LineSegment* > allocatedSegments;
68
69 public:
70 IntervalIndexedGeometry( const geom::Geometry & g);
71 ~IntervalIndexedGeometry();
72
73 void query(double min, double max, index::ItemVisitor * visitor);
74 };
75
76
77 class SegmentVisitor : public index::ItemVisitor
78 {
79 private:
81
82 public:
83 SegmentVisitor( algorithm::RayCrossingCounter * counter)
84 : counter( counter)
85 { }
86
87 ~SegmentVisitor()
88 { }
89
90 void visitItem( void * item);
91 };
92
93
94 const geom::Geometry & areaGeom;
95 IntervalIndexedGeometry * index;
96
97 void buildIndex( const geom::Geometry & g);
98
99 // Declare type as noncopyable
100 IndexedPointInAreaLocator(const IndexedPointInAreaLocator& other);
101 IndexedPointInAreaLocator& operator=(const IndexedPointInAreaLocator& rhs);
102
103public:
109
110 ~IndexedPointInAreaLocator();
111
118 int locate( const geom::Coordinate * /*const*/ p);
119
120};
121
122} // geos::algorithm::locate
123} // geos::algorithm
124} // geos
125
126#endif // GEOS_ALGORITHM_LOCATE_INDEXEDPOINTINAREALOCATOR_H
Counts the number of segments crossed by a horizontal ray extending to the right from a given point,...
Definition RayCrossingCounter.h:67
An interface for classes which determine the Location of points in Polygon or MultiPolygon geometries...
Definition PointOnGeometryLocator.h:36
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:59
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 LineSegment.h:57
A visitor for items in an index.
Definition ItemVisitor.h:29
A static index on a set of 1-dimensional intervals, using an R-Tree packed based on the order of the ...
Definition SortedPackedIntervalRTree.h:50
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
Provides classes for various kinds of spatial indexes.
Definition IndexedNestedRingTester.h:31
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:25