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