GEOS  3.13.0dev
IndexedPointInPolygonsLocator.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2023 Martin Davis <mtnclimb@gmail.com>
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  * Last port: algorithm/construct/IndexedDistanceToPoint.java
16  * https://github.com/locationtech/jts/commit/d92f783163d9440fcc10c729143787bf7b9fe8f9
17  *
18  **********************************************************************/
19 
20 #pragma once
21 
22 #include <geos/geom/Coordinate.h>
23 #include <geos/geom/Geometry.h>
24 #include <geos/geom/Location.h>
25 #include <geos/index/strtree/TemplateSTRtree.h>
26 #include <geos/algorithm/locate/IndexedPointInAreaLocator.h>
27 
29 using geos::geom::CoordinateXY;
31 using geos::index::strtree::TemplateSTRtree;
33 
34 namespace geos {
35 namespace algorithm { // geos::algorithm
36 namespace construct { // geos::algorithm::construct
37 
46 
47 public:
54 
63  Location locate(const CoordinateXY* /*const*/ p);
64 
65 private:
66  void init();
67 
68  // Declare type as noncopyable
70  IndexedPointInPolygonsLocator& operator=(const IndexedPointInPolygonsLocator& rhs) = delete;
71 
72  //-- members
73  const Geometry& geom;
74  bool isInitialized;
75  TemplateSTRtree<IndexedPointInAreaLocator*> index;
76  std::vector<std::unique_ptr<IndexedPointInAreaLocator>> locators;
77 };
78 
79 }}}
Determines the location of a point in the polygonal elements of a geometry.
Definition: IndexedPointInPolygonsLocator.h:45
Location locate(const CoordinateXY *p)
Determines the Location of a point in the polygonal elements of a Geometry.
IndexedPointInPolygonsLocator(const Geometry &geom)
Creates an instance to locate a point in polygonal elements.
Determines the location of Coordinates relative to an areal geometry, using indexing for efficiency.
Definition: IndexedPointInAreaLocator.h:54
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:186
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