23 #include <geos/export.h>
26 #include <geos/geom/Geometry.h>
27 #include <geos/geom/Envelope.h>
28 #include <geos/geom/LinearRing.h>
29 #include <geos/geom/Dimension.h>
37 class CoordinateSequenceFilter;
77 std::unique_ptr<Polygon>
clone()
const
79 return std::unique_ptr<Polygon>(cloneImpl());
92 bool hasM()
const override;
94 bool hasZ()
const override;
165 std::unique_ptr<Polygon> reverse()
const {
return std::unique_ptr<Polygon>(reverseImpl()); }
177 return shell->getEnvelopeInternal();
185 int compareToSameClass(
const Geometry* p)
const override;
205 Polygon(std::unique_ptr<LinearRing> && newShell,
206 std::vector<std::unique_ptr<LinearRing>> && newHoles,
209 Polygon(std::unique_ptr<LinearRing> && newShell,
216 std::unique_ptr<LinearRing> shell;
218 std::vector<std::unique_ptr<LinearRing>> holes;
223 getSortIndex()
const override
225 return SORTINDEX_POLYGON;
231 void normalize(LinearRing* ring,
bool clockwise);
std::size_t getNumInteriorRing() const
Returns number of interior rings (hole)
const LinearRing * getExteriorRing() const
Returns the exterior ring (shell)
const Envelope * getEnvelopeInternal() const override
Returns the minimum and maximum x and y values in this Geometry, or a null Envelope if this Geometry ...
Definition: Polygon.h:176
void orientRings(bool exteriorCW)
Apply a ring ordering convention to this polygon, with interior rings having an opposite orientation ...
void normalize() override
Models an OGC SFS LinearRing. A LinearRing is a LineString which is both closed and simple.
Definition: LinearRing.h:54
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25
Definition: GeometryComponentFilter.h:41
Polygon * cloneImpl() const override
Make a deep-copy of this Geometry.
Definition: Polygon.h:212
std::string getGeometryType() const override
Return a string representation of this Geometry type.
std::unique_ptr< Polygon > clone() const
Definition: Polygon.h:77
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...
std::unique_ptr< Geometry > convexHull() const override
Returns the smallest convex Polygon that contains all the points in the Geometry.
std::size_t getNumPoints() const override
Returns the count of this Geometrys vertices.
double getLength() const override
Returns the perimeter of this Polygon
DimensionType
Definition: Dimension.h:29
uint8_t getCoordinateDimension() const override
Returns coordinate dimension.
std::unique_ptr< CoordinateSequence > getCoordinates() const override
Returns this Geometry vertices. Caller takes ownership of the returned object.
bool equalsIdentical(const Geometry *other) const override
Returns true if the two geometries are of the same type and their vertices corresponding by index are...
std::unique_ptr< Geometry > getBoundary() const override
Computes the boundary of this geometry.
Dimension::DimensionType getDimension() const override
Returns surface dimension (2)
Represents a linear polygon, which may include holes.
Definition: Polygon.h:60
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:186
Polygon * reverseImpl() const override
Make a geometry with coordinates in reverse order.
void apply_ro(CoordinateSequenceFilter &filter) const override
bool isEmpty() const override
Returns whether or not the set of points in this Geometry is empty.
Polygon(std::unique_ptr< LinearRing > &&newShell, std::vector< std::unique_ptr< LinearRing >> &&newHoles, const GeometryFactory &newFactory)
int getBoundaryDimension() const override
Returns 1 (Polygon boundary is a MultiLineString)
double getArea() const override
Returns the area of this Geometry.
Interface for classes which provide operations that can be applied to the coordinates in a Coordinate...
Definition: CoordinateSequenceFilter.h:55
bool isRectangle() const override
Polygon overrides to check for actual rectangle.
void geometryChangedAction() override
Notifies this Geometry that its Coordinates have been changed by an external party.
Definition: Polygon.h:220
std::vector< const Polygon * > ConstVect
A vector of const Polygon pointers.
Definition: Polygon.h:67
GeometryTypeId getGeometryTypeId() const override
Return an integer representation of this Geometry type.
const CoordinateXY * getCoordinate() const override
Returns a vertex of this Geometry, or NULL if this is the empty geometry.
const LinearRing * getInteriorRingN(std::size_t n) const
Get nth interior ring (hole)
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition: Envelope.h:58
GeometryTypeId
Geometry types.
Definition: Geometry.h:73
Geometry classes support the concept of applying a coordinate filter to every coordinate in the Geome...
Definition: CoordinateFilter.h:43
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:65
std::vector< std::unique_ptr< LinearRing > > releaseInteriorRings()
Take ownership of this Polygon's interior rings. After releasing the rings, the Polygon should be con...
Geometry classes support the concept of applying a Geometry filter to the Geometry.
Definition: GeometryFilter.h:45
std::unique_ptr< LinearRing > releaseExteriorRing()
Take ownership of this Polygon's exterior ring. After releasing the exterior ring,...
void apply_rw(CoordinateSequenceFilter &filter) override