GEOS 3.11.1
LinearRing.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2001-2002 Vivid Solutions Inc.
7 * Copyright (C) 2005 2006 Refractions Research Inc.
8 *
9 * This is free software; you can redistribute and/or modify it under
10 * the terms of the GNU Lesser General Public Licence as published
11 * by the Free Software Foundation.
12 * See the COPYING file for more information.
13 *
14 **********************************************************************
15 *
16 * Last port: geom/LinearRing.java r320 (JTS-1.12)
17 *
18 **********************************************************************/
19
20#pragma once
21
22#include <geos/export.h>
23#include <string>
24#include <vector>
25#include <geos/geom/LineString.h>
26
27
28// Forward declarations
29namespace geos {
30namespace geom { // geos::geom
31class Coordinate;
32class CoordinateArraySequence;
33}
34}
35
36namespace geos {
37namespace geom { // geos::geom
38
55class GEOS_DLL LinearRing : public LineString {
56
57public:
58
63 static const unsigned int MINIMUM_VALID_SIZE = 3;
64
65 LinearRing(const LinearRing& lr);
66
80 const GeometryFactory* newFactory);
81
83 LinearRing(CoordinateSequence::Ptr && points,
84 const GeometryFactory& newFactory);
85
86 LinearRing(std::vector<Coordinate> && pts,
87 const GeometryFactory& newFactory);
88
89 std::unique_ptr<LinearRing> clone() const
90 {
91 return std::unique_ptr<LinearRing>(cloneImpl());
92 }
93
94 ~LinearRing() override = default;
95
102 int getBoundaryDimension() const override;
103
104 bool isClosed() const override;
105
106 std::string getGeometryType() const override;
107
109
110 void setPoints(const CoordinateSequence* cl);
111
112 std::unique_ptr<LinearRing> reverse() const { return std::unique_ptr<LinearRing>(reverseImpl()); }
113
114protected:
115
116 int
117 getSortIndex() const override
118 {
119 return SORTINDEX_LINEARRING;
120 };
121
122 LinearRing* cloneImpl() const override { return new LinearRing(*this); }
123
124 LinearRing* reverseImpl() const override;
125
126private:
127
128 void validateConstruction();
129};
130
131
132} // namespace geos::geom
133} // namespace geos
134
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:44
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:66
Definition: LineString.h:66
Models an OGC SFS LinearRing. A LinearRing is a LineString which is both closed and simple.
Definition: LinearRing.h:55
LinearRing * cloneImpl() const override
Make a deep-copy of this Geometry.
Definition: LinearRing.h:122
int getBoundaryDimension() const override
Returns Dimension.FALSE, since by definition LinearRings do not have a boundary.
LinearRing(CoordinateSequence::Ptr &&points, const GeometryFactory &newFactory)
Hopefully cleaner version of the above.
std::string getGeometryType() const override
Return a string representation of this Geometry type.
GeometryTypeId getGeometryTypeId() const override
Return an integer representation of this Geometry type.
LinearRing * reverseImpl() const override
Make a geometry with coordinates in reverse order.
LinearRing(CoordinateSequence *points, const GeometryFactory *newFactory)
Constructs a LinearRing with the given points.
GeometryTypeId
Geometry types.
Definition: Geometry.h:73
Basic namespace for all GEOS functionalities.
Definition: geos.h:39