XS-libgeos
view release on metacpan or search on metacpan
geos-3.7.3/include/geos/geom/Geometry.h view on Meta::CPAN
/// a polygon
GEOS_POLYGON,
/// a collection of points
GEOS_MULTIPOINT,
/// a collection of linestrings
GEOS_MULTILINESTRING,
/// a collection of polygons
GEOS_MULTIPOLYGON,
/// a collection of heterogeneus geometries
GEOS_GEOMETRYCOLLECTION
};
/**
* \class Geometry geom.h geos.h
*
* \brief Basic implementation of Geometry, constructed and
* destructed by GeometryFactory.
*
* <code>clone</code> returns a deep copy of the object.
* Use GeometryFactory to construct.
*
* <H3>Binary Predicates</H3>
* Because it is not clear at this time
* what semantics for spatial
* analysis methods involving <code>GeometryCollection</code>s would be useful,
* <code>GeometryCollection</code>s are not supported as arguments to binary
* predicates (other than <code>convexHull</code>) or the <code>relate</code>
* method.
*
* <H3>Set-Theoretic Methods</H3>
*
* The spatial analysis methods will
* return the most specific class possible to represent the result. If the
* result is homogeneous, a <code>Point</code>, <code>LineString</code>, or
* <code>Polygon</code> will be returned if the result contains a single
* element; otherwise, a <code>MultiPoint</code>, <code>MultiLineString</code>,
* or <code>MultiPolygon</code> will be returned. If the result is
* heterogeneous a <code>GeometryCollection</code> will be returned. <P>
*
* Because it is not clear at this time what semantics for set-theoretic
* methods involving <code>GeometryCollection</code>s would be useful,
* <code>GeometryCollections</code>
* are not supported as arguments to the set-theoretic methods.
*
* <H4>Representation of Computed Geometries </H4>
*
* The SFS states that the result
* of a set-theoretic method is the "point-set" result of the usual
* set-theoretic definition of the operation (SFS 3.2.21.1). However, there are
* sometimes many ways of representing a point set as a <code>Geometry</code>.
* <P>
*
* The SFS does not specify an unambiguous representation of a given point set
* returned from a spatial analysis method. One goal of JTS is to make this
* specification precise and unambiguous. JTS will use a canonical form for
* <code>Geometry</code>s returned from spatial analysis methods. The canonical
* form is a <code>Geometry</code> which is simple and noded:
* <UL>
* <LI> Simple means that the Geometry returned will be simple according to
* the JTS definition of <code>isSimple</code>.
* <LI> Noded applies only to overlays involving <code>LineString</code>s. It
* means that all intersection points on <code>LineString</code>s will be
* present as endpoints of <code>LineString</code>s in the result.
* </UL>
* This definition implies that non-simple geometries which are arguments to
* spatial analysis methods must be subjected to a line-dissolve process to
* ensure that the results are simple.
*
* <H4> Constructed Points And The Precision Model </H4>
*
* The results computed by the set-theoretic methods may
* contain constructed points which are not present in the input Geometry.
* These new points arise from intersections between line segments in the
* edges of the input Geometry. In the general case it is not
* possible to represent constructed points exactly. This is due to the fact
* that the coordinates of an intersection point may contain twice as many bits
* of precision as the coordinates of the input line segments. In order to
* represent these constructed points explicitly, JTS must truncate them to fit
* the PrecisionModel.
*
* Unfortunately, truncating coordinates moves them slightly. Line segments
* which would not be coincident in the exact result may become coincident in
* the truncated representation. This in turn leads to "topology collapses" --
* situations where a computed element has a lower dimension than it would in
* the exact result.
*
* When JTS detects topology collapses during the computation of spatial
* analysis methods, it will throw an exception. If possible the exception will
* report the location of the collapse.
*
* equals(Object) and hashCode are not overridden, so that when two
* topologically equal Geometries are added to HashMaps and HashSets, they
* remain distinct. This behaviour is desired in many cases.
*
*/
class GEOS_DLL Geometry {
public:
friend class GeometryFactory;
/// A vector of const Geometry pointers
using ConstVect = std::vector<const Geometry *>;
/// A vector of non-const Geometry pointers
using NonConstVect = std::vector<Geometry *>;
/// An unique_ptr of Geometry
using Ptr = std::unique_ptr<Geometry> ;
/// Make a deep-copy of this Geometry
virtual Geometry* clone() const=0;
/// Destroy Geometry and all components
virtual ~Geometry();
/**
* \brief
* Gets the factory which contains the context in which this
* geometry was created.
( run in 0.737 second using v1.01-cache-2.11-cpan-ceb78f64989 )