GEOS 3.14.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
28namespace geos {
29namespace algorithm { // geos::algorithm
30namespace construct { // geos::algorithm::construct
31
41 using CoordinateXY = geos::geom::CoordinateXY;
43 template<typename ItemType>
44 using TemplateSTRtree = geos::index::strtree::TemplateSTRtree<ItemType>;
46
47public:
54
63 Location locate(const CoordinateXY* /*const*/ p);
64
65private:
66 void init();
67
68 // Declare type as noncopyable
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:39
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:197
Location
Constants representing the location of a point relative to a geometry.
Definition Location.h:32
Basic namespace for all GEOS functionalities.
Definition geos.h:39