GEOS 3.14.0dev
InputGeometry.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2020 Paul Ramsey <pramsey@cleverelephant.ca>
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#pragma once
16
17#include <geos/algorithm/locate/IndexedPointInAreaLocator.h>
18#include <geos/algorithm/locate/PointOnGeometryLocator.h>
19#include <geos/geom/Coordinate.h>
20#include <geos/geom/Envelope.h>
21#include <geos/geom/Geometry.h>
22#include <geos/geom/Location.h>
23#include <geos/export.h>
24
25#include <array>
26
27namespace geos { // geos.
28namespace operation { // geos.operation
29namespace overlayng { // geos.operation.overlayng
30
31
41class GEOS_DLL InputGeometry {
47
48private:
49
50 // Members
51 std::array<const Geometry*, 2> geom;
52 std::unique_ptr<PointOnGeometryLocator> ptLocatorA;
53 std::unique_ptr<PointOnGeometryLocator> ptLocatorB;
54 std::array<bool, 2> isCollapsed;
55
56
57
58public:
59
60 InputGeometry(const Geometry* geomA, const Geometry* geomB);
61
62 bool isSingle() const;
63 int getDimension(uint8_t index) const;
64 const Geometry* getGeometry(uint8_t geomIndex) const;
65 const Envelope* getEnvelope(uint8_t geomIndex) const;
66 bool isEmpty(uint8_t geomIndex) const;
67 bool isArea(uint8_t geomIndex) const;
68 int getAreaIndex() const;
69 bool isLine(uint8_t geomIndex) const;
70 bool isAllPoints() const;
71 bool hasPoints() const;
72
80 bool hasEdges(uint8_t geomIndex) const;
81
93 Location locatePointInArea(uint8_t geomIndex, const Coordinate& pt);
94
95 PointOnGeometryLocator* getLocator(uint8_t geomIndex);
96 void setCollapsed(uint8_t geomIndex, bool isGeomCollapsed);
97
98
99};
100
101
102} // namespace geos.operation.overlayng
103} // namespace geos.operation
104} // namespace geos
105
An interface for classes which determine the Location of points in Polygon or MultiPolygon geometries...
Definition PointOnGeometryLocator.h:36
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition Envelope.h:59
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:197
Definition InputGeometry.h:41
bool hasEdges(uint8_t geomIndex) const
Location locatePointInArea(uint8_t geomIndex, const Coordinate &pt)
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