21#ifndef GEOS_GEOM_GEOMETRY_H
22#define GEOS_GEOM_GEOMETRY_H
24#include <geos/export.h>
25#include <geos/platform.h>
26#include <geos/inline.h>
27#include <geos/geom/Envelope.h>
28#include <geos/geom/Dimension.h>
29#include <geos/geom/GeometryComponentFilter.h>
38#pragma warning(disable: 4251)
39#pragma warning(disable: 4355)
171 friend class GeometryFactory;
196 const GeometryFactory*
getFactory()
const {
return _factory; }
236 virtual int getSRID()
const {
return SRID; }
242 virtual void setSRID(
int newSRID) { SRID=newSRID; }
418 const std::string& intersectionPattern)
const;
420 bool relate(
const Geometry& g,
const std::string& intersectionPattern)
const
422 return relate(&g, intersectionPattern);
516 virtual std::string toText()
const;
570 int endCapStyle)
const;
720 double cDistance)
const;
756 virtual void geometryChanged();
790 static void checkNotGeometryCollection(
const Geometry *g);
797 virtual Envelope::AutoPtr computeEnvelopeInternal()
const=0;
799 virtual int compareToSameClass(
const Geometry *
geom)
const=0;
801 int compare(std::vector<Coordinate> a, std::vector<Coordinate> b)
const;
803 int compare(std::vector<Geometry *> a, std::vector<Geometry *> b)
const;
806 double tolerance)
const;
833 int getClassSortIndex()
const;
841 static GeometryChangedFilter geometryChangedFilter;
858struct GEOS_DLL GeometryGreaterThen {
877 typedef std::auto_ptr<Geometry> GeomPtr;
Definition CoordinateFilter.h:43
Definition CoordinateSequenceFilter.h:58
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:59
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:60
DimensionType
Definition Dimension.h:31
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition Envelope.h:53
Definition GeometryComponentFilter.h:43
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition GeometryFactory.h:67
Geometry classes support the concept of applying a Geometry filter to the Geometry.
Definition GeometryFilter.h:48
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:167
virtual Geometry * getEnvelope() const
Returns this Geometrys bounding box.
virtual int getBoundaryDimension() const =0
Returns the dimension of this Geometrys inherent boundary.
void applyComponentFilter(T &f) const
Apply a fiter to each component of this geometry. The filter is expected to provide a ....
Definition Geometry.h:685
virtual ~Geometry()
Destroy Geometry and all components.
virtual bool equals(const Geometry *g) const
Returns true if the DE-9IM intersection matrix for the two Geometrys is T*F**FFF*.
void geometryChangedAction()
Notifies this Geometry that its Coordinates have been changed by an external party.
virtual void apply_rw(CoordinateSequenceFilter &filter)=0
const PrecisionModel * getPrecisionModel() const
Get the PrecisionModel used to create this Geometry.
virtual bool equalsExact(const Geometry *other, double tolerance=0) const =0
Returns true if the two Geometrys are exactly equal, up to a specified tolerance.
virtual void normalize()=0
Converts this Geometry to normal form (or canonical form).
virtual void apply_ro(CoordinateSequenceFilter &filter) const =0
virtual bool intersects(const Geometry *g) const
Returns true if disjoint returns false.
virtual Geometry * getBoundary() const =0
Returns the boundary, or an empty geometry of appropriate dimension if this Geometry is empty.
virtual bool crosses(const Geometry *g) const
virtual GeometryTypeId getGeometryTypeId() const =0
Return an integer representation of this Geometry type.
virtual 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...
virtual std::string getGeometryType() const =0
Return a string representation of this Geometry type.
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.
static bool hasNonEmptyElements(const std::vector< Geometry * > *geometries)
Returns true if the array contains any non-empty Geometrys.
virtual double getLength() const
Returns the length of this Geometry.
virtual double distance(const Geometry *g) const
Returns the minimum distance between this Geometry and the Geometry g.
virtual CoordinateSequence * getCoordinates() const =0
Returns this Geometry vertices. Caller takes ownership of the returned object.
virtual bool getCentroid(Coordinate &ret) const
Computes the centroid of this Geometry as a Coordinate.
virtual const Geometry * getGeometryN(std::size_t) const
Definition Geometry.h:281
virtual Geometry * difference(const Geometry *other) const
Returns a Geometry representing the points making up this Geometry that do not make up other.
virtual Geometry * intersection(const Geometry *other) const
Returns a Geometry representing the points shared by this Geometry and other.
virtual bool within(const Geometry *g) const
Returns true if the DE-9IM intersection matrix for the two Geometrys is T*F**F***.
virtual std::size_t getNumPoints() const =0
Returns the count of this Geometrys vertices.
static bool hasNullElements(const CoordinateSequence *list)
Returns true if the CoordinateSequence contains any null elements.
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:211
virtual bool isEmpty() const =0
Returns whether or not the set of points in this Geometry is empty.
virtual Geometry * buffer(double distance) const
Returns a buffer region around this Geometry having the given width.
Geometry(const GeometryFactory *factory)
Construct a geometry with the given GeometryFactory.
const GeometryFactory * getFactory() const
Gets the factory which contains the context in which this geometry was created.
Definition Geometry.h:196
Geometry * Union(const Geometry *other) const
Returns a Geometry representing all the points in this Geometry and other.
virtual Point * getCentroid() const
Computes the centroid of this Geometry.
virtual bool touches(const Geometry *other) const
Returns true if the DE-9IM intersection matrix for the two Geometrys is FT*******,...
virtual const Coordinate * getCoordinate() const =0
Returns a vertex of this Geometry, or NULL if this is the empty geometry.
virtual IntersectionMatrix * relate(const Geometry *g) const
Returns the DE-9IM intersection matrix for the two Geometrys.
virtual std::string toString() const
Returns the Well-known Text representation of this Geometry.
virtual Geometry * clone() const =0
Make a deep-copy of this Geometry.
virtual bool isValid() const
Tests the validity of this Geometry.
virtual bool isSimple() const
Returns false if the Geometry not simple.
Geometry(const Geometry &geom)
Polygon overrides to check for actual rectangle.
void * getUserData() const
Gets the user data object for this geometry, if any.
Definition Geometry.h:219
virtual bool disjoint(const Geometry *other) const
virtual bool contains(const Geometry *g) const
Returns true if other.within(this) returns true.
virtual bool isEquivalentClass(const Geometry *other) const
Returns whether the two Geometrys are equal, from the point of view of the equalsExact method.
bool coveredBy(const Geometry *g) const
Tests whether this geometry is covered by the specified geometry.
Definition Geometry.h:508
virtual const Envelope * getEnvelopeInternal() const
Returns the minimum and maximum x and y values in this Geometry, or a null Envelope if this Geometry ...
virtual std::size_t getNumGeometries() const
Definition Geometry.h:277
virtual double getArea() const
Returns the area of this Geometry.
virtual Point * getInteriorPoint() const
Computes an interior point of this Geometry.
std::auto_ptr< Geometry > AutoPtr
An auto_ptr of Geometry.
Definition Geometry.h:180
virtual 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...
virtual int getCoordinateDimension() const =0
Returns the coordinate dimension of this Geometry (2=XY, 3=XYZ, 4=XYZM in future).
virtual Geometry * convexHull() const
Returns the smallest convex Polygon that contains all the points in the Geometry.
static bool hasNullElements(const std::vector< Geometry * > *lrs)
Returns true if the vector contains any null elements.
virtual bool isRectangle() const
Polygon overrides to check for actual rectangle.
Definition Geometry.h:298
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 ...
virtual 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...
bool covers(const Geometry *g) const
Returns true if this geometry covers the specified geometry.
virtual Dimension::DimensionType getDimension() const =0
Returns the dimension of this Geometry (0=point, 1=line, 2=surface).
std::vector< Geometry * > NonConstVect
A vector of non-const Geometry pointers.
Definition Geometry.h:177
std::auto_ptr< Envelope > envelope
The bounding box of this Geometry.
Definition Geometry.h:768
std::vector< const Geometry * > ConstVect
A vector of const Geometry pointers.
Definition Geometry.h:174
virtual 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...
Implementation of Dimensionally Extended Nine-Intersection Model (DE-9IM) matrix.
Definition IntersectionMatrix.h:51
Specifies the precision model of the Coordinate in a Geometry.
Definition PrecisionModel.h:87
Contains the Geometry interface hierarchy and supporting classes.
Definition IndexedNestedRingTester.h:26
GeometryTypeId
Geometry types.
Definition Geometry.h:65
@ GEOS_MULTILINESTRING
a collection of linestrings
Definition Geometry.h:77
@ GEOS_LINEARRING
a linear ring (linestring with 1st point == last point)
Definition Geometry.h:71
@ GEOS_GEOMETRYCOLLECTION
a collection of heterogeneus geometries
Definition Geometry.h:81
@ GEOS_POINT
a point
Definition Geometry.h:67
@ GEOS_LINESTRING
a linestring
Definition Geometry.h:69
@ GEOS_POLYGON
a polygon
Definition Geometry.h:73
@ GEOS_MULTIPOLYGON
a collection of polygons
Definition Geometry.h:79
@ GEOS_MULTIPOINT
a collection of points
Definition Geometry.h:75
GEOS_DLL std::ostream & operator<<(std::ostream &os, const Coordinate &c)
Output function.
std::string jtsport()
Return the version of JTS this GEOS release has been ported from.
std::string geosversion()
Return current GEOS version.
Contains the interfaces for converting JTS objects to and from other formats.
Definition Geometry.h:56
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:25