SimplePointInAreaLocator.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2005-2006 Refractions Research Inc.
* Copyright (C) 2001-2002 Vivid Solutions Inc.
*
* 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/algorithm/locate/PointOnGeometryLocator.h> // inherited
// Forward declarations
namespace geos {
namespace geom {
class Geometry;
class Coordinate;
class Surface;
}
}
namespace geos {
namespace algorithm { // geos::algorithm
namespace locate { // geos::algorithm::locate
class GEOS_DLL SimplePointInAreaLocator : public PointOnGeometryLocator {
public:
static geom::Location locate(const geom::CoordinateXY& p,
const geom::Geometry* geom);
static geom::Location locatePointInSurface(const geom::CoordinateXY& p,
const geom::Surface& poly);
static bool isContained(const geom::CoordinateXY& p,
const geom::Geometry* geom);
SimplePointInAreaLocator(const geom::Geometry* p_g)
: g(p_g)
{ }
SimplePointInAreaLocator(const geom::Geometry& p_g)
: g(&p_g)
{ }
geom::Location
locate(const geom::CoordinateXY* p) override
{
return locate(*p, g);
}
private:
static geom::Location locateInGeometry(const geom::CoordinateXY& p,
const geom::Geometry* geom);
const geom::Geometry* g;
};
} // geos::algorithm::locate
} // geos::algorithm
} // geos
geos::algorithm::locate::PointOnGeometryLocator
An interface for classes which determine the Location of points in Polygon or MultiPolygon geometries...
Definition PointOnGeometryLocator.h:36
geos::algorithm::locate::SimplePointInAreaLocator
Computes the location of points relative to a polygonal Geometry, using a simple O(n) algorithm.
Definition SimplePointInAreaLocator.h:46
geos::algorithm::locate::SimplePointInAreaLocator::locate
geom::Location locate(const geom::CoordinateXY *p) override
Definition SimplePointInAreaLocator.h:99
geos::algorithm::locate::SimplePointInAreaLocator::isContained
static bool isContained(const geom::CoordinateXY &p, const geom::Geometry *geom)
Determines whether a point is contained in a Geometry, or lies on its boundary.
geos::algorithm::locate::SimplePointInAreaLocator::locatePointInSurface
static geom::Location locatePointInSurface(const geom::CoordinateXY &p, const geom::Surface &poly)
Determines the Location of a point in a Surface.
geos::geom::Coordinate
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
geos::geom::Geometry
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:196
geos::geom::Surface
Definition Surface.h:27
geos::algorithm::locate
Classes which determine the Location of points in geometries.
Definition IndexedPointInAreaLocator.h:40
geos::algorithm
Contains classes and interfaces implementing fundamental computational geometry algorithms.
Definition Angle.h:32
geos::geom
Definition Angle.h:26
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