21#ifndef GEOS_GEOM_POLYGON_H
22#define GEOS_GEOM_POLYGON_H
24#include <geos/export.h>
27#include <geos/geom/Geometry.h>
28#include <geos/geom/Envelope.h>
29#include <geos/geom/LinearRing.h>
30#include <geos/geom/Dimension.h>
32#include <geos/inline.h>
40class CoordinateArraySequence;
41class CoordinateSequenceFilter;
81 std::unique_ptr<Geometry>
84 return std::unique_ptr<Geometry>(
new Polygon(*
this));
135 std::unique_ptr<Geometry>
reverse()
const override;
137 int compareToSameClass(
const Geometry* p)
const override;
174 Polygon(std::unique_ptr<LinearRing> && newShell,
177 Polygon(std::unique_ptr<LinearRing> && newShell,
178 std::vector<std::unique_ptr<LinearRing>> && newHoles,
181 std::unique_ptr<LinearRing> shell;
183 std::vector<std::unique_ptr<LinearRing>> holes;
185 Envelope::Ptr computeEnvelopeInternal()
const override;
188 getSortIndex()
const override
190 return SORTINDEX_POLYGON;
196 void normalize(
LinearRing* ring,
bool clockwise);
Geometry classes support the concept of applying a coordinate filter to every coordinate in the Geome...
Definition CoordinateFilter.h:43
Interface for classes which provide operations that can be applied to the coordinates in a Coordinate...
Definition CoordinateSequenceFilter.h:57
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:60
DimensionType
Definition Dimension.h:31
Definition GeometryComponentFilter.h:43
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition GeometryFactory.h:68
Geometry classes support the concept of applying a Geometry filter to the Geometry.
Definition GeometryFilter.h:47
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:188
Models an OGC SFS LinearRing. A LinearRing is a LineString which is both closed and simple.
Definition LinearRing.h:54
Represents a linear polygon, which may include holes.
Definition Polygon.h:64
void normalize() override
const LinearRing * getExteriorRing() const
Returns the exterior ring (shell)
double getLength() const override
Returns the perimeter of this Polygon
size_t getNumPoints() const override
Returns the count of this Geometrys vertices.
std::unique_ptr< Geometry > reverse() const override
Computes a new geometry which has all component coordinate sequences in reverse order (opposite orien...
uint8_t getCoordinateDimension() const override
Returns coordinate dimension.
int getBoundaryDimension() const override
Returns 1 (Polygon boundary is a MultiLineString)
Polygon(LinearRing *newShell, std::vector< LinearRing * > *newHoles, const GeometryFactory *newFactory)
std::string getGeometryType() const override
Return a string representation of this Geometry type.
std::vector< const Polygon * > ConstVect
A vector of const Polygon pointers.
Definition Polygon.h:71
double getArea() const override
Returns the area of this Geometry.
const Coordinate * getCoordinate() const override
Returns a vertex of this Geometry, or NULL if this is the empty geometry.
std::unique_ptr< CoordinateSequence > getCoordinates() const override
Returns this Geometry vertices. Caller takes ownership of the returned object.
std::unique_ptr< Geometry > getBoundary() const override
Computes the boundary of this geometry.
bool isRectangle() const override
Polygon overrides to check for actual rectangle.
std::unique_ptr< Geometry > convexHull() const override
Returns the smallest convex Polygon that contains all the points in the Geometry.
std::unique_ptr< Geometry > clone() const override
Definition Polygon.h:82
void apply_ro(CoordinateSequenceFilter &filter) const override
bool isEmpty() const override
Returns whether or not the set of points in this Geometry is empty.
bool equalsExact(const Geometry *other, double tolerance=0) const override
Returns true iff the two Geometrys are of the same type and their vertices corresponding by index are...
const LinearRing * getInteriorRingN(std::size_t n) const
Get nth interior ring (hole)
Dimension::DimensionType getDimension() const override
Returns surface dimension (2)
size_t getNumInteriorRing() const
Returns number of interior rings (hole)
GeometryTypeId getGeometryTypeId() const override
Return an integer representation of this Geometry type.
void apply_rw(CoordinateSequenceFilter &filter) override
GeometryTypeId
Geometry types.
Definition Geometry.h:75
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:26