IndexedPointInPolygonsLocator.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2023 Martin Davis <mtnclimb@gmail.com>
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************
*
* Last port: algorithm/construct/IndexedDistanceToPoint.java
* https://github.com/locationtech/jts/commit/d92f783163d9440fcc10c729143787bf7b9fe8f9
*
**********************************************************************/
#pragma once
#include <geos/geom/Coordinate.h>
#include <geos/geom/Geometry.h>
#include <geos/geom/Location.h>
#include <geos/index/strtree/TemplateSTRtree.h>
#include <geos/algorithm/locate/IndexedPointInAreaLocator.h>
namespace geos {
namespace algorithm { // geos::algorithm
namespace construct { // geos::algorithm::construct
class GEOS_DLL IndexedPointInPolygonsLocator {
using Geometry = geos::geom::Geometry;
using CoordinateXY = geos::geom::CoordinateXY;
using Location = geos::geom::Location;
template<typename ItemType>
using TemplateSTRtree = geos::index::strtree::TemplateSTRtree<ItemType>;
using IndexedPointInAreaLocator = geos::algorithm::locate::IndexedPointInAreaLocator;
public:
IndexedPointInPolygonsLocator(const Geometry& geom);
Location locate(const CoordinateXY* /*const*/ p);
private:
void init();
// Declare type as noncopyable
IndexedPointInPolygonsLocator(const IndexedPointInPolygonsLocator& other) = delete;
IndexedPointInPolygonsLocator& operator=(const IndexedPointInPolygonsLocator& rhs) = delete;
//-- members
const Geometry& geom;
bool isInitialized;
TemplateSTRtree<IndexedPointInAreaLocator*> index;
std::vector<std::unique_ptr<IndexedPointInAreaLocator>> locators;
};
}}}
geos::algorithm::construct::IndexedPointInPolygonsLocator::locate
Location locate(const CoordinateXY *p)
Determines the Location of a point in the polygonal elements of a Geometry.
geos::algorithm::construct::IndexedPointInPolygonsLocator::IndexedPointInPolygonsLocator
IndexedPointInPolygonsLocator(const Geometry &geom)
Creates an instance to locate a point in polygonal elements.
geos::algorithm::locate::IndexedPointInAreaLocator
Determines the location of Coordinates relative to an areal geometry, using indexing for efficiency.
Definition IndexedPointInAreaLocator.h:54
geos::geom::Geometry
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:196
geos::algorithm
Contains classes and interfaces implementing fundamental computational geometry algorithms.
Definition Angle.h:32
geos::geom::Location
Location
Constants representing the location of a point relative to a geometry.
Definition Location.h:32
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38