MySQL 8.0.39
Source Code Documentation
geometries_cs.h
Go to the documentation of this file.
1#ifndef SQL_GIS_GEOMETRIES_CS_H_INCLUDED
2#define SQL_GIS_GEOMETRIES_CS_H_INCLUDED
3
4// Copyright (c) 2017, 2024, Oracle and/or its affiliates.
5//
6// This program is free software; you can redistribute it and/or modify
7// it under the terms of the GNU General Public License, version 2.0,
8// as published by the Free Software Foundation.
9//
10// This program is designed to work with certain software (including
11// but not limited to OpenSSL) that is licensed under separate terms,
12// as designated in a particular file or component or in included license
13// documentation. The authors of MySQL hereby grant you an additional
14// permission to link the program and your derivative works with the
15// separately licensed software that they have either included with
16// the program or referenced in the documentation.
17//
18// This program is distributed in the hope that it will be useful,
19// but WITHOUT ANY WARRANTY; without even the implied warranty of
20// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21// GNU General Public License, version 2.0, for more details.
22//
23// You should have received a copy of the GNU General Public License
24// along with this program; if not, write to the Free Software
25// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
26
27/// @file
28///
29/// This file declares the coordinate system specific subclasses of
30/// the geometry class hierarchy. The rest of the hierarchy is defined
31/// in geometries.h.
32///
33/// For most of the server, including geometries.h should be
34/// enough. This header is only needed if the code needs to access
35/// coordinate system specific members.
36///
37/// @see geometries.h
38
39#include <vector>
40
41#include "sql/gis/geometries.h"
43
44namespace gis {
45
46/// A Cartesian 2d point.
47class Cartesian_point : public Point {
48 public:
49 Cartesian_point() = default;
50 Cartesian_point(double x, double y) : Point(x, y) {}
53 }
54 Cartesian_point *clone() const override { return new Cartesian_point(*this); }
55};
56
57/// A geographic (ellipsoidal) 2d point.
58class Geographic_point : public Point {
59 public:
60 Geographic_point() = default;
61 Geographic_point(double x, double y) : Point(x, y) {}
64 }
65 Geographic_point *clone() const override {
66 return new Geographic_point(*this);
67 }
68};
69
70/// A Cartesian 2d linestring.
72 protected:
73 /// String of points constituting the linestring.
74 ///
75 /// The line starts in the first point, goes through all intermediate points,
76 /// and ends in the last point.
77 std::vector<Cartesian_point, Malloc_allocator<Cartesian_point>> m_points;
78
79 public:
80 typedef decltype(m_points)::value_type value_type;
81 typedef decltype(m_points)::iterator iterator;
83
87
90 }
91 bool accept(Geometry_visitor *v) override;
92 void push_back(const Point &pt) override;
93 void push_back(Point &&pt) override;
94 void pop_front() override { m_points.erase(m_points.begin()); }
95 bool empty() const override;
96 std::size_t size() const override { return m_points.size(); }
97 void resize(std::size_t count) { m_points.resize(count); }
98 void clear() noexcept override { m_points.clear(); }
99
100 Cartesian_linestring *clone() const override {
101 return new Cartesian_linestring(*this);
102 }
103
104 Cartesian_point &back() override { return m_points.back(); }
105 const Cartesian_point &back() const override { return m_points.back(); }
106
107 iterator begin() noexcept { return m_points.begin(); }
108 const_iterator begin() const noexcept { return m_points.begin(); }
109
110 iterator end() noexcept { return m_points.end(); }
111 const_iterator end() const noexcept { return m_points.end(); }
112
113 Cartesian_point &front() override { return m_points.front(); }
114 const Cartesian_point &front() const override { return m_points.front(); }
115
116 Cartesian_point &operator[](std::size_t i) override { return m_points[i]; }
117 const Cartesian_point &operator[](std::size_t i) const override {
118 return m_points[i];
119 }
120};
121
122/// A geographic (ellipsoidal) 2d linestring.
123///
124/// The linestring follows the geodetic between each pair of points.
126 protected:
127 /// String of points constituting the linestring.
128 ///
129 /// The line starts in the first point, goes through all intermediate points,
130 /// and ends in the last point.
131 std::vector<Geographic_point, Malloc_allocator<Geographic_point>> m_points;
132
133 public:
134 typedef decltype(m_points)::value_type value_type;
135 typedef decltype(m_points)::iterator iterator;
137
141
144 }
145 bool accept(Geometry_visitor *v) override;
146 void push_back(const Point &pt) override;
147 void push_back(Point &&pt) override;
148 void pop_front() override { m_points.erase(m_points.begin()); }
149 bool empty() const override;
150 std::size_t size() const override { return m_points.size(); }
151 void resize(std::size_t count) { m_points.resize(count); }
152 void clear() noexcept override { m_points.clear(); }
153
154 Geographic_linestring *clone() const override {
155 return new Geographic_linestring(*this);
156 }
157
158 Geographic_point &back() override { return m_points.back(); }
159 const Geographic_point &back() const override { return m_points.back(); }
160
161 iterator begin() noexcept { return m_points.begin(); }
162 const_iterator begin() const noexcept { return m_points.begin(); }
163
164 iterator end() noexcept { return m_points.end(); }
165 const_iterator end() const noexcept { return m_points.end(); }
166
167 Geographic_point &front() override { return m_points.front(); }
168 const Geographic_point &front() const override { return m_points.front(); }
169
170 Geographic_point &operator[](std::size_t i) override { return m_points[i]; }
171 const Geographic_point &operator[](std::size_t i) const override {
172 return m_points[i];
173 }
174};
175
176/// A Cartesian 2d linear ring.
178 public:
179 Geometry_type type() const override { return Linearring::type(); }
182 }
183 bool accept(Geometry_visitor *v) override;
184 bool is_empty() const override { return Cartesian_linestring::is_empty(); }
185 void push_back(const gis::Point &pt) override {
187 }
188 void push_back(gis::Point &&pt) override {
189 Cartesian_linestring::push_back(std::forward<Point &&>(pt));
190 }
192 bool empty() const override { return Cartesian_linestring::empty(); }
193 std::size_t size() const override { return Cartesian_linestring::size(); }
194 void clear() noexcept override { Cartesian_linestring::clear(); }
195
196 /// This implementation of clone() uses a broader return type than
197 /// other implementations. This is due to the restraint in some compilers,
198 /// such as cl.exe, that overriding functions with ambiguous bases must have
199 /// covariant return types.
200 Cartesian_linestring *clone() const override {
201 return new Cartesian_linearring(*this);
202 }
203
205 const Cartesian_point &back() const override {
207 }
208
210 const Cartesian_point &front() const override {
212 }
213
214 Cartesian_point &operator[](std::size_t i) override {
216 }
217 const Cartesian_point &operator[](std::size_t i) const override {
219 }
220};
221
222/// A geographic (ellipsoidal) 2d linear ring.
224 public:
225 Geometry_type type() const override { return Linearring::type(); }
228 }
229 bool accept(Geometry_visitor *v) override;
230 bool is_empty() const override { return Geographic_linestring::is_empty(); }
231 void push_back(const gis::Point &pt) override {
233 }
234 void push_back(gis::Point &&pt) override {
235 Geographic_linestring::push_back(std::forward<Point &&>(pt));
236 }
238 bool empty() const override { return Geographic_linestring::empty(); }
239 std::size_t size() const override { return Geographic_linestring::size(); }
240 void clear() noexcept override { Geographic_linestring::clear(); }
241
242 /// This implementation of clone() uses a broader return type than
243 /// other implementations. This is due to the restraint in some compilers,
244 /// such as cl.exe, that overriding functions with ambiguous bases must have
245 /// covariant return types.
246 Geographic_linestring *clone() const override {
247 return new Geographic_linearring(*this);
248 }
249
251 const Geographic_point &back() const override {
253 }
254
256 const Geographic_point &front() const override {
258 }
259
260 Geographic_point &operator[](std::size_t i) override {
262 }
263 const Geographic_point &operator[](std::size_t i) const override {
265 }
266};
267
268/// A Cartesian 2d polygon.
270 private:
271 /// Exterior ring.
273
274 /// Interior rings (holes).
275 std::vector<Cartesian_linearring, Malloc_allocator<Cartesian_linearring>>
277
278 public:
284 }
285 bool accept(Geometry_visitor *v) override;
286 void push_back(const Linearring &lr) override;
287 void push_back(Linearring &&lr) override;
288 bool empty() const override;
289
290 Cartesian_polygon *clone() const override {
291 return new Cartesian_polygon(*this);
292 }
293
294 /// Get list of interior rings.
295 ///
296 /// This function is used by the interface to Boost.Geometry.
297 ///
298 /// @return The list of interior rings
300
301 /// Get list of interior rings.
302 ///
303 /// This function is used by the interface to Boost.Geometry.
304 ///
305 /// @return The list of interior rings
306 decltype(m_interior_rings) const &const_interior_rings() const;
307
308 std::size_t size() const override;
309
310 /// Get the exterior ring.
311 ///
312 /// This function is used by the interface to Boost.Geometry.
313 ///
314 /// @return The exterior ring.
317
318 Linearring &interior_ring(std::size_t n) override;
319};
320
321/// A geographic (ellipsoidal) 2d polygon.
323 private:
324 /// Exterior ring.
326
327 /// Interior rings (holes).
328 std::vector<Geographic_linearring, Malloc_allocator<Geographic_linearring>>
330
331 public:
337 }
338 bool accept(Geometry_visitor *v) override;
339 void push_back(const Linearring &lr) override;
340 void push_back(Linearring &&lr) override;
341 bool empty() const override;
342
343 Geographic_polygon *clone() const override {
344 return new Geographic_polygon(*this);
345 }
346
347 /// Get list of interior rings.
348 ///
349 /// This function is used by the interface to Boost.Geometry.
350 ///
351 /// @return The list of interior rings
353
354 /// Get list of interior rings.
355 ///
356 /// This function is used by the interface to Boost.Geometry.
357 ///
358 /// @return The list of interior rings
359 decltype(m_interior_rings) const &const_interior_rings() const;
360
361 std::size_t size() const override;
362
363 /// Get the exterior ring.
364 ///
365 /// This function is used by the interface to Boost.Geometry.
366 ///
367 /// @return The exterior ring.
370
371 Linearring &interior_ring(std::size_t n) override;
372};
373
374/// A Cartesian 2d geometry collection.
376 private:
377 /// List of geometries in the collection.
378 std::vector<Geometry *, Malloc_allocator<Geometry *>> m_geometries;
379
380 public:
381 typedef decltype(m_geometries)::iterator iterator;
383
385 : m_geometries(
389 : m_geometries(
391 m_geometries = std::move(gc.m_geometries);
392 }
394 for (Geometry *g : m_geometries) {
395 delete g;
396 }
397 }
400 }
401 bool accept(Geometry_visitor *v) override;
402 bool is_empty() const override {
403 for (const auto g : m_geometries) {
404 if (!g->is_empty()) return false;
405 }
406 return true;
407 }
408 void pop_front() override {
409 delete *m_geometries.begin();
410 m_geometries.erase(m_geometries.begin());
411 }
412 void push_back(const Geometry &g) override;
413 void push_back(Geometry &&g) override;
414 bool empty() const override;
415 std::size_t size() const override { return m_geometries.size(); }
416 void resize(std::size_t count) override { m_geometries.resize(count); }
417 void clear() noexcept override { m_geometries.clear(); }
418
419 iterator begin() noexcept { return m_geometries.begin(); }
420 const_iterator begin() const noexcept { return m_geometries.begin(); }
421
422 iterator end() noexcept { return m_geometries.end(); }
423 const_iterator end() const noexcept { return m_geometries.end(); }
424
425 Geometry &front() override { return *m_geometries.front(); }
426 const Geometry &front() const override { return *m_geometries.front(); }
427
428 Geometry &operator[](std::size_t i) override { return *m_geometries[i]; }
429 const Geometry &operator[](std::size_t i) const override {
430 return *m_geometries[i];
431 }
433 return new Cartesian_geometrycollection(*this);
434 }
435};
436
437/// A geographic (ellipsoidal) 2d geometry collection.
439 private:
440 /// List of geometries in the collection.
441 std::vector<Geometry *, Malloc_allocator<Geometry *>> m_geometries;
442
443 public:
444 typedef decltype(m_geometries)::iterator iterator;
446
448 : m_geometries(
452 : m_geometries(
454 m_geometries = std::move(gc.m_geometries);
455 }
457 for (Geometry *g : m_geometries) {
458 delete g;
459 }
460 }
463 }
464 bool accept(Geometry_visitor *v) override;
465 bool is_empty() const override {
466 for (const auto g : m_geometries) {
467 if (!g->is_empty()) return false;
468 }
469 return true;
470 }
471 void pop_front() override {
472 delete *m_geometries.begin();
473 m_geometries.erase(m_geometries.begin());
474 }
475 void push_back(const Geometry &g) override;
476 void push_back(Geometry &&g) override;
477 bool empty() const override;
478 std::size_t size() const override { return m_geometries.size(); }
479 void resize(std::size_t count) override { m_geometries.resize(count); }
480 void clear() noexcept override { m_geometries.clear(); }
481
482 iterator begin() noexcept { return m_geometries.begin(); }
483 const_iterator begin() const noexcept { return m_geometries.begin(); }
484
485 iterator end() noexcept { return m_geometries.end(); }
486 const_iterator end() const noexcept { return m_geometries.end(); }
487
488 Geometry &front() override { return *m_geometries.front(); }
489 const Geometry &front() const override { return *m_geometries.front(); }
490
491 Geometry &operator[](std::size_t i) override { return *m_geometries[i]; }
492 const Geometry &operator[](std::size_t i) const override {
493 return *m_geometries[i];
494 }
496 return new Geographic_geometrycollection(*this);
497 }
498};
499
500/// A Cartesian 2d multipoint.
502 private:
503 /// List of points in the collection.
504 std::vector<Cartesian_point, Malloc_allocator<Cartesian_point>> m_points;
505
506 public:
507 typedef decltype(m_points)::value_type value_type;
508 typedef decltype(m_points)::iterator iterator;
510
514
517 }
518 bool accept(Geometry_visitor *v) override;
519 bool is_empty() const override {
520 for (const auto &pt : m_points) {
521 if (!pt.is_empty()) return false;
522 }
523 return true;
524 }
525 void pop_front() override { m_points.erase(m_points.begin()); }
526 void push_back(const Geometry &g) override;
527 void push_back(Geometry &&g) override;
528 bool empty() const override;
529 std::size_t size() const override { return m_points.size(); }
530 void resize(std::size_t count) override { m_points.resize(count); }
531 void clear() noexcept override { m_points.clear(); }
532
533 iterator begin() noexcept { return m_points.begin(); }
534 const_iterator begin() const noexcept { return m_points.begin(); }
535
536 iterator end() noexcept { return m_points.end(); }
537 const_iterator end() const noexcept { return m_points.end(); }
538
539 Cartesian_point &front() override { return m_points.front(); }
540 const Cartesian_point &front() const override { return m_points.front(); }
541
542 Cartesian_point &operator[](std::size_t i) override { return m_points[i]; }
543 const Cartesian_point &operator[](std::size_t i) const override {
544 return m_points[i];
545 }
546 Cartesian_multipoint *clone() const override {
547 return new Cartesian_multipoint(*this);
548 }
549};
550
551/// A geographic (ellipsoidal) 2d multipoint.
553 private:
554 /// List of points in the collection.
555 std::vector<Geographic_point, Malloc_allocator<Geographic_point>> m_points;
556
557 public:
558 typedef decltype(m_points)::value_type value_type;
559 typedef decltype(m_points)::iterator iterator;
561
567 }
568 bool accept(Geometry_visitor *v) override;
569 bool is_empty() const override {
570 for (const auto &pt : m_points) {
571 if (!pt.is_empty()) return false;
572 }
573 return true;
574 }
575 void pop_front() override { m_points.erase(m_points.begin()); }
576 void push_back(const Geometry &g) override;
577 void push_back(Geometry &&g) override;
578 bool empty() const override;
579 std::size_t size() const override { return m_points.size(); }
580 void resize(std::size_t count) override { m_points.resize(count); }
581 void clear() noexcept override { m_points.clear(); }
582
583 iterator begin() noexcept { return m_points.begin(); }
584 const_iterator begin() const noexcept { return m_points.begin(); }
585
586 iterator end() noexcept { return m_points.end(); }
587 const_iterator end() const noexcept { return m_points.end(); }
588
589 Geographic_point &front() override { return m_points.front(); }
590 const Geographic_point &front() const override { return m_points.front(); }
591
592 Geographic_point &operator[](std::size_t i) override { return m_points[i]; }
593 const Geographic_point &operator[](std::size_t i) const override {
594 return m_points[i];
595 }
596 Geographic_multipoint *clone() const override {
597 return new Geographic_multipoint(*this);
598 }
599};
600
601/// A Cartesian 2d multilinestring.
603 private:
604 /// List of linestrings in the collection.
605 std::vector<Cartesian_linestring, Malloc_allocator<Cartesian_linestring>>
607
608 public:
610 typedef decltype(m_linestrings)::iterator iterator;
612
616
619 }
620 bool accept(Geometry_visitor *v) override;
621 bool is_empty() const override {
622 for (const auto &ls : m_linestrings) {
623 if (!ls.is_empty()) return false;
624 }
625 return true;
626 }
627 void pop_front() override { m_linestrings.erase(m_linestrings.begin()); }
628 void push_back(const Geometry &g) override;
629 void push_back(Geometry &&g) override;
630 bool empty() const override;
631 std::size_t size() const override { return m_linestrings.size(); }
632 void resize(std::size_t count) override { m_linestrings.resize(count); }
633 void clear() noexcept override { m_linestrings.clear(); }
634
636 const Cartesian_linestring &back() const { return m_linestrings.back(); }
637
638 iterator begin() noexcept { return m_linestrings.begin(); }
639 const_iterator begin() const noexcept { return m_linestrings.begin(); }
640
641 iterator end() noexcept { return m_linestrings.end(); }
642 const_iterator end() const noexcept { return m_linestrings.end(); }
643
644 Cartesian_linestring &front() override { return m_linestrings.front(); }
645 const Cartesian_linestring &front() const override {
646 return m_linestrings.front();
647 }
648
649 Cartesian_linestring &operator[](std::size_t i) override {
650 return m_linestrings[i];
651 }
652 const Geometry &operator[](std::size_t i) const override {
653 return m_linestrings[i];
654 }
656 return new Cartesian_multilinestring(*this);
657 }
658};
659
660/// A geographic (ellipsoidal) 2d multilinestring.
662 private:
663 /// List of linestrings in the collection.
664 std::vector<Geographic_linestring, Malloc_allocator<Geographic_linestring>>
666
667 public:
669 typedef decltype(m_linestrings)::iterator iterator;
671
675
678 }
679 bool accept(Geometry_visitor *v) override;
680 bool is_empty() const override {
681 for (const auto &ls : m_linestrings) {
682 if (!ls.is_empty()) return false;
683 }
684 return true;
685 }
686 void pop_front() override { m_linestrings.erase(m_linestrings.begin()); }
687 void push_back(const Geometry &g) override;
688 void push_back(Geometry &&g) override;
689 bool empty() const override;
690 std::size_t size() const override { return m_linestrings.size(); }
691 void resize(std::size_t count) override { m_linestrings.resize(count); }
692 void clear() noexcept override { m_linestrings.clear(); }
693
695 const Geographic_linestring &back() const { return m_linestrings.back(); }
696
697 iterator begin() noexcept { return m_linestrings.begin(); }
698 const_iterator begin() const noexcept { return m_linestrings.begin(); }
699
700 iterator end() noexcept { return m_linestrings.end(); }
701 const_iterator end() const noexcept { return m_linestrings.end(); }
702
703 Geographic_linestring &front() override { return m_linestrings.front(); }
704 const Geographic_linestring &front() const override {
705 return m_linestrings.front();
706 }
707
708 Geographic_linestring &operator[](std::size_t i) override {
709 return m_linestrings[i];
710 }
711 const Geometry &operator[](std::size_t i) const override {
712 return m_linestrings[i];
713 }
715 return new Geographic_multilinestring(*this);
716 }
717};
718
719/// A Cartesian 2d multipolygon.
721 private:
722 /// List of polygons in the collection.
723 std::vector<Cartesian_polygon, Malloc_allocator<Cartesian_polygon>>
725
726 public:
727 typedef decltype(m_polygons)::value_type value_type;
728 typedef decltype(m_polygons)::iterator iterator;
730
734
737 }
738 bool accept(Geometry_visitor *v) override;
739 bool is_empty() const override {
740 for (const auto &py : m_polygons) {
741 if (!py.is_empty()) return false;
742 }
743 return true;
744 }
745 void pop_front() override { m_polygons.erase(m_polygons.begin()); }
746 void push_back(const Geometry &g) override;
747 void push_back(Geometry &&g) override;
748 bool empty() const override;
749 std::size_t size() const override { return m_polygons.size(); }
750 void resize(std::size_t count) override { m_polygons.resize(count); }
751 void clear() noexcept override { m_polygons.clear(); }
752
753 iterator begin() noexcept { return m_polygons.begin(); }
754 const_iterator begin() const noexcept { return m_polygons.begin(); }
755
756 iterator end() noexcept { return m_polygons.end(); }
757 const_iterator end() const noexcept { return m_polygons.end(); }
758
759 Cartesian_polygon &front() override { return m_polygons.front(); }
760 const Cartesian_polygon &front() const override { return m_polygons.front(); }
761
762 Cartesian_polygon &operator[](std::size_t i) override {
763 return m_polygons[i];
764 }
765 const Geometry &operator[](std::size_t i) const override {
766 return m_polygons[i];
767 }
768 Cartesian_multipolygon *clone() const override {
769 return new Cartesian_multipolygon(*this);
770 }
771};
772
773/// A geographic (ellipsoidal) 2d multipolygon.
775 private:
776 /// List of polygons in the collection.
777 std::vector<Geographic_polygon, Malloc_allocator<Geographic_polygon>>
779
780 public:
781 typedef decltype(m_polygons)::value_type value_type;
782 typedef decltype(m_polygons)::iterator iterator;
784
788
791 }
792 bool accept(Geometry_visitor *v) override;
793 bool is_empty() const override {
794 for (const auto &py : m_polygons) {
795 if (!py.is_empty()) return false;
796 }
797 return true;
798 }
799 void pop_front() override { m_polygons.erase(m_polygons.begin()); }
800 void push_back(const Geometry &g) override;
801 void push_back(Geometry &&g) override;
802 bool empty() const override;
803 std::size_t size() const override { return m_polygons.size(); }
804 void resize(std::size_t count) override { m_polygons.resize(count); }
805 void clear() noexcept override { m_polygons.clear(); }
806
807 iterator begin() noexcept { return m_polygons.begin(); }
808 const_iterator begin() const noexcept { return m_polygons.begin(); }
809
810 iterator end() noexcept { return m_polygons.end(); }
811 const_iterator end() const noexcept { return m_polygons.end(); }
812
813 Geographic_polygon &front() override { return m_polygons.front(); }
814 const Geographic_polygon &front() const override {
815 return m_polygons.front();
816 }
817
818 Geographic_polygon &operator[](std::size_t i) override {
819 return m_polygons[i];
820 }
821 const Geometry &operator[](std::size_t i) const override {
822 return m_polygons[i];
823 }
824 Geographic_multipolygon *clone() const override {
825 return new Geographic_multipolygon(*this);
826 }
827};
828
829} // namespace gis
830
831#endif // SQL_GIS_GEOMETRIES_CS_H_INCLUDED
Malloc_allocator is a C++ STL memory allocator based on my_malloc/my_free.
Definition: malloc_allocator.h:63
A Cartesian 2d geometry collection.
Definition: geometries_cs.h:375
void push_back(const Geometry &g) override
Adds a geometry to the collection.
Definition: geometries.cc:337
decltype(m_geometries) ::const_iterator const_iterator
Definition: geometries_cs.h:382
~Cartesian_geometrycollection() override
Definition: geometries_cs.h:393
Geometry & front() override
Returns the first geometry of the collection.
Definition: geometries_cs.h:425
Cartesian_geometrycollection()
Definition: geometries_cs.h:384
void resize(std::size_t count) override
Resizes the geometrycollection to contain a given number of elements.
Definition: geometries_cs.h:416
iterator end() noexcept
Definition: geometries_cs.h:422
const Geometry & front() const override
Definition: geometries_cs.h:426
std::size_t size() const override
Returns the size of the geometrycollection.
Definition: geometries_cs.h:415
iterator begin() noexcept
Definition: geometries_cs.h:419
const_iterator begin() const noexcept
Definition: geometries_cs.h:420
bool is_empty() const override
Check if this is an empty geometry.
Definition: geometries_cs.h:402
const_iterator end() const noexcept
Definition: geometries_cs.h:423
bool accept(Geometry_visitor *v) override
Applies a hierarchical visitor to this geometry.
Definition: geometries.cc:326
Cartesian_geometrycollection(Cartesian_geometrycollection &&gc) noexcept
Definition: geometries_cs.h:388
Coordinate_system coordinate_system() const override
Gets the coordinate system.
Definition: geometries_cs.h:398
Cartesian_geometrycollection * clone() const override
Clone pattern to easily duplicate a Geometrycollection.
Definition: geometries_cs.h:432
const Geometry & operator[](std::size_t i) const override
Definition: geometries_cs.h:429
std::vector< Geometry *, Malloc_allocator< Geometry * > > m_geometries
List of geometries in the collection.
Definition: geometries_cs.h:378
bool empty() const override
Checks if the collection is empty.
Definition: geometries.cc:407
decltype(m_geometries) ::iterator iterator
Definition: geometries_cs.h:381
void clear() noexcept override
Removes all geometries from the geometrycollection.
Definition: geometries_cs.h:417
void pop_front() override
Removes a geometry from the front of the collection.
Definition: geometries_cs.h:408
Geometry & operator[](std::size_t i) override
Definition: geometries_cs.h:428
A Cartesian 2d linear ring.
Definition: geometries_cs.h:177
bool is_empty() const override
Check if this is an empty geometry.
Definition: geometries_cs.h:184
void push_back(const gis::Point &pt) override
Adds a point to the end of the linestring.
Definition: geometries_cs.h:185
const Cartesian_point & front() const override
Definition: geometries_cs.h:210
void pop_front() override
Removes a point from the front of the linestring.
Definition: geometries_cs.h:191
Cartesian_point & front() override
Returns the first point of the linestring.
Definition: geometries_cs.h:209
Cartesian_point & back() override
Returns the last point of the linestring.
Definition: geometries_cs.h:204
const Cartesian_point & operator[](std::size_t i) const override
Definition: geometries_cs.h:217
Coordinate_system coordinate_system() const override
Gets the coordinate system.
Definition: geometries_cs.h:180
Cartesian_linestring * clone() const override
This implementation of clone() uses a broader return type than other implementations.
Definition: geometries_cs.h:200
void clear() noexcept override
Removes all points from the linestring.
Definition: geometries_cs.h:194
bool accept(Geometry_visitor *v) override
Applies a hierarchical visitor to this geometry.
Definition: geometries.cc:132
Geometry_type type() const override
Gets the geometry type of the object.
Definition: geometries_cs.h:179
std::size_t size() const override
Returns the size of (number of points in) the linestring.
Definition: geometries_cs.h:193
bool empty() const override
Checks if the linestring is empty.
Definition: geometries_cs.h:192
void push_back(gis::Point &&pt) override
Definition: geometries_cs.h:188
const Cartesian_point & back() const override
Definition: geometries_cs.h:205
Cartesian_point & operator[](std::size_t i) override
Definition: geometries_cs.h:214
A Cartesian 2d linestring.
Definition: geometries_cs.h:71
bool empty() const override
Checks if the linestring is empty.
Definition: geometries.cc:100
iterator begin() noexcept
Definition: geometries_cs.h:107
std::vector< Cartesian_point, Malloc_allocator< Cartesian_point > > m_points
String of points constituting the linestring.
Definition: geometries_cs.h:77
iterator end() noexcept
Definition: geometries_cs.h:110
void clear() noexcept override
Removes all points from the linestring.
Definition: geometries_cs.h:98
Cartesian_linestring()
Definition: geometries_cs.h:84
const_iterator begin() const noexcept
Definition: geometries_cs.h:108
Cartesian_point & back() override
Returns the last point of the linestring.
Definition: geometries_cs.h:104
std::size_t size() const override
Returns the size of (number of points in) the linestring.
Definition: geometries_cs.h:96
void pop_front() override
Removes a point from the front of the linestring.
Definition: geometries_cs.h:94
void push_back(const Point &pt) override
Adds a point to the end of the linestring.
Definition: geometries.cc:90
decltype(m_points) ::iterator iterator
Definition: geometries_cs.h:81
Cartesian_point & operator[](std::size_t i) override
Definition: geometries_cs.h:116
const Cartesian_point & front() const override
Definition: geometries_cs.h:114
bool accept(Geometry_visitor *v) override
Applies a hierarchical visitor to this geometry.
Definition: geometries.cc:64
Coordinate_system coordinate_system() const override
Gets the coordinate system.
Definition: geometries_cs.h:88
Cartesian_point & front() override
Returns the first point of the linestring.
Definition: geometries_cs.h:113
Cartesian_linestring * clone() const override
Definition: geometries_cs.h:100
const Cartesian_point & operator[](std::size_t i) const override
Definition: geometries_cs.h:117
const_iterator end() const noexcept
Definition: geometries_cs.h:111
const Cartesian_point & back() const override
Definition: geometries_cs.h:105
decltype(m_points) ::const_iterator const_iterator
Definition: geometries_cs.h:82
decltype(m_points) ::value_type value_type
Definition: geometries_cs.h:80
void resize(std::size_t count)
Definition: geometries_cs.h:97
A Cartesian 2d multilinestring.
Definition: geometries_cs.h:602
const_iterator begin() const noexcept
Definition: geometries_cs.h:639
Cartesian_linestring & front() override
Returns the first linestring of the Multilinestring.
Definition: geometries_cs.h:644
const_iterator end() const noexcept
Definition: geometries_cs.h:642
decltype(m_linestrings) ::value_type value_type
Definition: geometries_cs.h:609
std::vector< Cartesian_linestring, Malloc_allocator< Cartesian_linestring > > m_linestrings
List of linestrings in the collection.
Definition: geometries_cs.h:606
decltype(m_linestrings) ::iterator iterator
Definition: geometries_cs.h:610
Cartesian_multilinestring * clone() const override
Clone pattern to easily duplicate a Multilinestring.
Definition: geometries_cs.h:655
std::size_t size() const override
Returns the size of the geometrycollection.
Definition: geometries_cs.h:631
bool is_empty() const override
Check if this is an empty geometry.
Definition: geometries_cs.h:621
void pop_front() override
Removes a geometry from the front of the collection.
Definition: geometries_cs.h:627
Cartesian_multilinestring()
Definition: geometries_cs.h:613
Cartesian_linestring & operator[](std::size_t i) override
Definition: geometries_cs.h:649
void push_back(const Geometry &g) override
Adds a geometry to the collection.
Definition: geometries.cc:600
bool accept(Geometry_visitor *v) override
Applies a hierarchical visitor to this geometry.
Definition: geometries.cc:589
Cartesian_linestring & back()
Definition: geometries_cs.h:635
const Cartesian_linestring & front() const override
Definition: geometries_cs.h:645
bool empty() const override
Checks if the collection is empty.
Definition: geometries.cc:610
Coordinate_system coordinate_system() const override
Gets the coordinate system.
Definition: geometries_cs.h:617
iterator begin() noexcept
Definition: geometries_cs.h:638
void clear() noexcept override
Removes all geometries from the geometrycollection.
Definition: geometries_cs.h:633
const Geometry & operator[](std::size_t i) const override
Definition: geometries_cs.h:652
iterator end() noexcept
Definition: geometries_cs.h:641
decltype(m_linestrings) ::const_iterator const_iterator
Definition: geometries_cs.h:611
void resize(std::size_t count) override
Resizes the geometrycollection to contain a given number of elements.
Definition: geometries_cs.h:632
const Cartesian_linestring & back() const
Definition: geometries_cs.h:636
A Cartesian 2d multipoint.
Definition: geometries_cs.h:501
Coordinate_system coordinate_system() const override
Gets the coordinate system.
Definition: geometries_cs.h:515
const_iterator begin() const noexcept
Definition: geometries_cs.h:534
void pop_front() override
Removes a geometry from the front of the collection.
Definition: geometries_cs.h:525
const Cartesian_point & front() const override
Definition: geometries_cs.h:540
void clear() noexcept override
Removes all geometries from the geometrycollection.
Definition: geometries_cs.h:531
Cartesian_point & front() override
Returns the first point of the Multipoint.
Definition: geometries_cs.h:539
Cartesian_multipoint * clone() const override
Clone pattern to easily duplicate a Multipoint.
Definition: geometries_cs.h:546
const Cartesian_point & operator[](std::size_t i) const override
Definition: geometries_cs.h:543
bool empty() const override
Checks if the collection is empty.
Definition: geometries.cc:556
decltype(m_points) ::iterator iterator
Definition: geometries_cs.h:508
decltype(m_points) ::value_type value_type
Definition: geometries_cs.h:507
decltype(m_points) ::const_iterator const_iterator
Definition: geometries_cs.h:509
void push_back(const Geometry &g) override
Adds a geometry to the collection.
Definition: geometries.cc:546
Cartesian_point & operator[](std::size_t i) override
Definition: geometries_cs.h:542
iterator begin() noexcept
Definition: geometries_cs.h:533
bool accept(Geometry_visitor *v) override
Applies a hierarchical visitor to this geometry.
Definition: geometries.cc:536
iterator end() noexcept
Definition: geometries_cs.h:536
std::vector< Cartesian_point, Malloc_allocator< Cartesian_point > > m_points
List of points in the collection.
Definition: geometries_cs.h:504
bool is_empty() const override
Check if this is an empty geometry.
Definition: geometries_cs.h:519
void resize(std::size_t count) override
Resizes the geometrycollection to contain a given number of elements.
Definition: geometries_cs.h:530
Cartesian_multipoint()
Definition: geometries_cs.h:511
const_iterator end() const noexcept
Definition: geometries_cs.h:537
std::size_t size() const override
Returns the size of the geometrycollection.
Definition: geometries_cs.h:529
A Cartesian 2d multipolygon.
Definition: geometries_cs.h:720
Cartesian_multipolygon * clone() const override
Clone pattern to easily duplicate a Multipolygon.
Definition: geometries_cs.h:768
Coordinate_system coordinate_system() const override
Gets the coordinate system.
Definition: geometries_cs.h:735
bool is_empty() const override
Check if this is an empty geometry.
Definition: geometries_cs.h:739
void push_back(const Geometry &g) override
Adds a geometry to the collection.
Definition: geometries.cc:654
const_iterator begin() const noexcept
Definition: geometries_cs.h:754
void resize(std::size_t count) override
Resizes the geometrycollection to contain a given number of elements.
Definition: geometries_cs.h:750
void clear() noexcept override
Removes all geometries from the geometrycollection.
Definition: geometries_cs.h:751
decltype(m_polygons) ::const_iterator const_iterator
Definition: geometries_cs.h:729
iterator begin() noexcept
Definition: geometries_cs.h:753
decltype(m_polygons) ::iterator iterator
Definition: geometries_cs.h:728
const Geometry & operator[](std::size_t i) const override
Definition: geometries_cs.h:765
std::size_t size() const override
Returns the size of the geometrycollection.
Definition: geometries_cs.h:749
void pop_front() override
Removes a geometry from the front of the collection.
Definition: geometries_cs.h:745
decltype(m_polygons) ::value_type value_type
Definition: geometries_cs.h:727
bool empty() const override
Checks if the collection is empty.
Definition: geometries.cc:664
Cartesian_multipolygon()
Definition: geometries_cs.h:731
const Cartesian_polygon & front() const override
Definition: geometries_cs.h:760
iterator end() noexcept
Definition: geometries_cs.h:756
std::vector< Cartesian_polygon, Malloc_allocator< Cartesian_polygon > > m_polygons
List of polygons in the collection.
Definition: geometries_cs.h:724
const_iterator end() const noexcept
Definition: geometries_cs.h:757
bool accept(Geometry_visitor *v) override
Applies a hierarchical visitor to this geometry.
Definition: geometries.cc:644
Cartesian_polygon & front() override
Returns the first polygon of the Multipolygon.
Definition: geometries_cs.h:759
Cartesian_polygon & operator[](std::size_t i) override
Definition: geometries_cs.h:762
A Cartesian 2d point.
Definition: geometries_cs.h:47
Cartesian_point()=default
Coordinate_system coordinate_system() const override
Gets the coordinate system.
Definition: geometries_cs.h:51
Cartesian_point * clone() const override
Definition: geometries_cs.h:54
Cartesian_point(double x, double y)
Definition: geometries_cs.h:50
A Cartesian 2d polygon.
Definition: geometries_cs.h:269
decltype(m_interior_rings) & interior_rings()
Get list of interior rings.
Linearring & exterior_ring() override
Returns the exterior ring of the polygon.
Definition: geometries_cs.h:316
Cartesian_polygon()
Definition: geometries_cs.h:279
Cartesian_polygon * clone() const override
Definition: geometries_cs.h:290
std::vector< Cartesian_linearring, Malloc_allocator< Cartesian_linearring > > m_interior_rings
Interior rings (holes).
Definition: geometries_cs.h:276
std::size_t size() const override
Returns the size of the polygon.
Definition: geometries.cc:190
Coordinate_system coordinate_system() const override
Gets the coordinate system.
Definition: geometries_cs.h:282
void push_back(const Linearring &lr) override
Adds a linear ring to the polygon.
Definition: geometries.cc:170
Cartesian_linearring & cartesian_exterior_ring() const
Get the exterior ring.
Definition: geometries.cc:210
bool accept(Geometry_visitor *v) override
Applies a hierarchical visitor to this geometry.
Definition: geometries.cc:160
Cartesian_linearring m_exterior_ring
Exterior ring.
Definition: geometries_cs.h:272
bool empty() const override
Checks if the polygon is empty.
Definition: geometries.cc:186
decltype(m_interior_rings) const & const_interior_rings() const
Get list of interior rings.
Linearring & interior_ring(std::size_t n) override
Returns an interior ring of the polygon.
Definition: geometries.cc:196
A geographic (ellipsoidal) 2d geometry collection.
Definition: geometries_cs.h:438
bool accept(Geometry_visitor *v) override
Applies a hierarchical visitor to this geometry.
Definition: geometries.cc:451
const_iterator begin() const noexcept
Definition: geometries_cs.h:483
const Geometry & operator[](std::size_t i) const override
Definition: geometries_cs.h:492
decltype(m_geometries) ::iterator iterator
Definition: geometries_cs.h:444
Coordinate_system coordinate_system() const override
Gets the coordinate system.
Definition: geometries_cs.h:461
const_iterator end() const noexcept
Definition: geometries_cs.h:486
bool is_empty() const override
Check if this is an empty geometry.
Definition: geometries_cs.h:465
void push_back(const Geometry &g) override
Adds a geometry to the collection.
Definition: geometries.cc:462
Geographic_geometrycollection()
Definition: geometries_cs.h:447
void resize(std::size_t count) override
Resizes the geometrycollection to contain a given number of elements.
Definition: geometries_cs.h:479
Geometry & operator[](std::size_t i) override
Definition: geometries_cs.h:491
void clear() noexcept override
Removes all geometries from the geometrycollection.
Definition: geometries_cs.h:480
const Geometry & front() const override
Definition: geometries_cs.h:489
void pop_front() override
Removes a geometry from the front of the collection.
Definition: geometries_cs.h:471
Geographic_geometrycollection * clone() const override
Clone pattern to easily duplicate a Geometrycollection.
Definition: geometries_cs.h:495
Geographic_geometrycollection(Geographic_geometrycollection &&gc) noexcept
Definition: geometries_cs.h:451
~Geographic_geometrycollection() override
Definition: geometries_cs.h:456
std::size_t size() const override
Returns the size of the geometrycollection.
Definition: geometries_cs.h:478
iterator begin() noexcept
Definition: geometries_cs.h:482
std::vector< Geometry *, Malloc_allocator< Geometry * > > m_geometries
List of geometries in the collection.
Definition: geometries_cs.h:441
decltype(m_geometries) ::const_iterator const_iterator
Definition: geometries_cs.h:445
bool empty() const override
Checks if the collection is empty.
Definition: geometries.cc:532
Geometry & front() override
Returns the first geometry of the collection.
Definition: geometries_cs.h:488
iterator end() noexcept
Definition: geometries_cs.h:485
A geographic (ellipsoidal) 2d linear ring.
Definition: geometries_cs.h:223
void push_back(const gis::Point &pt) override
Adds a point to the end of the linestring.
Definition: geometries_cs.h:231
bool empty() const override
Checks if the linestring is empty.
Definition: geometries_cs.h:238
bool accept(Geometry_visitor *v) override
Applies a hierarchical visitor to this geometry.
Definition: geometries.cc:142
Geographic_linestring * clone() const override
This implementation of clone() uses a broader return type than other implementations.
Definition: geometries_cs.h:246
Geographic_point & back() override
Returns the last point of the linestring.
Definition: geometries_cs.h:250
const Geographic_point & front() const override
Definition: geometries_cs.h:256
bool is_empty() const override
Check if this is an empty geometry.
Definition: geometries_cs.h:230
Geographic_point & front() override
Returns the first point of the linestring.
Definition: geometries_cs.h:255
Coordinate_system coordinate_system() const override
Gets the coordinate system.
Definition: geometries_cs.h:226
const Geographic_point & back() const override
Definition: geometries_cs.h:251
Geometry_type type() const override
Gets the geometry type of the object.
Definition: geometries_cs.h:225
void clear() noexcept override
Removes all points from the linestring.
Definition: geometries_cs.h:240
void push_back(gis::Point &&pt) override
Definition: geometries_cs.h:234
std::size_t size() const override
Returns the size of (number of points in) the linestring.
Definition: geometries_cs.h:239
void pop_front() override
Removes a point from the front of the linestring.
Definition: geometries_cs.h:237
const Geographic_point & operator[](std::size_t i) const override
Definition: geometries_cs.h:263
Geographic_point & operator[](std::size_t i) override
Definition: geometries_cs.h:260
A geographic (ellipsoidal) 2d linestring.
Definition: geometries_cs.h:125
Geographic_point & operator[](std::size_t i) override
Definition: geometries_cs.h:170
bool empty() const override
Checks if the linestring is empty.
Definition: geometries.cc:122
bool accept(Geometry_visitor *v) override
Applies a hierarchical visitor to this geometry.
Definition: geometries.cc:102
const_iterator begin() const noexcept
Definition: geometries_cs.h:162
void push_back(const Point &pt) override
Adds a point to the end of the linestring.
Definition: geometries.cc:112
const Geographic_point & back() const override
Definition: geometries_cs.h:159
std::size_t size() const override
Returns the size of (number of points in) the linestring.
Definition: geometries_cs.h:150
void clear() noexcept override
Removes all points from the linestring.
Definition: geometries_cs.h:152
Coordinate_system coordinate_system() const override
Gets the coordinate system.
Definition: geometries_cs.h:142
Geographic_linestring()
Definition: geometries_cs.h:138
Geographic_point & back() override
Returns the last point of the linestring.
Definition: geometries_cs.h:158
Geographic_point & front() override
Returns the first point of the linestring.
Definition: geometries_cs.h:167
decltype(m_points) ::value_type value_type
Definition: geometries_cs.h:134
decltype(m_points) ::const_iterator const_iterator
Definition: geometries_cs.h:136
const_iterator end() const noexcept
Definition: geometries_cs.h:165
const Geographic_point & operator[](std::size_t i) const override
Definition: geometries_cs.h:171
const Geographic_point & front() const override
Definition: geometries_cs.h:168
iterator end() noexcept
Definition: geometries_cs.h:164
Geographic_linestring * clone() const override
Definition: geometries_cs.h:154
decltype(m_points) ::iterator iterator
Definition: geometries_cs.h:135
iterator begin() noexcept
Definition: geometries_cs.h:161
void resize(std::size_t count)
Definition: geometries_cs.h:151
std::vector< Geographic_point, Malloc_allocator< Geographic_point > > m_points
String of points constituting the linestring.
Definition: geometries_cs.h:131
void pop_front() override
Removes a point from the front of the linestring.
Definition: geometries_cs.h:148
A geographic (ellipsoidal) 2d multilinestring.
Definition: geometries_cs.h:661
void resize(std::size_t count) override
Resizes the geometrycollection to contain a given number of elements.
Definition: geometries_cs.h:691
bool is_empty() const override
Check if this is an empty geometry.
Definition: geometries_cs.h:680
const_iterator end() const noexcept
Definition: geometries_cs.h:701
void pop_front() override
Removes a geometry from the front of the collection.
Definition: geometries_cs.h:686
decltype(m_linestrings) ::iterator iterator
Definition: geometries_cs.h:669
const Geographic_linestring & front() const override
Definition: geometries_cs.h:704
decltype(m_linestrings) ::const_iterator const_iterator
Definition: geometries_cs.h:670
void clear() noexcept override
Removes all geometries from the geometrycollection.
Definition: geometries_cs.h:692
std::vector< Geographic_linestring, Malloc_allocator< Geographic_linestring > > m_linestrings
List of linestrings in the collection.
Definition: geometries_cs.h:665
Geographic_linestring & front() override
Returns the first linestring of the Multilinestring.
Definition: geometries_cs.h:703
Geographic_linestring & back()
Definition: geometries_cs.h:694
std::size_t size() const override
Returns the size of the geometrycollection.
Definition: geometries_cs.h:690
Coordinate_system coordinate_system() const override
Gets the coordinate system.
Definition: geometries_cs.h:676
Geographic_linestring & operator[](std::size_t i) override
Definition: geometries_cs.h:708
Geographic_multilinestring * clone() const override
Clone pattern to easily duplicate a Multilinestring.
Definition: geometries_cs.h:714
bool accept(Geometry_visitor *v) override
Applies a hierarchical visitor to this geometry.
Definition: geometries.cc:612
void push_back(const Geometry &g) override
Adds a geometry to the collection.
Definition: geometries.cc:623
Geographic_multilinestring()
Definition: geometries_cs.h:672
const Geographic_linestring & back() const
Definition: geometries_cs.h:695
decltype(m_linestrings) ::value_type value_type
Definition: geometries_cs.h:668
const Geometry & operator[](std::size_t i) const override
Definition: geometries_cs.h:711
iterator end() noexcept
Definition: geometries_cs.h:700
iterator begin() noexcept
Definition: geometries_cs.h:697
bool empty() const override
Checks if the collection is empty.
Definition: geometries.cc:633
const_iterator begin() const noexcept
Definition: geometries_cs.h:698
A geographic (ellipsoidal) 2d multipoint.
Definition: geometries_cs.h:552
iterator end() noexcept
Definition: geometries_cs.h:586
void resize(std::size_t count) override
Resizes the geometrycollection to contain a given number of elements.
Definition: geometries_cs.h:580
bool is_empty() const override
Check if this is an empty geometry.
Definition: geometries_cs.h:569
Geographic_point & front() override
Returns the first point of the Multipoint.
Definition: geometries_cs.h:589
Coordinate_system coordinate_system() const override
Gets the coordinate system.
Definition: geometries_cs.h:565
const Geographic_point & front() const override
Definition: geometries_cs.h:590
Geographic_multipoint()
Definition: geometries_cs.h:562
Geographic_point & operator[](std::size_t i) override
Definition: geometries_cs.h:592
Geographic_multipoint * clone() const override
Clone pattern to easily duplicate a Multipoint.
Definition: geometries_cs.h:596
const Geographic_point & operator[](std::size_t i) const override
Definition: geometries_cs.h:593
bool accept(Geometry_visitor *v) override
Applies a hierarchical visitor to this geometry.
Definition: geometries.cc:558
iterator begin() noexcept
Definition: geometries_cs.h:583
void clear() noexcept override
Removes all geometries from the geometrycollection.
Definition: geometries_cs.h:581
decltype(m_points) ::value_type value_type
Definition: geometries_cs.h:558
void pop_front() override
Removes a geometry from the front of the collection.
Definition: geometries_cs.h:575
const_iterator begin() const noexcept
Definition: geometries_cs.h:584
decltype(m_points) ::const_iterator const_iterator
Definition: geometries_cs.h:560
const_iterator end() const noexcept
Definition: geometries_cs.h:587
bool empty() const override
Checks if the collection is empty.
Definition: geometries.cc:578
std::vector< Geographic_point, Malloc_allocator< Geographic_point > > m_points
List of points in the collection.
Definition: geometries_cs.h:555
decltype(m_points) ::iterator iterator
Definition: geometries_cs.h:559
void push_back(const Geometry &g) override
Adds a geometry to the collection.
Definition: geometries.cc:568
std::size_t size() const override
Returns the size of the geometrycollection.
Definition: geometries_cs.h:579
A geographic (ellipsoidal) 2d multipolygon.
Definition: geometries_cs.h:774
Geographic_multipolygon()
Definition: geometries_cs.h:785
Geographic_polygon & operator[](std::size_t i) override
Definition: geometries_cs.h:818
decltype(m_polygons) ::value_type value_type
Definition: geometries_cs.h:781
void pop_front() override
Removes a geometry from the front of the collection.
Definition: geometries_cs.h:799
bool empty() const override
Checks if the collection is empty.
Definition: geometries.cc:686
Geographic_polygon & front() override
Returns the first polygon of the Multipolygon.
Definition: geometries_cs.h:813
void push_back(const Geometry &g) override
Adds a geometry to the collection.
Definition: geometries.cc:676
iterator end() noexcept
Definition: geometries_cs.h:810
const Geographic_polygon & front() const override
Definition: geometries_cs.h:814
Coordinate_system coordinate_system() const override
Gets the coordinate system.
Definition: geometries_cs.h:789
decltype(m_polygons) ::const_iterator const_iterator
Definition: geometries_cs.h:783
const_iterator end() const noexcept
Definition: geometries_cs.h:811
std::size_t size() const override
Returns the size of the geometrycollection.
Definition: geometries_cs.h:803
Geographic_multipolygon * clone() const override
Clone pattern to easily duplicate a Multipolygon.
Definition: geometries_cs.h:824
iterator begin() noexcept
Definition: geometries_cs.h:807
const_iterator begin() const noexcept
Definition: geometries_cs.h:808
std::vector< Geographic_polygon, Malloc_allocator< Geographic_polygon > > m_polygons
List of polygons in the collection.
Definition: geometries_cs.h:778
const Geometry & operator[](std::size_t i) const override
Definition: geometries_cs.h:821
void resize(std::size_t count) override
Resizes the geometrycollection to contain a given number of elements.
Definition: geometries_cs.h:804
decltype(m_polygons) ::iterator iterator
Definition: geometries_cs.h:782
void clear() noexcept override
Removes all geometries from the geometrycollection.
Definition: geometries_cs.h:805
bool is_empty() const override
Check if this is an empty geometry.
Definition: geometries_cs.h:793
bool accept(Geometry_visitor *v) override
Applies a hierarchical visitor to this geometry.
Definition: geometries.cc:666
A geographic (ellipsoidal) 2d point.
Definition: geometries_cs.h:58
Geographic_point(double x, double y)
Definition: geometries_cs.h:61
Coordinate_system coordinate_system() const override
Gets the coordinate system.
Definition: geometries_cs.h:62
Geographic_point()=default
Geographic_point * clone() const override
Definition: geometries_cs.h:65
A geographic (ellipsoidal) 2d polygon.
Definition: geometries_cs.h:322
decltype(m_interior_rings) & interior_rings()
Get list of interior rings.
decltype(m_interior_rings) const & const_interior_rings() const
Get list of interior rings.
Geographic_linearring & geographic_exterior_ring() const
Get the exterior ring.
Definition: geometries.cc:255
Linearring & exterior_ring() override
Returns the exterior ring of the polygon.
Definition: geometries_cs.h:369
Coordinate_system coordinate_system() const override
Gets the coordinate system.
Definition: geometries_cs.h:335
Geographic_polygon * clone() const override
Definition: geometries_cs.h:343
bool accept(Geometry_visitor *v) override
Applies a hierarchical visitor to this geometry.
Definition: geometries.cc:200
std::size_t size() const override
Returns the size of the polygon.
Definition: geometries.cc:249
std::vector< Geographic_linearring, Malloc_allocator< Geographic_linearring > > m_interior_rings
Interior rings (holes).
Definition: geometries_cs.h:329
Geographic_polygon()
Definition: geometries_cs.h:332
Geographic_linearring m_exterior_ring
Exterior ring.
Definition: geometries_cs.h:325
bool empty() const override
Checks if the polygon is empty.
Definition: geometries.cc:245
void push_back(const Linearring &lr) override
Adds a linear ring to the polygon.
Definition: geometries.cc:229
Linearring & interior_ring(std::size_t n) override
Returns an interior ring of the polygon.
Definition: geometries.cc:259
Abstract visitor class to be used on class Geometry and descendants.
Definition: geometry_visitor.h:46
Abstract superclass for all geometric objects.
Definition: geometries.h:100
A collection of geometries.
Definition: geometries.h:410
A ring-shaped linestring.
Definition: geometries.h:320
A string of connected line segments.
Definition: geometries.h:256
bool is_empty() const override
Check if this is an empty geometry.
Definition: geometries.h:260
Geometry_type type() const override
Gets the geometry type of the object.
Definition: geometries.h:258
A collection of linestrings.
Definition: geometries.h:523
A collection of points.
Definition: geometries.h:484
A collection of polygons.
Definition: geometries.h:564
A 2d point.
Definition: geometries.h:150
double x() const
Gets the first coordinate value.
Definition: geometries.cc:46
double y() const
Gets the second coordinate value.
Definition: geometries.cc:48
A polygon consisting of an outer ring and zero or more interior rings defining holes in the polygon.
Definition: geometries.h:349
This file declares the geometry class hierarchy used by the server as the internal representation of ...
static int count
Definition: myisam_ftdump.cc:43
Definition: area.cc:47
Coordinate_system
Types of coordinate systems.
Definition: geometries.h:69
@ kCartesian
A Cartesian plane with the same unit in both directions.
@ kGeographic
An ellipsoidal system with longitude and latitude coordinates, both in the same unit.
Geometry_type
Types of geometry objects.
Definition: geometries.h:53
PSI_memory_key key_memory_Geometry_objects_data
Definition: psi_memory_key.cc:48
int n
Definition: xcom_base.cc:509