GEOS  3.12.0
Geometry.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2009 2011 Sandro Santilli <strk@kbt.io>
7  * Copyright (C) 2005 2006 Refractions Research Inc.
8  * Copyright (C) 2001-2002 Vivid Solutions Inc.
9  *
10  * This is free software; you can redistribute and/or modify it under
11  * the terms of the GNU Lesser General Public Licence as published
12  * by the Free Software Foundation.
13  * See the COPYING file for more information.
14  *
15  **********************************************************************
16  *
17  * Last port: geom/Geometry.java rev. 1.112
18  *
19  **********************************************************************/
20 
21 #pragma once
22 
23 #ifndef USE_UNSTABLE_GEOS_CPP_API
24 #ifndef _MSC_VER
25 # warning "The GEOS C++ API is unstable, please use the C API instead"
26 # warning "HINT: #include geos_c.h"
27 #else
28 #pragma message("The GEOS C++ API is unstable, please use the C API instead")
29 #pragma message("HINT: #include geos_c.h")
30 #endif
31 #endif
32 
33 #include <geos/export.h>
34 #include <geos/geom/Envelope.h>
35 #include <geos/geom/Dimension.h> // for Dimension::DimensionType
36 #include <geos/geom/GeometryComponentFilter.h> // for inheritance
37 
38 #include <algorithm>
39 #include <string>
40 #include <iostream>
41 #include <vector>
42 #include <memory>
43 
44 #ifdef _MSC_VER
45 #pragma warning(push)
46 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
47 #pragma warning(disable: 4355) // warning C4355: 'this' : used in base member initializer list
48 #endif
49 
50 // Forward declarations
51 namespace geos {
52 namespace geom {
53 class Coordinate;
54 class CoordinateFilter;
55 class CoordinateSequence;
56 class CoordinateSequenceFilter;
57 class GeometryComponentFilter;
58 class GeometryFactory;
59 class GeometryFilter;
60 class PrecisionModel;
61 class Point;
62 class IntersectionMatrix;
63 }
64 namespace io { // geos.io
65 class Unload;
66 } // namespace geos.io
67 }
68 
69 namespace geos { // geos
70 namespace geom { // geos::geom
71 
90 };
91 
92 enum GeometrySortIndex {
93  SORTINDEX_POINT = 0,
94  SORTINDEX_MULTIPOINT = 1,
95  SORTINDEX_LINESTRING = 2,
96  SORTINDEX_LINEARRING = 3,
97  SORTINDEX_MULTILINESTRING = 4,
98  SORTINDEX_POLYGON = 5,
99  SORTINDEX_MULTIPOLYGON = 6,
100  SORTINDEX_GEOMETRYCOLLECTION = 7
101 };
102 
186 class GEOS_DLL Geometry {
187 
188 public:
189 
190  friend class GeometryFactory;
191 
193  using ConstVect = std::vector<const Geometry*>;
194 
196  using NonConstVect = std::vector<Geometry*>;
197 
199  using Ptr = std::unique_ptr<Geometry> ;
200 
202  std::unique_ptr<Geometry> clone() const { return std::unique_ptr<Geometry>(cloneImpl()); }
203 
205  virtual ~Geometry();
206 
207 
215  const GeometryFactory*
216  getFactory() const
217  {
218  return _factory;
219  }
220 
234  void
235  setUserData(void* newUserData)
236  {
237  _userData = newUserData;
238  }
239 
246  void*
247  getUserData() const
248  {
249  return _userData;
250  }
251 
262  virtual int
263  getSRID() const
264  {
265  return SRID;
266  }
267 
271  virtual void
272  setSRID(int newSRID)
273  {
274  SRID = newSRID;
275  }
276 
282 
284  virtual const CoordinateXY* getCoordinate() const = 0; //Abstract
285 
291  virtual std::unique_ptr<CoordinateSequence> getCoordinates() const = 0; //Abstract
292 
294  virtual std::size_t getNumPoints() const = 0; //Abstract
295 
297  virtual bool isSimple() const;
298 
300  virtual std::string getGeometryType() const = 0; //Abstract
301 
303  virtual GeometryTypeId getGeometryTypeId() const = 0; //Abstract
304 
307  virtual std::size_t
309  {
310  return 1;
311  }
312 
315  virtual const Geometry*
316  getGeometryN(std::size_t /*n*/) const
317  {
318  return this;
319  }
320 
330  virtual bool isValid() const;
331 
333  virtual bool isEmpty() const = 0; //Abstract
334 
336  virtual bool
337  isRectangle() const
338  {
339  return false;
340  }
341 
343  virtual Dimension::DimensionType getDimension() const = 0; //Abstract
344 
346  virtual bool hasDimension(Dimension::DimensionType d) const {
347  return getDimension() == d;
348  }
349 
352  return d == getDimension();
353  }
354 
355  bool isPuntal() const {
356  return isDimensionStrict(Dimension::P);
357  }
358 
359  bool isLineal() const {
360  return isDimensionStrict(Dimension::L);
361  }
362 
363  bool isPolygonal() const {
364  return isDimensionStrict(Dimension::A);
365  }
366 
367  bool isMixedDimension() const;
368  bool isMixedDimension(Dimension::DimensionType* baseDim) const;
369 
370  bool isCollection() const {
371  int t = getGeometryTypeId();
372  return t == GEOS_GEOMETRYCOLLECTION ||
373  t == GEOS_MULTIPOINT ||
374  t == GEOS_MULTILINESTRING ||
375  t == GEOS_MULTIPOLYGON;
376  }
377 
378  static GeometryTypeId multiTypeId(GeometryTypeId typeId) {
379  switch (typeId) {
380  case GEOS_POINT: return GEOS_MULTIPOINT;
382  case GEOS_POLYGON: return GEOS_MULTIPOLYGON;
383  default: return typeId;
384  }
385  }
386 
388  virtual uint8_t getCoordinateDimension() const = 0; //Abstract
389 
390  virtual bool hasZ() const = 0;
391 
392  virtual bool hasM() const = 0;
393 
410  virtual std::unique_ptr<Geometry> getBoundary() const = 0; //Abstract
411 
413  virtual int getBoundaryDimension() const = 0; //Abstract
414 
416  virtual std::unique_ptr<Geometry> getEnvelope() const;
417 
422  virtual const Envelope* getEnvelopeInternal() const = 0;
423 
440  virtual bool disjoint(const Geometry* other) const;
441 
446  virtual bool touches(const Geometry* other) const;
447 
449  virtual bool intersects(const Geometry* g) const;
450 
473  virtual bool crosses(const Geometry* g) const;
474 
479  virtual bool within(const Geometry* g) const;
480 
482  virtual bool contains(const Geometry* g) const;
483 
489  virtual bool overlaps(const Geometry* g) const;
490 
505  bool relate(const Geometry* g,
506  const std::string& intersectionPattern) const;
507 
508  bool
509  relate(const Geometry& g, const std::string& intersectionPattern) const
510  {
511  return relate(&g, intersectionPattern);
512  }
513 
515  std::unique_ptr<IntersectionMatrix> relate(const Geometry* g) const;
516 
517  std::unique_ptr<IntersectionMatrix> relate(const Geometry& g) const;
518 
524  virtual bool equals(const Geometry* g) const;
525 
564  bool covers(const Geometry* g) const;
565 
596  bool
597  coveredBy(const Geometry* g) const
598  {
599  return g->covers(this);
600  }
601 
602 
604  virtual std::string toString() const;
605 
606  virtual std::string toText() const;
607 
612  std::unique_ptr<Geometry> buffer(double distance) const;
613 
621  std::unique_ptr<Geometry> buffer(double distance, int quadrantSegments) const;
622 
659  std::unique_ptr<Geometry> buffer(double distance, int quadrantSegments,
660  int endCapStyle) const;
661 
665  virtual std::unique_ptr<Geometry> convexHull() const;
666 
673  std::unique_ptr<Geometry> reverse() const { return std::unique_ptr<Geometry>(reverseImpl()); }
674 
684  std::unique_ptr<Geometry> intersection(const Geometry* other) const;
685 
695  std::unique_ptr<Geometry> Union(const Geometry* other) const;
696  // throw(IllegalArgumentException *, TopologyException *);
697 
715  Ptr Union() const;
716  // throw(IllegalArgumentException *, TopologyException *);
717 
728  std::unique_ptr<Geometry> difference(const Geometry* other) const;
729 
739  std::unique_ptr<Geometry> symDifference(const Geometry* other) const;
740 
747  virtual bool equalsExact(const Geometry* other, double tolerance = 0)
748  const = 0; // Abstract
749 
754  virtual bool equalsIdentical(const Geometry* other) const = 0;
755 
756  virtual void apply_rw(const CoordinateFilter* filter) = 0; //Abstract
757  virtual void apply_ro(CoordinateFilter* filter) const = 0; //Abstract
758  virtual void apply_rw(GeometryFilter* filter);
759  virtual void apply_ro(GeometryFilter* filter) const;
760  virtual void apply_rw(GeometryComponentFilter* filter);
761  virtual void apply_ro(GeometryComponentFilter* filter) const;
762 
771  virtual void apply_rw(CoordinateSequenceFilter& filter) = 0;
772 
779  virtual void apply_ro(CoordinateSequenceFilter& filter) const = 0;
780 
790  template <class T>
791  void
793  {
794  for(std::size_t i = 0, n = getNumGeometries(); i < n; ++i) {
795  f.filter(getGeometryN(i));
796  }
797  }
798 
804  virtual void normalize() = 0; //Abstract
805 
807  virtual int compareTo(const Geometry* geom) const;
808 
810  virtual double getArea() const;
811 
813  virtual double getLength() const;
814 
820  virtual double distance(const Geometry* g) const;
821 
822 
834  virtual bool isWithinDistance(const Geometry* geom,
835  double cDistance) const;
836 
846  virtual std::unique_ptr<Point> getCentroid() const;
847 
849  //
852  virtual bool getCentroid(CoordinateXY& ret) const;
853 
864  std::unique_ptr<Point> getInteriorPoint() const;
865 
871  virtual void geometryChanged();
872 
878  virtual void geometryChangedAction() = 0;
879 
880 protected:
882  virtual Geometry* cloneImpl() const = 0;
883 
885  virtual Geometry* reverseImpl() const = 0;
886 
888  template<typename T>
889  static bool hasNonEmptyElements(const std::vector<T>* geometries) {
890  return std::any_of(geometries->begin(), geometries->end(), [](const T& g) { return !g->isEmpty(); });
891  }
892 
894  static bool hasNullElements(const CoordinateSequence* list);
895 
897  template<typename T>
898  static bool hasNullElements(const std::vector<T>* geometries) {
899  return std::any_of(geometries->begin(), geometries->end(), [](const T& g) { return g == nullptr; });
900  }
901 
902 // static void reversePointOrder(CoordinateSequence* coordinates);
903 // static Coordinate& minCoordinate(CoordinateSequence* coordinates);
904 // static void scroll(CoordinateSequence* coordinates,Coordinate* firstCoordinate);
905 // static int indexOf(Coordinate* coordinate,CoordinateSequence* coordinates);
906 //
911  virtual bool isEquivalentClass(const Geometry* other) const;
912 
913  static void checkNotGeometryCollection(const Geometry* g);
914 
915  virtual int compareToSameClass(const Geometry* geom) const = 0; //Abstract
916 
917  int compare(std::vector<Coordinate> a, std::vector<Coordinate> b) const;
918 
919  int compare(std::vector<Geometry*> a, std::vector<Geometry*> b) const;
920 
921  int compare(const std::vector<std::unique_ptr<Geometry>> & a, const std::vector<std::unique_ptr<Geometry>> & b) const;
922 
923  bool equal(const CoordinateXY& a, const CoordinateXY& b,
924  double tolerance) const;
925  int SRID;
926 
927  Geometry(const Geometry& geom);
928 
938  Geometry(const GeometryFactory* factory);
939 
940  template<typename T>
941  static std::vector<std::unique_ptr<Geometry>> toGeometryArray(std::vector<std::unique_ptr<T>> && v) {
942  static_assert(std::is_base_of<Geometry, T>::value, "");
943  std::vector<std::unique_ptr<Geometry>> gv(v.size());
944  for (std::size_t i = 0; i < v.size(); i++) {
945  gv[i] = std::move(v[i]);
946  }
947  return gv;
948  }
949 
950  static std::vector<std::unique_ptr<Geometry>> toGeometryArray(std::vector<std::unique_ptr<Geometry>> && v) {
951  return std::move(v);
952  }
953 
954 protected:
955 
956  virtual int getSortIndex() const = 0;
957 
958 
959 private:
960 
961  class GEOS_DLL GeometryChangedFilter : public GeometryComponentFilter {
962  public:
963  void filter_rw(Geometry* geom) override;
964  };
965 
966  static GeometryChangedFilter geometryChangedFilter;
967 
972  const GeometryFactory* _factory;
973 
974  void* _userData;
975 };
976 
981 GEOS_DLL std::ostream& operator<< (std::ostream& os, const Geometry& geom);
982 
983 struct GEOS_DLL GeometryGreaterThen {
984  bool operator()(const Geometry* first, const Geometry* second);
985 };
986 
987 
989 GEOS_DLL std::string geosversion();
990 
996 GEOS_DLL std::string jtsport();
997 
998 // We use this instead of std::pair<unique_ptr<Geometry>> because C++11
999 // forbids that construct:
1000 // http://lwg.github.com/issues/lwg-closed.html#2068
1001 struct GeomPtrPair {
1002  typedef std::unique_ptr<Geometry> GeomPtr;
1003  GeomPtr first;
1004  GeomPtr second;
1005 };
1006 
1007 } // namespace geos::geom
1008 } // namespace geos
1009 
1010 #ifdef _MSC_VER
1011 #pragma warning(pop)
1012 #endif
1013 
geos::geom::Geometry::ConstVect
std::vector< const Geometry * > ConstVect
A vector of const Geometry pointers.
Definition: Geometry.h:193
geos::geom::Geometry::apply_rw
virtual void apply_rw(CoordinateSequenceFilter &filter)=0
geos::geom::Geometry::isSimple
virtual bool isSimple() const
Returns false if the Geometry not simple.
geos::geom::Geometry::buffer
std::unique_ptr< Geometry > buffer(double distance) const
geos::geom::Geometry::reverse
std::unique_ptr< Geometry > reverse() const
Computes a new geometry which has all component coordinate sequences in reverse order (opposite orien...
Definition: Geometry.h:673
geos::geom::Geometry::contains
virtual bool contains(const Geometry *g) const
Returns true if other.within(this) returns true.
geos::geom::Geometry::cloneImpl
virtual Geometry * cloneImpl() const =0
Make a deep-copy of this Geometry.
geos::geom::Geometry::getInteriorPoint
std::unique_ptr< Point > getInteriorPoint() const
Computes an interior point of this Geometry.
geos::geom::Geometry::hasNullElements
static bool hasNullElements(const std::vector< T > *geometries)
Returns true if the vector contains any null elements.
Definition: Geometry.h:898
geos::geom::Geometry::getDimension
virtual Dimension::DimensionType getDimension() const =0
Returns the dimension of this Geometry (0=point, 1=line, 2=surface)
geos::geom::Dimension::A
@ A
Dimension value of a surface (2).
Definition: Dimension.h:46
geos::geom::Geometry::isEquivalentClass
virtual bool isEquivalentClass(const Geometry *other) const
Returns whether the two Geometrys are equal, from the point of view of the equalsExact method.
geos::geom::Geometry::getLength
virtual double getLength() const
Returns the length of this Geometry.
geos::geom::PrecisionModel
Specifies the precision model of the Coordinate in a Geometry.
Definition: PrecisionModel.h:90
geos::geom::Geometry::getCoordinate
virtual const CoordinateXY * getCoordinate() const =0
Returns a vertex of this Geometry, or NULL if this is the empty geometry.
geos::geom::Geometry::buffer
std::unique_ptr< Geometry > buffer(double distance, int quadrantSegments, int endCapStyle) const
Computes a buffer area around this geometry having the given width and with a specified accuracy of a...
geos::geom::Geometry::getEnvelopeInternal
virtual const Envelope * getEnvelopeInternal() const =0
Returns the minimum and maximum x and y values in this Geometry, or a null Envelope if this Geometry ...
geos
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25
geos::geom::GeometryComponentFilter
Definition: GeometryComponentFilter.h:41
geos::geom::Geometry::isEmpty
virtual bool isEmpty() const =0
Returns whether or not the set of points in this Geometry is empty.
geos::geom::Geometry::intersects
virtual bool intersects(const Geometry *g) const
Returns true if disjoint returns false.
geos::geom::Geometry::hasNullElements
static bool hasNullElements(const CoordinateSequence *list)
Returns true if the CoordinateSequence contains any null elements.
geos::geom::GEOS_POLYGON
@ GEOS_POLYGON
a polygon
Definition: Geometry.h:81
geos::geom::GEOS_LINESTRING
@ GEOS_LINESTRING
a linestring
Definition: Geometry.h:77
geos::geom::Geometry::Ptr
std::unique_ptr< Geometry > Ptr
An unique_ptr of Geometry.
Definition: Geometry.h:199
geos::geom::Geometry::getNumGeometries
virtual std::size_t getNumGeometries() const
Definition: Geometry.h:308
geos::geom::Geometry::isDimensionStrict
virtual bool isDimensionStrict(Dimension::DimensionType d) const
Checks whether this Geometry consists only of components having dimension d.
Definition: Geometry.h:351
geos::geom::Geometry::relate
std::unique_ptr< IntersectionMatrix > relate(const Geometry *g) const
Returns the DE-9IM intersection matrix for the two Geometrys.
geos::geom::Geometry::getGeometryN
virtual const Geometry * getGeometryN(std::size_t) const
Returns a pointer to the nth Geometry in this collection (or self if this is not a collection)
Definition: Geometry.h:316
geos::geom::Geometry::geometryChangedAction
virtual void geometryChangedAction()=0
Notifies this Geometry that its Coordinates have been changed by an external party.
geos::geom::GEOS_MULTIPOLYGON
@ GEOS_MULTIPOLYGON
a collection of polygons
Definition: Geometry.h:87
geos::geom::Geometry::isWithinDistance
virtual bool isWithinDistance(const Geometry *geom, double cDistance) const
Tests whether the distance from this Geometry to another is less than or equal to a specified value.
geos::geom::Geometry::hasDimension
virtual bool hasDimension(Dimension::DimensionType d) const
Checks whether any component of this geometry has dimension d.
Definition: Geometry.h:346
geos::geom::Geometry::setSRID
virtual void setSRID(int newSRID)
Sets the ID of the Spatial Reference System used by the Geometry.
Definition: Geometry.h:272
geos::geom::Geometry::intersection
std::unique_ptr< Geometry > intersection(const Geometry *other) const
Returns a Geometry representing the points shared by this Geometry and other.
geos::geom::Geometry::getBoundary
virtual std::unique_ptr< Geometry > getBoundary() const =0
Returns the boundary, or an empty geometry of appropriate dimension if this Geometry is empty.
geos::geom::GEOS_LINEARRING
@ GEOS_LINEARRING
a linear ring (linestring with 1st point == last point)
Definition: Geometry.h:79
geos::geom::Geometry::isRectangle
virtual bool isRectangle() const
Polygon overrides to check for actual rectangle.
Definition: Geometry.h:337
geos::geom::Geometry::touches
virtual bool touches(const Geometry *other) const
Returns true if the DE-9IM intersection matrix for the two Geometrys is FT*******,...
geos::geom::Dimension::DimensionType
DimensionType
Definition: Dimension.h:29
geos::geom::Geometry::getArea
virtual double getArea() const
Returns the area of this Geometry.
geos::geom::Geometry::toString
virtual std::string toString() const
Returns the Well-known Text representation of this Geometry.
geos::geom::Geometry::within
virtual bool within(const Geometry *g) const
Returns true if the DE-9IM intersection matrix for the two Geometrys is T*F**F***.
geos::geom::Geometry::crosses
virtual bool crosses(const Geometry *g) const
geos::geom::GEOS_POINT
@ GEOS_POINT
a point
Definition: Geometry.h:75
geos::geom::Geometry::hasNonEmptyElements
static bool hasNonEmptyElements(const std::vector< T > *geometries)
Returns true if the array contains any non-empty Geometrys.
Definition: Geometry.h:889
geos::geom::Geometry::equals
virtual bool equals(const Geometry *g) const
Returns true if the DE-9IM intersection matrix for the two Geometrys is T*F**FFF*.
geos::geom::Geometry
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:186
geos::geom::Geometry::applyComponentFilter
void applyComponentFilter(T &f) const
Apply a filter to each component of this geometry. The filter is expected to provide a ....
Definition: Geometry.h:792
geos::geom::Geometry::Geometry
Geometry(const GeometryFactory *factory)
Construct a geometry with the given GeometryFactory.
geos::geom::Geometry::coveredBy
bool coveredBy(const Geometry *g) const
Tests whether this geometry is covered by the specified geometry.
Definition: Geometry.h:597
geos::geom::Dimension::L
@ L
Dimension value of a curve (1).
Definition: Dimension.h:43
geos::geom::Geometry::getPrecisionModel
const PrecisionModel * getPrecisionModel() const
Get the PrecisionModel used to create this Geometry.
geos::geom::GEOS_GEOMETRYCOLLECTION
@ GEOS_GEOMETRYCOLLECTION
a collection of heterogeneus geometries
Definition: Geometry.h:89
geos::geom::Geometry::getCoordinateDimension
virtual uint8_t getCoordinateDimension() const =0
Returns the coordinate dimension of this Geometry (2=XY, 3=XYZ or XYM, 4=XYZM).
geos::geom::Geometry::buffer
std::unique_ptr< Geometry > buffer(double distance, int quadrantSegments) const
Returns a buffer region around this Geometry having the given width and with a specified number of se...
geos::geom::CoordinateSequence
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:56
geos::geom::Geometry::normalize
virtual void normalize()=0
geos::geom::CoordinateSequenceFilter
Interface for classes which provide operations that can be applied to the coordinates in a Coordinate...
Definition: CoordinateSequenceFilter.h:55
geos::geom::Geometry::disjoint
virtual bool disjoint(const Geometry *other) const
geos::geom::Geometry::getCoordinates
virtual std::unique_ptr< CoordinateSequence > getCoordinates() const =0
Returns this Geometry vertices. Caller takes ownership of the returned object.
geos::geom::GEOS_MULTILINESTRING
@ GEOS_MULTILINESTRING
a collection of linestrings
Definition: Geometry.h:85
geos::geom::Geometry::getGeometryTypeId
virtual GeometryTypeId getGeometryTypeId() const =0
Return an integer representation of this Geometry type.
geos::geom::Geometry::difference
std::unique_ptr< Geometry > difference(const Geometry *other) const
Returns a Geometry representing the points making up this Geometry that do not make up other.
geos::geom::Geometry::convexHull
virtual std::unique_ptr< Geometry > convexHull() const
Returns the smallest convex Polygon that contains all the points in the Geometry.
geos::geom::Geometry::getFactory
const GeometryFactory * getFactory() const
Gets the factory which contains the context in which this geometry was created.
Definition: Geometry.h:216
geos::geom::Geometry::getEnvelope
virtual std::unique_ptr< Geometry > getEnvelope() const
Returns this Geometrys bounding box.
geos::geom::Geometry::distance
virtual double distance(const Geometry *g) const
geos::geom::Geometry::getBoundaryDimension
virtual int getBoundaryDimension() const =0
Returns the dimension of this Geometrys inherent boundary.
geos::geom::Geometry::compareTo
virtual int compareTo(const Geometry *geom) const
Comparator for sorting geometry.
geos::geom::Geometry::equalsExact
virtual bool equalsExact(const Geometry *other, double tolerance=0) const =0
Returns true iff the two Geometrys are of the same type and their vertices corresponding by index are...
geos::geom::Geometry::getCentroid
virtual bool getCentroid(CoordinateXY &ret) const
Computes the centroid of this Geometry as a Coordinate.
geos::geom::Geometry::overlaps
virtual bool overlaps(const Geometry *g) const
Returns true if the DE-9IM intersection matrix for the two Geometrys is T*T***T** (for two points or ...
geos::geom::Dimension::P
@ P
Dimension value of a point (0).
Definition: Dimension.h:40
geos::geom::Envelope
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition: Envelope.h:58
geos::geom::GeometryTypeId
GeometryTypeId
Geometry types.
Definition: Geometry.h:73
geos::geom::Geometry::symDifference
std::unique_ptr< Geometry > symDifference(const Geometry *other) const
Returns a set combining the points in this Geometry not in other, and the points in other not in this...
geos::geom::CoordinateFilter
Geometry classes support the concept of applying a coordinate filter to every coordinate in the Geome...
Definition: CoordinateFilter.h:43
geos::geom::Geometry::getNumPoints
virtual std::size_t getNumPoints() const =0
Returns the count of this Geometrys vertices.
geos::geom::GeometryFactory
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:65
geos::geom::Geometry::getSRID
virtual int getSRID() const
Returns the ID of the Spatial Reference System used by the Geometry.
Definition: Geometry.h:263
geos::geom::Geometry::getUserData
void * getUserData() const
Gets the user data object for this geometry, if any.
Definition: Geometry.h:247
geos::geom::Geometry::getCentroid
virtual std::unique_ptr< Point > getCentroid() const
Computes the centroid of this Geometry.
geos::geom::Geometry::setUserData
void setUserData(void *newUserData)
A simple scheme for applications to add their own custom data to a Geometry. An example use might be ...
Definition: Geometry.h:235
geos::geom::GeometryFilter
Geometry classes support the concept of applying a Geometry filter to the Geometry.
Definition: GeometryFilter.h:45
geos::geom::Geometry::apply_ro
virtual void apply_ro(CoordinateSequenceFilter &filter) const =0
geos::geom::Geometry::covers
bool covers(const Geometry *g) const
Returns true if this geometry covers the specified geometry.
geos::geom::Geometry::Union
std::unique_ptr< Geometry > Union(const Geometry *other) const
Returns a Geometry representing all the points in this Geometry and other.
geos::geom::GEOS_MULTIPOINT
@ GEOS_MULTIPOINT
a collection of points
Definition: Geometry.h:83
geos::geom::geosversion
std::string geosversion()
Return current GEOS version.
geos::geom::Geometry::NonConstVect
std::vector< Geometry * > NonConstVect
A vector of non-const Geometry pointers.
Definition: Geometry.h:196
geos::geom::Geometry::Union
Ptr Union() const
Computes the union of all the elements of this geometry. Heterogeneous GeometryCollections are fully ...
geos::geom::Geometry::clone
std::unique_ptr< Geometry > clone() const
Make a deep-copy of this Geometry.
Definition: Geometry.h:202
geos::geom::Geometry::geometryChanged
virtual void geometryChanged()
Notifies this Geometry that its Coordinates have been changed by an external party (using a Coordinat...
geos::geom::Geometry::reverseImpl
virtual Geometry * reverseImpl() const =0
Make a geometry with coordinates in reverse order.
geos::geom::Geometry::~Geometry
virtual ~Geometry()
Destroy Geometry and all components.
geos::geom::Geometry::equalsIdentical
virtual bool equalsIdentical(const Geometry *other) const =0
Returns true if the two geometries are of the same type and their vertices corresponding by index are...
geos::geom::Geometry::isValid
virtual bool isValid() const
Tests the validity of this Geometry.
geos::geom::Geometry::getGeometryType
virtual std::string getGeometryType() const =0
Return a string representation of this Geometry type.
geos::geom::jtsport
std::string jtsport()
Return the version of JTS this GEOS release has been ported from.
geos::geom::Geometry::relate
bool relate(const Geometry *g, const std::string &intersectionPattern) const
Returns true if the elements in the DE-9IM intersection matrix for the two Geometrys match the elemen...