GEOS 3.14.0dev
PreparedGeometry.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2006 Refractions Research Inc.
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: geom/prep/PreparedGeometry.java rev. 1.11 (JTS-1.10)
16 *
17 **********************************************************************/
18
19#pragma once
20
21#include <vector>
22#include <memory>
23#include <string>
24#include <geos/export.h>
25
26// Forward declarations
27namespace geos {
28 namespace geom {
29 class Geometry;
30 class Coordinate;
31 class CoordinateSequence;
32 class IntersectionMatrix;
33 }
34}
35
36
37namespace geos {
38namespace geom { // geos::geom
39namespace prep { // geos::geom::prep
40
58class GEOS_DLL PreparedGeometry {
59public:
60 virtual
62
68 virtual const geom::Geometry& getGeometry() const = 0;
69
78 virtual bool contains(const geom::Geometry* geom) const = 0;
79
119 virtual bool containsProperly(const geom::Geometry* geom) const = 0;
120
129 virtual bool coveredBy(const geom::Geometry* geom) const = 0;
130
139 virtual bool covers(const geom::Geometry* geom) const = 0;
140
149 virtual bool crosses(const geom::Geometry* geom) const = 0;
150
159 virtual bool disjoint(const geom::Geometry* geom) const = 0;
160
169 virtual bool intersects(const geom::Geometry* geom) const = 0;
170
179 virtual bool overlaps(const geom::Geometry* geom) const = 0;
180
189 virtual bool touches(const geom::Geometry* geom) const = 0;
190
199 virtual bool within(const geom::Geometry* geom) const = 0;
200
209 virtual std::unique_ptr<geom::CoordinateSequence> nearestPoints(const geom::Geometry* geom) const = 0;
210
219 virtual double distance(const geom::Geometry* geom) const = 0;
220
231 virtual bool isWithinDistance(const geom::Geometry* geom, double dist) const = 0;
232
240 virtual std::unique_ptr<IntersectionMatrix> relate(const geom::Geometry* geom) const = 0;
241
252 virtual bool relate(const geom::Geometry* geom, const std::string& pat) const = 0;
253
254};
255
256
257} // namespace geos::geom::prep
258} // namespace geos::geom
259} // namespace geos
260
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:197
An interface for classes which prepare Geometrys in order to optimize the performance of repeated cal...
Definition PreparedGeometry.h:58
virtual bool intersects(const geom::Geometry *geom) const =0
Tests whether the base Geometry intersects a given geometry.
virtual bool contains(const geom::Geometry *geom) const =0
Tests whether the base Geometry contains a given geometry.
virtual bool coveredBy(const geom::Geometry *geom) const =0
Tests whether the base Geometry is covered by a given geometry.
virtual bool overlaps(const geom::Geometry *geom) const =0
Tests whether the base Geometry overlaps a given geometry.
virtual bool relate(const geom::Geometry *geom, const std::string &pat) const =0
Compares the prepared geometry to the given geometry and the provided DE9IM pattern,...
virtual bool containsProperly(const geom::Geometry *geom) const =0
Tests whether the base Geometry properly contains a given geometry.
virtual bool isWithinDistance(const geom::Geometry *geom, double dist) const =0
Tests whether the base Geometry is within a given distance from the given geometry.
virtual bool disjoint(const geom::Geometry *geom) const =0
Tests whether the base Geometry is disjoint from a given geometry.
virtual bool crosses(const geom::Geometry *geom) const =0
Tests whether the base Geometry crosses a given geometry.
virtual bool within(const geom::Geometry *geom) const =0
Tests whether the base Geometry is within a given geometry.
virtual bool covers(const geom::Geometry *geom) const =0
Tests whether the base Geometry covers a given geometry.
virtual bool touches(const geom::Geometry *geom) const =0
Tests whether the base Geometry touches a given geometry.
virtual std::unique_ptr< geom::CoordinateSequence > nearestPoints(const geom::Geometry *geom) const =0
Compute the nearest locations on the base Geometry and the given geometry.
virtual double distance(const geom::Geometry *geom) const =0
Compute the minimum distance between the base Geometry and the given geometry.
virtual std::unique_ptr< IntersectionMatrix > relate(const geom::Geometry *geom) const =0
Compares the prepared geometry to the given geometry and returns the DE9IM intersection matrix as a s...
virtual const geom::Geometry & getGeometry() const =0
Gets the original Geometry which has been prepared.
Basic namespace for all GEOS functionalities.
Definition geos.h:39