IndexedNestedHoleTester.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2021 Paul Ramsey <pramsey@cleverelephant.ca>
* Copyright (C) 2021 Martin Davis
*
* 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.
*
**********************************************************************/
#pragma once
#include <geos/export.h>
#include <geos/index/strtree/TemplateSTRtree.h>
#include <memory>
// Forward declarations
namespace geos {
namespace geom {
class Coordinate;
class Polygon;
class LinearRing;
}
}
namespace geos { // geos.
namespace operation { // geos.operation
namespace valid { // geos.operation.valid
class GEOS_DLL IndexedNestedHoleTester {
using Polygon = geos::geom::Polygon;
using LinearRing = geos::geom::LinearRing;
using CoordinateXY = geos::geom::CoordinateXY;
private:
const Polygon* polygon;
index::strtree::TemplateSTRtree<const LinearRing*> index;
CoordinateXY nestedPt;
void loadIndex();
public:
IndexedNestedHoleTester(const Polygon* p_polygon)
: polygon(p_polygon)
{
loadIndex();
}
const CoordinateXY& getNestedPoint() { return nestedPt; }
bool isNested();
};
} // namespace geos.operation.valid
} // namespace geos.operation
} // namespace geos
geos::geom::Coordinate
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
geos::geom::LinearRing
Models an OGC SFS LinearRing. A LinearRing is a LineString which is both closed and simple.
Definition LinearRing.h:54
geos::geom::Polygon
Represents a linear polygon, which may include holes.
Definition Polygon.h:61
geos::geom
Definition Angle.h:26
geos::operation::valid
Provides classes for testing the validity of geometries.
Definition namespaces.h:289
geos::operation
Provides classes for implementing operations on geometries.
Definition CleanCoverage.h:34
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38