MySQL  8.0.26
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, 2021, 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"
41 #include "sql/malloc_allocator.h"
42 
43 namespace gis {
44 
45 /// A Cartesian 2d point.
46 class 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.
57 class 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 #if defined(__SUNPRO_CC)
179  ~Cartesian_linearring() override = default;
180 #endif
181  Geometry_type type() const override { return Linearring::type(); }
184  }
185  bool accept(Geometry_visitor *v) override;
186  bool is_empty() const override { return Cartesian_linestring::is_empty(); }
187  void push_back(const gis::Point &pt) override {
189  }
190  void push_back(gis::Point &&pt) override {
191  Cartesian_linestring::push_back(std::forward<Point &&>(pt));
192  }
194  bool empty() const override { return Cartesian_linestring::empty(); }
195  std::size_t size() const override { return Cartesian_linestring::size(); }
196  void clear() noexcept override { Cartesian_linestring::clear(); }
197 
198  /// This implementation of clone() uses a broader return type than
199  /// other implementations. This is due to the restraint in some compilers,
200  /// such as cl.exe, that overriding functions with ambigious bases must have
201  /// covariant return types.
202  Cartesian_linestring *clone() const override {
203  return new Cartesian_linearring(*this);
204  }
205 
207  const Cartesian_point &back() const override {
209  }
210 
212  const Cartesian_point &front() const override {
214  }
215 
216  Cartesian_point &operator[](std::size_t i) override {
218  }
219  const Cartesian_point &operator[](std::size_t i) const override {
221  }
222 };
223 
224 /// A geographic (ellipsoidal) 2d linear ring.
226  public:
227 #if defined(__SUNPRO_CC)
228  ~Geographic_linearring() override = default;
229 #endif
230  Geometry_type type() const override { return Linearring::type(); }
233  }
234  bool accept(Geometry_visitor *v) override;
235  bool is_empty() const override { return Geographic_linestring::is_empty(); }
236  void push_back(const gis::Point &pt) override {
238  }
239  void push_back(gis::Point &&pt) override {
240  Geographic_linestring::push_back(std::forward<Point &&>(pt));
241  }
243  bool empty() const override { return Geographic_linestring::empty(); }
244  std::size_t size() const override { return Geographic_linestring::size(); }
245  void clear() noexcept override { Geographic_linestring::clear(); }
246 
247  /// This implementation of clone() uses a broader return type than
248  /// other implementations. This is due to the restraint in some compilers,
249  /// such as cl.exe, that overriding functions with ambigious bases must have
250  /// covariant return types.
251  Geographic_linestring *clone() const override {
252  return new Geographic_linearring(*this);
253  }
254 
256  const Geographic_point &back() const override {
258  }
259 
261  const Geographic_point &front() const override {
263  }
264 
265  Geographic_point &operator[](std::size_t i) override {
267  }
268  const Geographic_point &operator[](std::size_t i) const override {
270  }
271 };
272 
273 /// A Cartesian 2d polygon.
274 class Cartesian_polygon : public Polygon {
275  private:
276  /// Exterior ring.
278 
279  /// Interior rings (holes).
280  std::vector<Cartesian_linearring, Malloc_allocator<Cartesian_linearring>>
282 
283  public:
289  }
290  bool accept(Geometry_visitor *v) override;
291  void push_back(const Linearring &lr) override;
292  void push_back(Linearring &&lr) override;
293  bool empty() const override;
294 
295  Cartesian_polygon *clone() const override {
296  return new Cartesian_polygon(*this);
297  }
298 
299  /// Get list of interior rings.
300  ///
301  /// This function is used by the interface to Boost.Geometry.
302  ///
303  /// @return The list of interior rings
305 
306  /// Get list of interior rings.
307  ///
308  /// This function is used by the interface to Boost.Geometry.
309  ///
310  /// @return The list of interior rings
311  decltype(m_interior_rings) const &const_interior_rings() const;
312 
313  std::size_t size() const override;
314 
315  /// Get the exterior ring.
316  ///
317  /// This function is used by the interface to Boost.Geometry.
318  ///
319  /// @return The exterior ring.
321  Linearring &exterior_ring() override { return m_exterior_ring; }
322 
323  Linearring &interior_ring(std::size_t n) override;
324 };
325 
326 /// A geographic (ellipsoidal) 2d polygon.
327 class Geographic_polygon : public Polygon {
328  private:
329  /// Exterior ring.
331 
332  /// Interior rings (holes).
333  std::vector<Geographic_linearring, Malloc_allocator<Geographic_linearring>>
335 
336  public:
342  }
343  bool accept(Geometry_visitor *v) override;
344  void push_back(const Linearring &lr) override;
345  void push_back(Linearring &&lr) override;
346  bool empty() const override;
347 
348  Geographic_polygon *clone() const override {
349  return new Geographic_polygon(*this);
350  }
351 
352  /// Get list of interior rings.
353  ///
354  /// This function is used by the interface to Boost.Geometry.
355  ///
356  /// @return The list of interior rings
358 
359  /// Get list of interior rings.
360  ///
361  /// This function is used by the interface to Boost.Geometry.
362  ///
363  /// @return The list of interior rings
364  decltype(m_interior_rings) const &const_interior_rings() const;
365 
366  std::size_t size() const override;
367 
368  /// Get the exterior ring.
369  ///
370  /// This function is used by the interface to Boost.Geometry.
371  ///
372  /// @return The exterior ring.
374  Linearring &exterior_ring() override { return m_exterior_ring; }
375 
376  Linearring &interior_ring(std::size_t n) override;
377 };
378 
379 /// A Cartesian 2d geometry collection.
381  private:
382  /// List of geometries in the collection.
383  std::vector<Geometry *, Malloc_allocator<Geometry *>> m_geometries;
384 
385  public:
386  typedef decltype(m_geometries)::iterator iterator;
388 
390  : m_geometries(
394  : m_geometries(
396  m_geometries = std::move(gc.m_geometries);
397  }
399  for (Geometry *g : m_geometries) {
400  delete g;
401  }
402  }
405  }
406  bool accept(Geometry_visitor *v) override;
407  bool is_empty() const override {
408  for (const auto g : m_geometries) {
409  if (!g->is_empty()) return false;
410  }
411  return true;
412  }
413  void pop_front() override {
414  delete *m_geometries.begin();
415  m_geometries.erase(m_geometries.begin());
416  }
417  void push_back(const Geometry &g) override;
418  void push_back(Geometry &&g) override;
419  bool empty() const override;
420  std::size_t size() const override { return m_geometries.size(); }
421  void resize(std::size_t count) override { m_geometries.resize(count); }
422  void clear() noexcept override { m_geometries.clear(); }
423 
424  iterator begin() noexcept { return m_geometries.begin(); }
425  const_iterator begin() const noexcept { return m_geometries.begin(); }
426 
427  iterator end() noexcept { return m_geometries.end(); }
428  const_iterator end() const noexcept { return m_geometries.end(); }
429 
430  Geometry &front() override { return *m_geometries.front(); }
431  const Geometry &front() const override { return *m_geometries.front(); }
432 
433  Geometry &operator[](std::size_t i) override { return *m_geometries[i]; }
434  const Geometry &operator[](std::size_t i) const override {
435  return *m_geometries[i];
436  }
438  return new Cartesian_geometrycollection(*this);
439  }
440 };
441 
442 /// A geographic (ellipsoidal) 2d geometry collection.
444  private:
445  /// List of geometries in the collection.
446  std::vector<Geometry *, Malloc_allocator<Geometry *>> m_geometries;
447 
448  public:
449  typedef decltype(m_geometries)::iterator iterator;
451 
453  : m_geometries(
457  : m_geometries(
459  m_geometries = std::move(gc.m_geometries);
460  }
462  for (Geometry *g : m_geometries) {
463  delete g;
464  }
465  }
468  }
469  bool accept(Geometry_visitor *v) override;
470  bool is_empty() const override {
471  for (const auto g : m_geometries) {
472  if (!g->is_empty()) return false;
473  }
474  return true;
475  }
476  void pop_front() override {
477  delete *m_geometries.begin();
478  m_geometries.erase(m_geometries.begin());
479  }
480  void push_back(const Geometry &g) override;
481  void push_back(Geometry &&g) override;
482  bool empty() const override;
483  std::size_t size() const override { return m_geometries.size(); }
484  void resize(std::size_t count) override { m_geometries.resize(count); }
485  void clear() noexcept override { m_geometries.clear(); }
486 
487  iterator begin() noexcept { return m_geometries.begin(); }
488  const_iterator begin() const noexcept { return m_geometries.begin(); }
489 
490  iterator end() noexcept { return m_geometries.end(); }
491  const_iterator end() const noexcept { return m_geometries.end(); }
492 
493  Geometry &front() override { return *m_geometries.front(); }
494  const Geometry &front() const override { return *m_geometries.front(); }
495 
496  Geometry &operator[](std::size_t i) override { return *m_geometries[i]; }
497  const Geometry &operator[](std::size_t i) const override {
498  return *m_geometries[i];
499  }
501  return new Geographic_geometrycollection(*this);
502  }
503 };
504 
505 /// A Cartesian 2d multipoint.
507  private:
508  /// List of points in the collection.
509  std::vector<Cartesian_point, Malloc_allocator<Cartesian_point>> m_points;
510 
511  public:
512  typedef decltype(m_points)::value_type value_type;
513  typedef decltype(m_points)::iterator iterator;
515 
519 
522  }
523  bool accept(Geometry_visitor *v) override;
524  bool is_empty() const override {
525  for (const auto &pt : m_points) {
526  if (!pt.is_empty()) return false;
527  }
528  return true;
529  }
530  void pop_front() override { m_points.erase(m_points.begin()); }
531  void push_back(const Geometry &g) override;
532  void push_back(Geometry &&g) override;
533  bool empty() const override;
534  std::size_t size() const override { return m_points.size(); }
535  void resize(std::size_t count) override { m_points.resize(count); }
536  void clear() noexcept override { m_points.clear(); }
537 
538  iterator begin() noexcept { return m_points.begin(); }
539  const_iterator begin() const noexcept { return m_points.begin(); }
540 
541  iterator end() noexcept { return m_points.end(); }
542  const_iterator end() const noexcept { return m_points.end(); }
543 
544  Cartesian_point &front() override { return m_points.front(); }
545  const Cartesian_point &front() const override { return m_points.front(); }
546 
547  Cartesian_point &operator[](std::size_t i) override { return m_points[i]; }
548  const Cartesian_point &operator[](std::size_t i) const override {
549  return m_points[i];
550  }
551  Cartesian_multipoint *clone() const override {
552  return new Cartesian_multipoint(*this);
553  }
554 };
555 
556 /// A geographic (ellipsoidal) 2d multipoint.
558  private:
559  /// List of points in the collection.
560  std::vector<Geographic_point, Malloc_allocator<Geographic_point>> m_points;
561 
562  public:
563  typedef decltype(m_points)::value_type value_type;
564  typedef decltype(m_points)::iterator iterator;
566 
572  }
573  bool accept(Geometry_visitor *v) override;
574  bool is_empty() const override {
575  for (const auto &pt : m_points) {
576  if (!pt.is_empty()) return false;
577  }
578  return true;
579  }
580  void pop_front() override { m_points.erase(m_points.begin()); }
581  void push_back(const Geometry &g) override;
582  void push_back(Geometry &&g) override;
583  bool empty() const override;
584  std::size_t size() const override { return m_points.size(); }
585  void resize(std::size_t count) override { m_points.resize(count); }
586  void clear() noexcept override { m_points.clear(); }
587 
588  iterator begin() noexcept { return m_points.begin(); }
589  const_iterator begin() const noexcept { return m_points.begin(); }
590 
591  iterator end() noexcept { return m_points.end(); }
592  const_iterator end() const noexcept { return m_points.end(); }
593 
594  Geographic_point &front() override { return m_points.front(); }
595  const Geographic_point &front() const override { return m_points.front(); }
596 
597  Geographic_point &operator[](std::size_t i) override { return m_points[i]; }
598  const Geographic_point &operator[](std::size_t i) const override {
599  return m_points[i];
600  }
601  Geographic_multipoint *clone() const override {
602  return new Geographic_multipoint(*this);
603  }
604 };
605 
606 /// A Cartesian 2d multilinestring.
608  private:
609  /// List of linestrings in the collection.
610  std::vector<Cartesian_linestring, Malloc_allocator<Cartesian_linestring>>
612 
613  public:
614  typedef decltype(m_linestrings)::value_type value_type;
615  typedef decltype(m_linestrings)::iterator iterator;
617 
621 
624  }
625  bool accept(Geometry_visitor *v) override;
626  bool is_empty() const override {
627  for (const auto &ls : m_linestrings) {
628  if (!ls.is_empty()) return false;
629  }
630  return true;
631  }
632  void pop_front() override { m_linestrings.erase(m_linestrings.begin()); }
633  void push_back(const Geometry &g) override;
634  void push_back(Geometry &&g) override;
635  bool empty() const override;
636  std::size_t size() const override { return m_linestrings.size(); }
637  void resize(std::size_t count) override { m_linestrings.resize(count); }
638  void clear() noexcept override { m_linestrings.clear(); }
639 
641  const Cartesian_linestring &back() const { return m_linestrings.back(); }
642 
643  iterator begin() noexcept { return m_linestrings.begin(); }
644  const_iterator begin() const noexcept { return m_linestrings.begin(); }
645 
646  iterator end() noexcept { return m_linestrings.end(); }
647  const_iterator end() const noexcept { return m_linestrings.end(); }
648 
649  Cartesian_linestring &front() override { return m_linestrings.front(); }
650  const Cartesian_linestring &front() const override {
651  return m_linestrings.front();
652  }
653 
654  Cartesian_linestring &operator[](std::size_t i) override {
655  return m_linestrings[i];
656  }
657  const Geometry &operator[](std::size_t i) const override {
658  return m_linestrings[i];
659  }
660  Cartesian_multilinestring *clone() const override {
661  return new Cartesian_multilinestring(*this);
662  }
663 };
664 
665 /// A geographic (ellipsoidal) 2d multilinestring.
667  private:
668  /// List of linestrings in the collection.
669  std::vector<Geographic_linestring, Malloc_allocator<Geographic_linestring>>
671 
672  public:
673  typedef decltype(m_linestrings)::value_type value_type;
674  typedef decltype(m_linestrings)::iterator iterator;
676 
680 
683  }
684  bool accept(Geometry_visitor *v) override;
685  bool is_empty() const override {
686  for (const auto &ls : m_linestrings) {
687  if (!ls.is_empty()) return false;
688  }
689  return true;
690  }
691  void pop_front() override { m_linestrings.erase(m_linestrings.begin()); }
692  void push_back(const Geometry &g) override;
693  void push_back(Geometry &&g) override;
694  bool empty() const override;
695  std::size_t size() const override { return m_linestrings.size(); }
696  void resize(std::size_t count) override { m_linestrings.resize(count); }
697  void clear() noexcept override { m_linestrings.clear(); }
698 
700  const Geographic_linestring &back() const { return m_linestrings.back(); }
701 
702  iterator begin() noexcept { return m_linestrings.begin(); }
703  const_iterator begin() const noexcept { return m_linestrings.begin(); }
704 
705  iterator end() noexcept { return m_linestrings.end(); }
706  const_iterator end() const noexcept { return m_linestrings.end(); }
707 
708  Geographic_linestring &front() override { return m_linestrings.front(); }
709  const Geographic_linestring &front() const override {
710  return m_linestrings.front();
711  }
712 
713  Geographic_linestring &operator[](std::size_t i) override {
714  return m_linestrings[i];
715  }
716  const Geometry &operator[](std::size_t i) const override {
717  return m_linestrings[i];
718  }
719  Geographic_multilinestring *clone() const override {
720  return new Geographic_multilinestring(*this);
721  }
722 };
723 
724 /// A Cartesian 2d multipolygon.
726  private:
727  /// List of polygons in the collection.
728  std::vector<Cartesian_polygon, Malloc_allocator<Cartesian_polygon>>
730 
731  public:
732  typedef decltype(m_polygons)::value_type value_type;
733  typedef decltype(m_polygons)::iterator iterator;
735 
739 
742  }
743  bool accept(Geometry_visitor *v) override;
744  bool is_empty() const override {
745  for (const auto &py : m_polygons) {
746  if (!py.is_empty()) return false;
747  }
748  return true;
749  }
750  void pop_front() override { m_polygons.erase(m_polygons.begin()); }
751  void push_back(const Geometry &g) override;
752  void push_back(Geometry &&g) override;
753  bool empty() const override;
754  std::size_t size() const override { return m_polygons.size(); }
755  void resize(std::size_t count) override { m_polygons.resize(count); }
756  void clear() noexcept override { m_polygons.clear(); }
757 
758  iterator begin() noexcept { return m_polygons.begin(); }
759  const_iterator begin() const noexcept { return m_polygons.begin(); }
760 
761  iterator end() noexcept { return m_polygons.end(); }
762  const_iterator end() const noexcept { return m_polygons.end(); }
763 
764  Cartesian_polygon &front() override { return m_polygons.front(); }
765  const Cartesian_polygon &front() const override { return m_polygons.front(); }
766 
767  Cartesian_polygon &operator[](std::size_t i) override {
768  return m_polygons[i];
769  }
770  const Geometry &operator[](std::size_t i) const override {
771  return m_polygons[i];
772  }
773  Cartesian_multipolygon *clone() const override {
774  return new Cartesian_multipolygon(*this);
775  }
776 };
777 
778 /// A geographic (ellipsoidal) 2d multipolygon.
780  private:
781  /// List of polygons in the collection.
782  std::vector<Geographic_polygon, Malloc_allocator<Geographic_polygon>>
784 
785  public:
786  typedef decltype(m_polygons)::value_type value_type;
787  typedef decltype(m_polygons)::iterator iterator;
789 
793 
796  }
797  bool accept(Geometry_visitor *v) override;
798  bool is_empty() const override {
799  for (const auto &py : m_polygons) {
800  if (!py.is_empty()) return false;
801  }
802  return true;
803  }
804  void pop_front() override { m_polygons.erase(m_polygons.begin()); }
805  void push_back(const Geometry &g) override;
806  void push_back(Geometry &&g) override;
807  bool empty() const override;
808  std::size_t size() const override { return m_polygons.size(); }
809  void resize(std::size_t count) override { m_polygons.resize(count); }
810  void clear() noexcept override { m_polygons.clear(); }
811 
812  iterator begin() noexcept { return m_polygons.begin(); }
813  const_iterator begin() const noexcept { return m_polygons.begin(); }
814 
815  iterator end() noexcept { return m_polygons.end(); }
816  const_iterator end() const noexcept { return m_polygons.end(); }
817 
818  Geographic_polygon &front() override { return m_polygons.front(); }
819  const Geographic_polygon &front() const override {
820  return m_polygons.front();
821  }
822 
823  Geographic_polygon &operator[](std::size_t i) override {
824  return m_polygons[i];
825  }
826  const Geometry &operator[](std::size_t i) const override {
827  return m_polygons[i];
828  }
829  Geographic_multipolygon *clone() const override {
830  return new Geographic_multipolygon(*this);
831  }
832 };
833 
834 } // namespace gis
835 
836 #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:380
void push_back(const Geometry &g) override
Adds a geometry to the collection.
Definition: geometries.cc:336
Geometry & front() override
Returns the first geometry of the collection.
Definition: geometries_cs.h:430
~Cartesian_geometrycollection() override
Definition: geometries_cs.h:398
decltype(m_geometries) typedef ::const_iterator const_iterator
Definition: geometries_cs.h:387
decltype(m_geometries) typedef ::iterator iterator
Definition: geometries_cs.h:386
Cartesian_geometrycollection()
Definition: geometries_cs.h:389
const Geometry & operator[](std::size_t i) const override
Definition: geometries_cs.h:434
void resize(std::size_t count) override
Resizes the geometrycollection to contain a given number of elements.
Definition: geometries_cs.h:421
iterator end() noexcept
Definition: geometries_cs.h:427
std::size_t size() const override
Returns the size of the geometrycollection.
Definition: geometries_cs.h:420
Cartesian_geometrycollection * clone() const override
Clone pattern to easily duplicate a Geometrycollection.
Definition: geometries_cs.h:437
iterator begin() noexcept
Definition: geometries_cs.h:424
Geometry & operator[](std::size_t i) override
Definition: geometries_cs.h:433
const_iterator begin() const noexcept
Definition: geometries_cs.h:425
const Geometry & front() const override
Definition: geometries_cs.h:431
bool is_empty() const override
Check if this is an empty geometry.
Definition: geometries_cs.h:407
const_iterator end() const noexcept
Definition: geometries_cs.h:428
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:393
Coordinate_system coordinate_system() const override
Gets the coordinate system.
Definition: geometries_cs.h:403
std::vector< Geometry *, Malloc_allocator< Geometry * > > m_geometries
List of geometries in the collection.
Definition: geometries_cs.h:383
bool empty() const override
Checks if the collection is empty.
Definition: geometries.cc:406
void clear() noexcept override
Removes all geometries from the geometrycollection.
Definition: geometries_cs.h:422
void pop_front() override
Removes a geometry from the front of the collection.
Definition: geometries_cs.h:413
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:186
Cartesian_point & operator[](std::size_t i) override
Definition: geometries_cs.h:216
Cartesian_linestring * clone() const override
This implementation of clone() uses a broader return type than other implementations.
Definition: geometries_cs.h:202
void push_back(const gis::Point &pt) override
Adds a point to the end of the linestring.
Definition: geometries_cs.h:187
void pop_front() override
Removes a point from the front of the linestring.
Definition: geometries_cs.h:193
const Cartesian_point & front() const override
Definition: geometries_cs.h:212
Cartesian_point & back() override
Returns the last point of the linestring.
Definition: geometries_cs.h:206
Coordinate_system coordinate_system() const override
Gets the coordinate system.
Definition: geometries_cs.h:182
const Cartesian_point & operator[](std::size_t i) const override
Definition: geometries_cs.h:219
const Cartesian_point & back() const override
Definition: geometries_cs.h:207
Cartesian_point & front() override
Returns the first point of the linestring.
Definition: geometries_cs.h:211
void clear() noexcept override
Removes all points from the linestring.
Definition: geometries_cs.h:196
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:181
std::size_t size() const override
Returns the size of (number of points in) the linestring.
Definition: geometries_cs.h:195
bool empty() const override
Checks if the linestring is empty.
Definition: geometries_cs.h:194
void push_back(gis::Point &&pt) override
Definition: geometries_cs.h:190
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
Cartesian_point & back() override
Returns the last point of the linestring.
Definition: geometries_cs.h:103
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
decltype(m_points) typedef ::const_iterator const_iterator
Definition: geometries_cs.h:81
void clear() noexcept override
Removes all points from the linestring.
Definition: geometries_cs.h:97
Cartesian_linestring()
Definition: geometries_cs.h:83
Cartesian_linestring * clone() const override
Definition: geometries_cs.h:99
const_iterator begin() const noexcept
Definition: geometries_cs.h:107
std::size_t size() const override
Returns the size of (number of points in) the linestring.
Definition: geometries_cs.h:95
decltype(m_points) typedef ::iterator iterator
Definition: geometries_cs.h:80
void pop_front() override
Removes a point from the front of the linestring.
Definition: geometries_cs.h:93
decltype(m_points) typedef ::value_type value_type
Definition: geometries_cs.h:79
const Cartesian_point & operator[](std::size_t i) const override
Definition: geometries_cs.h:116
void push_back(const Point &pt) override
Adds a point to the end of the linestring.
Definition: geometries.cc:89
Cartesian_point & operator[](std::size_t i) override
Definition: geometries_cs.h:115
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
const_iterator end() const noexcept
Definition: geometries_cs.h:110
const Cartesian_point & front() const override
Definition: geometries_cs.h:113
const Cartesian_point & back() const override
Definition: geometries_cs.h:104
Cartesian_point & front() override
Returns the first point of the linestring.
Definition: geometries_cs.h:112
void resize(std::size_t count)
Definition: geometries_cs.h:96
A Cartesian 2d multilinestring.
Definition: geometries_cs.h:607
const_iterator begin() const noexcept
Definition: geometries_cs.h:644
const_iterator end() const noexcept
Definition: geometries_cs.h:647
Cartesian_linestring & back()
Definition: geometries_cs.h:640
Cartesian_multilinestring * clone() const override
Clone pattern to easily duplicate a Multilinestring.
Definition: geometries_cs.h:660
const Cartesian_linestring & front() const override
Definition: geometries_cs.h:650
std::vector< Cartesian_linestring, Malloc_allocator< Cartesian_linestring > > m_linestrings
List of linestrings in the collection.
Definition: geometries_cs.h:611
std::size_t size() const override
Returns the size of the geometrycollection.
Definition: geometries_cs.h:636
bool is_empty() const override
Check if this is an empty geometry.
Definition: geometries_cs.h:626
void pop_front() override
Removes a geometry from the front of the collection.
Definition: geometries_cs.h:632
Cartesian_multilinestring()
Definition: geometries_cs.h:618
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
const Cartesian_linestring & back() const
Definition: geometries_cs.h:641
const Geometry & operator[](std::size_t i) const override
Definition: geometries_cs.h:657
decltype(m_linestrings) typedef ::iterator iterator
Definition: geometries_cs.h:615
Cartesian_linestring & front() override
Returns the first linestring of the Multilinestring.
Definition: geometries_cs.h:649
Cartesian_linestring & operator[](std::size_t i) override
Definition: geometries_cs.h:654
bool empty() const override
Checks if the collection is empty.
Definition: geometries.cc:609
decltype(m_linestrings) typedef ::const_iterator const_iterator
Definition: geometries_cs.h:616
decltype(m_linestrings) typedef ::value_type value_type
Definition: geometries_cs.h:614
Coordinate_system coordinate_system() const override
Gets the coordinate system.
Definition: geometries_cs.h:622
iterator begin() noexcept
Definition: geometries_cs.h:643
void clear() noexcept override
Removes all geometries from the geometrycollection.
Definition: geometries_cs.h:638
iterator end() noexcept
Definition: geometries_cs.h:646
void resize(std::size_t count) override
Resizes the geometrycollection to contain a given number of elements.
Definition: geometries_cs.h:637
A Cartesian 2d multipoint.
Definition: geometries_cs.h:506
Coordinate_system coordinate_system() const override
Gets the coordinate system.
Definition: geometries_cs.h:520
const_iterator begin() const noexcept
Definition: geometries_cs.h:539
void pop_front() override
Removes a geometry from the front of the collection.
Definition: geometries_cs.h:530
decltype(m_points) typedef ::value_type value_type
Definition: geometries_cs.h:512
void clear() noexcept override
Removes all geometries from the geometrycollection.
Definition: geometries_cs.h:536
decltype(m_points) typedef ::iterator iterator
Definition: geometries_cs.h:513
bool empty() const override
Checks if the collection is empty.
Definition: geometries.cc:555
const Cartesian_point & front() const override
Definition: geometries_cs.h:545
void push_back(const Geometry &g) override
Adds a geometry to the collection.
Definition: geometries.cc:545
iterator begin() noexcept
Definition: geometries_cs.h:538
Cartesian_point & front() override
Returns the first point of the Multipoint.
Definition: geometries_cs.h:544
bool accept(Geometry_visitor *v) override
Applies a hierarchical visitor to this geometry.
Definition: geometries.cc:535
Cartesian_multipoint * clone() const override
Clone pattern to easily duplicate a Multipoint.
Definition: geometries_cs.h:551
iterator end() noexcept
Definition: geometries_cs.h:541
std::vector< Cartesian_point, Malloc_allocator< Cartesian_point > > m_points
List of points in the collection.
Definition: geometries_cs.h:509
bool is_empty() const override
Check if this is an empty geometry.
Definition: geometries_cs.h:524
const Cartesian_point & operator[](std::size_t i) const override
Definition: geometries_cs.h:548
void resize(std::size_t count) override
Resizes the geometrycollection to contain a given number of elements.
Definition: geometries_cs.h:535
decltype(m_points) typedef ::const_iterator const_iterator
Definition: geometries_cs.h:514
Cartesian_multipoint()
Definition: geometries_cs.h:516
Cartesian_point & operator[](std::size_t i) override
Definition: geometries_cs.h:547
const_iterator end() const noexcept
Definition: geometries_cs.h:542
std::size_t size() const override
Returns the size of the geometrycollection.
Definition: geometries_cs.h:534
A Cartesian 2d multipolygon.
Definition: geometries_cs.h:725
Cartesian_polygon & operator[](std::size_t i) override
Definition: geometries_cs.h:767
Coordinate_system coordinate_system() const override
Gets the coordinate system.
Definition: geometries_cs.h:740
bool is_empty() const override
Check if this is an empty geometry.
Definition: geometries_cs.h:744
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:759
void resize(std::size_t count) override
Resizes the geometrycollection to contain a given number of elements.
Definition: geometries_cs.h:755
decltype(m_polygons) typedef ::iterator iterator
Definition: geometries_cs.h:733
void clear() noexcept override
Removes all geometries from the geometrycollection.
Definition: geometries_cs.h:756
iterator begin() noexcept
Definition: geometries_cs.h:758
decltype(m_polygons) typedef ::value_type value_type
Definition: geometries_cs.h:732
const Cartesian_polygon & front() const override
Definition: geometries_cs.h:765
std::size_t size() const override
Returns the size of the geometrycollection.
Definition: geometries_cs.h:754
void pop_front() override
Removes a geometry from the front of the collection.
Definition: geometries_cs.h:750
const Geometry & operator[](std::size_t i) const override
Definition: geometries_cs.h:770
Cartesian_polygon & front() override
Returns the first polygon of the Multipolygon.
Definition: geometries_cs.h:764
decltype(m_polygons) typedef ::const_iterator const_iterator
Definition: geometries_cs.h:734
bool empty() const override
Checks if the collection is empty.
Definition: geometries.cc:663
Cartesian_multipolygon()
Definition: geometries_cs.h:736
iterator end() noexcept
Definition: geometries_cs.h:761
Cartesian_multipolygon * clone() const override
Clone pattern to easily duplicate a Multipolygon.
Definition: geometries_cs.h:773
std::vector< Cartesian_polygon, Malloc_allocator< Cartesian_polygon > > m_polygons
List of polygons in the collection.
Definition: geometries_cs.h:729
const_iterator end() const noexcept
Definition: geometries_cs.h:762
bool accept(Geometry_visitor *v) override
Applies a hierarchical visitor to this geometry.
Definition: geometries.cc:643
A Cartesian 2d point.
Definition: geometries_cs.h:46
Cartesian_point()=default
Cartesian_point * clone() const override
Definition: geometries_cs.h:53
Coordinate_system coordinate_system() const override
Gets the coordinate system.
Definition: geometries_cs.h:50
Cartesian_point(double x, double y)
Definition: geometries_cs.h:49
A Cartesian 2d polygon.
Definition: geometries_cs.h:274
Linearring & exterior_ring() override
Returns the exterior ring of the 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.
Cartesian_polygon()
Definition: geometries_cs.h:284
Cartesian_polygon * clone() const override
Definition: geometries_cs.h:295
std::vector< Cartesian_linearring, Malloc_allocator< Cartesian_linearring > > m_interior_rings
Interior rings (holes).
Definition: geometries_cs.h:281
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:287
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:277
bool empty() const override
Checks if the polygon is empty.
Definition: geometries.cc:185
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:443
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:488
Coordinate_system coordinate_system() const override
Gets the coordinate system.
Definition: geometries_cs.h:466
const_iterator end() const noexcept
Definition: geometries_cs.h:491
bool is_empty() const override
Check if this is an empty geometry.
Definition: geometries_cs.h:470
void push_back(const Geometry &g) override
Adds a geometry to the collection.
Definition: geometries.cc:461
const Geometry & operator[](std::size_t i) const override
Definition: geometries_cs.h:497
Geographic_geometrycollection()
Definition: geometries_cs.h:452
void resize(std::size_t count) override
Resizes the geometrycollection to contain a given number of elements.
Definition: geometries_cs.h:484
decltype(m_geometries) typedef ::const_iterator const_iterator
Definition: geometries_cs.h:450
void clear() noexcept override
Removes all geometries from the geometrycollection.
Definition: geometries_cs.h:485
Geometry & front() override
Returns the first geometry of the collection.
Definition: geometries_cs.h:493
void pop_front() override
Removes a geometry from the front of the collection.
Definition: geometries_cs.h:476
Geographic_geometrycollection * clone() const override
Clone pattern to easily duplicate a Geometrycollection.
Definition: geometries_cs.h:500
Geographic_geometrycollection(Geographic_geometrycollection &&gc) noexcept
Definition: geometries_cs.h:456
Geometry & operator[](std::size_t i) override
Definition: geometries_cs.h:496
const Geometry & front() const override
Definition: geometries_cs.h:494
~Geographic_geometrycollection() override
Definition: geometries_cs.h:461
std::size_t size() const override
Returns the size of the geometrycollection.
Definition: geometries_cs.h:483
iterator begin() noexcept
Definition: geometries_cs.h:487
std::vector< Geometry *, Malloc_allocator< Geometry * > > m_geometries
List of geometries in the collection.
Definition: geometries_cs.h:446
decltype(m_geometries) typedef ::iterator iterator
Definition: geometries_cs.h:449
bool empty() const override
Checks if the collection is empty.
Definition: geometries.cc:531
iterator end() noexcept
Definition: geometries_cs.h:490
A geographic (ellipsoidal) 2d linear ring.
Definition: geometries_cs.h:225
void push_back(const gis::Point &pt) override
Adds a point to the end of the linestring.
Definition: geometries_cs.h:236
bool empty() const override
Checks if the linestring is empty.
Definition: geometries_cs.h:243
const Geographic_point & front() const override
Definition: geometries_cs.h:261
bool accept(Geometry_visitor *v) override
Applies a hierarchical visitor to this geometry.
Definition: geometries.cc:141
Geographic_point & back() override
Returns the last point of the linestring.
Definition: geometries_cs.h:255
Geographic_linestring * clone() const override
This implementation of clone() uses a broader return type than other implementations.
Definition: geometries_cs.h:251
Geographic_point & front() override
Returns the first point of the linestring.
Definition: geometries_cs.h:260
bool is_empty() const override
Check if this is an empty geometry.
Definition: geometries_cs.h:235
Coordinate_system coordinate_system() const override
Gets the coordinate system.
Definition: geometries_cs.h:231
Geometry_type type() const override
Gets the geometry type of the object.
Definition: geometries_cs.h:230
Geographic_point & operator[](std::size_t i) override
Definition: geometries_cs.h:265
const Geographic_point & back() const override
Definition: geometries_cs.h:256
void clear() noexcept override
Removes all points from the linestring.
Definition: geometries_cs.h:245
const Geographic_point & operator[](std::size_t i) const override
Definition: geometries_cs.h:268
void push_back(gis::Point &&pt) override
Definition: geometries_cs.h:239
std::size_t size() const override
Returns the size of (number of points in) the linestring.
Definition: geometries_cs.h:244
void pop_front() override
Removes a point from the front of the linestring.
Definition: geometries_cs.h:242
A geographic (ellipsoidal) 2d linestring.
Definition: geometries_cs.h:124
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
Geographic_linestring * clone() const override
Definition: geometries_cs.h:153
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
Geographic_point & front() override
Returns the first point of the linestring.
Definition: geometries_cs.h:166
decltype(m_points) typedef ::value_type value_type
Definition: geometries_cs.h:133
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
const Geographic_point & front() const override
Definition: geometries_cs.h:167
Coordinate_system coordinate_system() const override
Gets the coordinate system.
Definition: geometries_cs.h:141
Geographic_linestring()
Definition: geometries_cs.h:137
const Geographic_point & back() const override
Definition: geometries_cs.h:158
const_iterator end() const noexcept
Definition: geometries_cs.h:164
decltype(m_points) typedef ::iterator iterator
Definition: geometries_cs.h:134
iterator end() noexcept
Definition: geometries_cs.h:163
const Geographic_point & operator[](std::size_t i) const override
Definition: geometries_cs.h:170
Geographic_point & operator[](std::size_t i) override
Definition: geometries_cs.h:169
iterator begin() noexcept
Definition: geometries_cs.h:160
decltype(m_points) typedef ::const_iterator const_iterator
Definition: geometries_cs.h:135
Geographic_point & back() override
Returns the last point of the linestring.
Definition: geometries_cs.h:157
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:666
void resize(std::size_t count) override
Resizes the geometrycollection to contain a given number of elements.
Definition: geometries_cs.h:696
decltype(m_linestrings) typedef ::value_type value_type
Definition: geometries_cs.h:673
bool is_empty() const override
Check if this is an empty geometry.
Definition: geometries_cs.h:685
const_iterator end() const noexcept
Definition: geometries_cs.h:706
void pop_front() override
Removes a geometry from the front of the collection.
Definition: geometries_cs.h:691
const Geographic_linestring & back() const
Definition: geometries_cs.h:700
void clear() noexcept override
Removes all geometries from the geometrycollection.
Definition: geometries_cs.h:697
const Geometry & operator[](std::size_t i) const override
Definition: geometries_cs.h:716
std::vector< Geographic_linestring, Malloc_allocator< Geographic_linestring > > m_linestrings
List of linestrings in the collection.
Definition: geometries_cs.h:670
Geographic_multilinestring * clone() const override
Clone pattern to easily duplicate a Multilinestring.
Definition: geometries_cs.h:719
std::size_t size() const override
Returns the size of the geometrycollection.
Definition: geometries_cs.h:695
Coordinate_system coordinate_system() const override
Gets the coordinate system.
Definition: geometries_cs.h:681
Geographic_linestring & operator[](std::size_t i) override
Definition: geometries_cs.h:713
decltype(m_linestrings) typedef ::iterator iterator
Definition: geometries_cs.h:674
decltype(m_linestrings) typedef ::const_iterator const_iterator
Definition: geometries_cs.h:675
bool accept(Geometry_visitor *v) override
Applies a hierarchical visitor to this geometry.
Definition: geometries.cc:611
Geographic_linestring & front() override
Returns the first linestring of the Multilinestring.
Definition: geometries_cs.h:708
void push_back(const Geometry &g) override
Adds a geometry to the collection.
Definition: geometries.cc:622
Geographic_multilinestring()
Definition: geometries_cs.h:677
Geographic_linestring & back()
Definition: geometries_cs.h:699
iterator end() noexcept
Definition: geometries_cs.h:705
iterator begin() noexcept
Definition: geometries_cs.h:702
const Geographic_linestring & front() const override
Definition: geometries_cs.h:709
bool empty() const override
Checks if the collection is empty.
Definition: geometries.cc:632
const_iterator begin() const noexcept
Definition: geometries_cs.h:703
A geographic (ellipsoidal) 2d multipoint.
Definition: geometries_cs.h:557
iterator end() noexcept
Definition: geometries_cs.h:591
Geographic_multipoint * clone() const override
Clone pattern to easily duplicate a Multipoint.
Definition: geometries_cs.h:601
void resize(std::size_t count) override
Resizes the geometrycollection to contain a given number of elements.
Definition: geometries_cs.h:585
bool is_empty() const override
Check if this is an empty geometry.
Definition: geometries_cs.h:574
Coordinate_system coordinate_system() const override
Gets the coordinate system.
Definition: geometries_cs.h:570
Geographic_multipoint()
Definition: geometries_cs.h:567
const Geographic_point & operator[](std::size_t i) const override
Definition: geometries_cs.h:598
bool accept(Geometry_visitor *v) override
Applies a hierarchical visitor to this geometry.
Definition: geometries.cc:557
decltype(m_points) typedef ::iterator iterator
Definition: geometries_cs.h:564
iterator begin() noexcept
Definition: geometries_cs.h:588
void clear() noexcept override
Removes all geometries from the geometrycollection.
Definition: geometries_cs.h:586
decltype(m_points) typedef ::const_iterator const_iterator
Definition: geometries_cs.h:565
void pop_front() override
Removes a geometry from the front of the collection.
Definition: geometries_cs.h:580
const_iterator begin() const noexcept
Definition: geometries_cs.h:589
const_iterator end() const noexcept
Definition: geometries_cs.h:592
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:560
const Geographic_point & front() const override
Definition: geometries_cs.h:595
Geographic_point & operator[](std::size_t i) override
Definition: geometries_cs.h:597
Geographic_point & front() override
Returns the first point of the Multipoint.
Definition: geometries_cs.h:594
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:584
decltype(m_points) typedef ::value_type value_type
Definition: geometries_cs.h:563
A geographic (ellipsoidal) 2d multipolygon.
Definition: geometries_cs.h:779
const Geometry & operator[](std::size_t i) const override
Definition: geometries_cs.h:826
Geographic_polygon & operator[](std::size_t i) override
Definition: geometries_cs.h:823
Geographic_multipolygon()
Definition: geometries_cs.h:790
void pop_front() override
Removes a geometry from the front of the collection.
Definition: geometries_cs.h:804
bool empty() const override
Checks if the collection is empty.
Definition: geometries.cc:685
decltype(m_polygons) typedef ::const_iterator const_iterator
Definition: geometries_cs.h:788
void push_back(const Geometry &g) override
Adds a geometry to the collection.
Definition: geometries.cc:675
decltype(m_polygons) typedef ::iterator iterator
Definition: geometries_cs.h:787
iterator end() noexcept
Definition: geometries_cs.h:815
Coordinate_system coordinate_system() const override
Gets the coordinate system.
Definition: geometries_cs.h:794
const_iterator end() const noexcept
Definition: geometries_cs.h:816
std::size_t size() const override
Returns the size of the geometrycollection.
Definition: geometries_cs.h:808
iterator begin() noexcept
Definition: geometries_cs.h:812
const_iterator begin() const noexcept
Definition: geometries_cs.h:813
std::vector< Geographic_polygon, Malloc_allocator< Geographic_polygon > > m_polygons
List of polygons in the collection.
Definition: geometries_cs.h:783
Geographic_polygon & front() override
Returns the first polygon of the Multipolygon.
Definition: geometries_cs.h:818
void resize(std::size_t count) override
Resizes the geometrycollection to contain a given number of elements.
Definition: geometries_cs.h:809
void clear() noexcept override
Removes all geometries from the geometrycollection.
Definition: geometries_cs.h:810
bool is_empty() const override
Check if this is an empty geometry.
Definition: geometries_cs.h:798
Geographic_multipolygon * clone() const override
Clone pattern to easily duplicate a Multipolygon.
Definition: geometries_cs.h:829
decltype(m_polygons) typedef ::value_type value_type
Definition: geometries_cs.h:786
bool accept(Geometry_visitor *v) override
Applies a hierarchical visitor to this geometry.
Definition: geometries.cc:665
const Geographic_polygon & front() const override
Definition: geometries_cs.h:819
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:327
decltype(m_interior_rings) & interior_rings()
Get list of interior rings.
Geographic_linearring & geographic_exterior_ring() const
Get the exterior ring.
Definition: geometries.cc:254
Coordinate_system coordinate_system() const override
Gets the coordinate system.
Definition: geometries_cs.h:340
bool accept(Geometry_visitor *v) override
Applies a hierarchical visitor to this geometry.
Definition: geometries.cc:199
Linearring & exterior_ring() override
Returns the exterior ring of the polygon.
Definition: geometries_cs.h:374
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:334
Geographic_polygon()
Definition: geometries_cs.h:337
Geographic_linearring m_exterior_ring
Exterior ring.
Definition: geometries_cs.h:330
bool empty() const override
Checks if the polygon is empty.
Definition: geometries.cc:244
decltype(m_interior_rings) const & const_interior_rings() const
Get list of interior rings.
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
Geographic_polygon * clone() const override
Definition: geometries_cs.h:348
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:412
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 colletion of linestrings.
Definition: geometries.h:525
A collection of points.
Definition: geometries.h:486
A collection of polygons.
Definition: geometries.h:566
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:351
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:445