GEOS 3.10.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#ifndef GEOS_GEOS_LINEARRING_H
21#define GEOS_GEOS_LINEARRING_H
22
23#include <geos/export.h>
24#include <string>
25#include <vector>
26#include <geos/geom/LineString.h>
27
28#include <geos/inline.h>
29
30// Forward declarations
31namespace geos {
32namespace geom { // geos::geom
33class Coordinate;
34class CoordinateArraySequence;
35}
36}
37
38namespace geos {
39namespace geom { // geos::geom
40
57class GEOS_DLL LinearRing : public LineString {
58
59public:
60
65 static const unsigned int MINIMUM_VALID_SIZE = 3;
66
67 LinearRing(const LinearRing& lr);
68
82 const GeometryFactory* newFactory);
83
85 LinearRing(CoordinateSequence::Ptr && points,
86 const GeometryFactory& newFactory);
87
88 std::unique_ptr<LinearRing> clone() const
89 {
90 return std::unique_ptr<LinearRing>(cloneImpl());
91 }
92
93 ~LinearRing() override = default;
94
101 int getBoundaryDimension() const override;
102
103 bool isClosed() const override;
104
105 std::string getGeometryType() const override;
106
108
109 void setPoints(const CoordinateSequence* cl);
110
111 std::unique_ptr<LinearRing> reverse() const { return std::unique_ptr<LinearRing>(reverseImpl()); }
112
113protected:
114
115 int
116 getSortIndex() const override
117 {
118 return SORTINDEX_LINEARRING;
119 };
120
121 LinearRing* cloneImpl() const override { return new LinearRing(*this); }
122
123 LinearRing* reverseImpl() const override;
124
125private:
126
127 void validateConstruction();
128};
129
130
131} // namespace geos::geom
132} // namespace geos
133
134#endif // ndef GEOS_GEOS_LINEARRING_H
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:58
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:68
Definition: LineString.h:68
Models an OGC SFS LinearRing. A LinearRing is a LineString which is both closed and simple.
Definition: LinearRing.h:57
LinearRing * cloneImpl() const override
Make a deep-copy of this Geometry.
Definition: LinearRing.h:121
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:75
Basic namespace for all GEOS functionalities.
Definition: geos.h:40