|
GEOS 3.15.1
|
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geometry objects. More...
#include <GeometryFactory.h>
Public Types | |
| using | Ptr = std::unique_ptr<GeometryFactory, GeometryFactoryDeleter> |
Public Member Functions | |
| std::unique_ptr< Geometry > | toGeometry (const Envelope *envelope) const |
| const PrecisionModel * | getPrecisionModel () const |
| Returns the PrecisionModel that Geometries created by this factory will be associated with. | |
| std::unique_ptr< Point > | createPoint (std::size_t coordinateDimension=2) const |
| Creates an EMPTY Point. | |
| std::unique_ptr< Point > | createPoint (bool hasZ, bool hasM) const |
| std::unique_ptr< Point > | createPoint (const Coordinate &coordinate) const |
| Creates a Point using the given Coordinate. | |
| std::unique_ptr< Point > | createPoint (const CoordinateXY &coordinate) const |
| std::unique_ptr< Point > | createPoint (const CoordinateXYM &coordinate) const |
| std::unique_ptr< Point > | createPoint (const CoordinateXYZM &coordinate) const |
| std::unique_ptr< Point > | createPoint (std::unique_ptr< CoordinateSequence > &&coordinates) const |
| Creates a Point taking ownership of the given CoordinateSequence. | |
| std::unique_ptr< Point > | createPoint (const CoordinateSequence &coordinates) const |
| Creates a Point with a deep-copy of the given CoordinateSequence. | |
| std::unique_ptr< GeometryCollection > | createGeometryCollection () const |
| Construct an EMPTY GeometryCollection. | |
| std::unique_ptr< Geometry > | createEmptyGeometry (GeometryTypeId type=GEOS_GEOMETRYCOLLECTION, bool hasZ=false, bool hasM=false) const |
| Construct the EMPTY Geometry. | |
| template<typename T> | |
| std::unique_ptr< GeometryCollection > | createGeometryCollection (std::vector< std::unique_ptr< T > > &&newGeoms) const |
| Construct a GeometryCollection taking ownership of given arguments. | |
| std::unique_ptr< GeometryCollection > | createGeometryCollection (const std::vector< const Geometry * > &newGeoms) const |
| Constructs a GeometryCollection with a deep-copy of args. | |
| std::unique_ptr< MultiLineString > | createMultiLineString () const |
| Construct an EMPTY MultiLineString. | |
| std::unique_ptr< MultiLineString > | createMultiLineString (const std::vector< const Geometry * > &fromLines) const |
| Construct a MultiLineString with a deep-copy of given arguments. | |
| std::unique_ptr< MultiLineString > | createMultiLineString (std::vector< std::unique_ptr< LineString > > &&fromLines) const |
| Construct a MultiLineString taking ownership of given arguments. | |
| std::unique_ptr< MultiLineString > | createMultiLineString (std::vector< std::unique_ptr< Curve > > &&fromLines) const |
| std::unique_ptr< MultiLineString > | createMultiLineString (std::vector< std::unique_ptr< Geometry > > &&fromLines) const |
| std::unique_ptr< MultiCurve > | createMultiCurve () const |
| Construct an EMPTY MultiCurve. | |
| std::unique_ptr< MultiCurve > | createMultiCurve (const std::vector< const Geometry * > &from) const |
| Construct a MultiCurve with a deep-copy of given arguments. | |
| std::unique_ptr< MultiCurve > | createMultiCurve (std::vector< std::unique_ptr< Geometry > > &&fromCurves) const |
| Construct a MultiCurve taking ownership of given arguments. | |
| std::unique_ptr< MultiCurve > | createMultiCurve (std::vector< std::unique_ptr< Curve > > &&fromCurves) const |
| std::unique_ptr< MultiPolygon > | createMultiPolygon () const |
| Construct an EMPTY MultiPolygon. | |
| std::unique_ptr< MultiPolygon > | createMultiPolygon (const std::vector< const Geometry * > &fromPolys) const |
| Construct a MultiPolygon with a deep-copy of given arguments. | |
| std::unique_ptr< MultiPolygon > | createMultiPolygon (std::vector< std::unique_ptr< Polygon > > &&fromPolys) const |
| Construct a MultiPolygon taking ownership of given arguments. | |
| std::unique_ptr< MultiPolygon > | createMultiPolygon (std::vector< std::unique_ptr< Geometry > > &&fromPolys) const |
| std::unique_ptr< MultiSurface > | createMultiSurface () const |
| Construct an EMPTY MultiSurface. | |
| std::unique_ptr< MultiSurface > | createMultiSurface (const std::vector< const Geometry * > &from) const |
| Construct a MultiSurface with a deep-copy of given arguments. | |
| std::unique_ptr< MultiSurface > | createMultiSurface (std::vector< std::unique_ptr< Geometry > > &&from) const |
| Construct a MultiSurface taking ownership of given arguments. | |
| std::unique_ptr< MultiSurface > | createMultiSurface (std::vector< std::unique_ptr< Surface > > &&from) const |
| std::unique_ptr< LinearRing > | createLinearRing (std::size_t coordinateDimension=2) const |
| Construct an EMPTY LinearRing. | |
| std::unique_ptr< LinearRing > | createLinearRing (bool hasZ, bool hasM) const |
| std::unique_ptr< LinearRing > | createLinearRing (std::unique_ptr< CoordinateSequence > &&newCoords) const |
| Construct a LinearRing taking ownership of given arguments. | |
| std::unique_ptr< LinearRing > | createLinearRing (const std::shared_ptr< const CoordinateSequence > &newCoords) const |
| std::unique_ptr< LinearRing > | createLinearRing (const CoordinateSequence &coordinates) const |
| Construct a LinearRing with a deep-copy of given arguments. | |
| std::unique_ptr< MultiPoint > | createMultiPoint () const |
Constructs an EMPTY MultiPoint. | |
| template<typename T> | |
| std::unique_ptr< MultiPoint > | createMultiPoint (const T &fromCoords) const |
| std::unique_ptr< MultiPoint > | createMultiPoint (std::vector< std::unique_ptr< Point > > &&newPoints) const |
| Construct a MultiPoint taking ownership of given arguments. | |
| std::unique_ptr< MultiPoint > | createMultiPoint (std::vector< std::unique_ptr< Geometry > > &&newPoints) const |
| std::unique_ptr< MultiPoint > | createMultiPoint (const std::vector< const Geometry * > &fromPoints) const |
| Construct a MultiPoint with a deep-copy of given arguments. | |
| std::unique_ptr< MultiPoint > | createMultiPoint (const CoordinateSequence &fromCoords) const |
| Construct a MultiPoint containing a Point geometry for each Coordinate in the given list. | |
| std::unique_ptr< Polygon > | createPolygon (std::size_t coordinateDimension=2) const |
| Construct an EMPTY Polygon. | |
| std::unique_ptr< Polygon > | createPolygon (bool hasZ, bool hasM) const |
| std::unique_ptr< Polygon > | createPolygon (std::unique_ptr< LinearRing > &&shell) const |
| Construct a Polygon taking ownership of given arguments. | |
| std::unique_ptr< Polygon > | createPolygon (std::unique_ptr< LinearRing > &&shell, std::vector< std::unique_ptr< LinearRing > > &&holes) const |
| std::unique_ptr< Polygon > | createPolygon (CoordinateSequence &&coords) const |
| Construct a Polygon from a Coordinate vector, taking ownership of the vector. | |
| Polygon * | createPolygon (const LinearRing &shell, const std::vector< LinearRing * > &holes) const |
| Construct a Polygon with a deep-copy of given arguments. | |
| std::unique_ptr< CurvePolygon > | createCurvePolygon (bool hasZ, bool hasM) const |
| Construct an EMPTY CurvePolygon. | |
| std::unique_ptr< CurvePolygon > | createCurvePolygon (std::unique_ptr< Curve > &&shell) const |
| Construct a CurvePolygon taking ownership of given arguments. | |
| std::unique_ptr< CurvePolygon > | createCurvePolygon (std::unique_ptr< Curve > &&shell, std::vector< std::unique_ptr< Curve > > &&holes) const |
| std::unique_ptr< Surface > | createSurface (std::unique_ptr< Curve > &&shell) const |
| std::unique_ptr< Surface > | createSurface (std::unique_ptr< Curve > &&shell, std::vector< std::unique_ptr< Curve > > &&holes) const |
| std::unique_ptr< LineString > | createLineString (std::size_t coordinateDimension=2) const |
| Construct an EMPTY LineString. | |
| std::unique_ptr< LineString > | createLineString (bool hasZ, bool hasM) const |
| std::unique_ptr< LineString > | createLineString (const LineString &ls) const |
| Copy a LineString. | |
| std::unique_ptr< LineString > | createLineString (std::unique_ptr< CoordinateSequence > &&coordinates) const |
| Construct a LineString taking ownership of given argument. | |
| std::unique_ptr< LineString > | createLineString (const CoordinateSequence &coordinates) const |
| Construct a LineString with a deep-copy of given argument. | |
| std::unique_ptr< LineString > | createLineString (const std::shared_ptr< const CoordinateSequence > &) const |
| Construct a LineString with a reference to shared coordinates. | |
| std::unique_ptr< CircularString > | createCircularString (bool hasZ, bool hasM) const |
| Construct an EMPTY CircularString. | |
| std::unique_ptr< CircularString > | createCircularString (const CircularString &ls) const |
| Copy a CircularString. | |
| std::unique_ptr< CircularString > | createCircularString (std::unique_ptr< CoordinateSequence > &&coordinates) const |
| Construct a CircularString taking ownership of given argument. | |
| std::unique_ptr< CircularString > | createCircularString (const std::shared_ptr< const CoordinateSequence > &coordinates) const |
| Construct a CircularStrign with a reference to shared coordinates. | |
| std::unique_ptr< CircularString > | createCircularString (const CoordinateSequence &coordinates) const |
| Construct a CircularString with a deep-copy of given argument. | |
| std::unique_ptr< CompoundCurve > | createCompoundCurve () const |
| Construct an EMPTY CompoundCurve. | |
| std::unique_ptr< CompoundCurve > | createCompoundCurve (std::vector< std::unique_ptr< SimpleCurve > > &&) const |
| Construct a CompoundCurve taking ownership of given argument. | |
| std::unique_ptr< Geometry > | createEmpty (int dimension) const |
| std::unique_ptr< Geometry > | createEmpty (GeometryTypeId typeId) const |
| std::unique_ptr< Geometry > | createMulti (std::unique_ptr< Geometry > &&geom) const |
| std::unique_ptr< Geometry > | buildGeometry (std::vector< std::unique_ptr< Geometry > > &&geoms) const |
| std::unique_ptr< Geometry > | buildGeometry (std::vector< std::unique_ptr< Point > > &&geoms) const |
| std::unique_ptr< Geometry > | buildGeometry (std::vector< std::unique_ptr< LineString > > &&geoms) const |
| std::unique_ptr< Geometry > | buildGeometry (std::vector< std::unique_ptr< Polygon > > &&geoms) const |
| std::unique_ptr< Geometry > | buildGeometry (std::vector< std::unique_ptr< Curve > > &&geoms) const |
| template<class T> | |
| std::unique_ptr< Geometry > | buildGeometry (T from, T toofar) const |
| See buildGeometry(std::vector<Geometry *>&) for semantics. | |
| std::unique_ptr< Geometry > | buildGeometry (const std::vector< const Geometry * > &geoms) const |
| This function does the same thing of the omonimouse function taking vector pointer instead of reference. | |
| int | getSRID () const |
| std::unique_ptr< Geometry > | createGeometry (const Geometry *g) const |
| Returns a clone of given Geometry. | |
| void | destroyGeometry (Geometry *g) const |
| Destroy a Geometry, or release it. | |
| void | destroy () |
Static Public Member Functions | |
| static GeometryFactory::Ptr | create () |
| Constructs a GeometryFactory that generates Geometries having a floating PrecisionModel and a spatial-reference ID of 0. | |
| static GeometryFactory::Ptr | create (const PrecisionModel *pm) |
| Constructs a GeometryFactory that generates Geometries having the given PrecisionModel and the default CoordinateSequence implementation. | |
| static GeometryFactory::Ptr | create (const PrecisionModel *pm, int newSRID) |
Constructs a GeometryFactory that generates Geometries having the given PrecisionModel and spatial-reference ID, and the default CoordinateSequence implementation. | |
| static GeometryFactory::Ptr | create (const GeometryFactory &gf) |
| Copy constructor. | |
| static const GeometryFactory * | getDefaultInstance () |
| Return a pointer to the default GeometryFactory. This is a global shared object instantiated using default constructor. | |
| static std::unique_ptr< Point > | createPointFromInternalCoord (const Coordinate *coord, const Geometry *exemplar) |
Protected Member Functions | |
| GeometryFactory () | |
| Constructs a GeometryFactory that generates Geometries having a floating PrecisionModel and a spatial-reference ID of 0. | |
| GeometryFactory (const PrecisionModel *pm) | |
| Constructs a GeometryFactory that generates Geometries having the given PrecisionModel and the default CoordinateSequence implementation. | |
| GeometryFactory (const PrecisionModel *pm, int newSRID) | |
Constructs a GeometryFactory that generates Geometries having the given PrecisionModel and spatial-reference ID, and the default CoordinateSequence implementation. | |
| GeometryFactory (const GeometryFactory &gf) | |
| Copy constructor. | |
| virtual | ~GeometryFactory () |
| Destructor. | |
Friends | |
| class | Geometry |
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geometry objects.
Note that the factory constructor methods do not change the input coordinates in any way. In particular, they are not rounded to the supplied PrecisionModel. It is assumed that input Coordinates meet the given precision.
|
protected |
Constructs a GeometryFactory that generates Geometries having a floating PrecisionModel and a spatial-reference ID of 0.
Referenced by create(), and GeometryFactory().
|
protected |
Constructs a GeometryFactory that generates Geometries having the given PrecisionModel and the default CoordinateSequence implementation.
| pm | the PrecisionModel to use |
|
protected |
Constructs a GeometryFactory that generates Geometries having the given PrecisionModel and spatial-reference ID, and the default CoordinateSequence implementation.
| pm | the PrecisionModel to use, will be copied internally |
| newSRID | the SRID to use |
|
protected |
| std::unique_ptr< Geometry > geos::geom::GeometryFactory::buildGeometry | ( | const std::vector< const Geometry * > & | geoms | ) | const |
This function does the same thing of the omonimouse function taking vector pointer instead of reference.
The difference is that this version will copy needed data leaving ownership to the caller.
| std::unique_ptr< Geometry > geos::geom::GeometryFactory::buildGeometry | ( | std::vector< std::unique_ptr< Geometry > > && | geoms | ) | const |
Build an appropriate Geometry, MultiGeometry, or GeometryCollection to contain the Geometrys in it.
For example:
geomList contains a single Polygon, the Polygon is returned.geomList contains several Polygons, a MultiPolygon is returned.geomList contains some Polygons and some LineStrings, a GeometryCollection is returned.geomList is empty, an empty GeometryCollection is returnedNote that this method does not "flatten" Geometries in the input, and hence if any MultiGeometries are contained in the input a GeometryCollection containing them will be returned.
| geoms | the Geometrys to combine |
Geometry of the "smallest", "most type-specific" class that can contain the elements of geomList.NOTE: the returned Geometry will take ownership of the given vector AND its elements
References buildGeometry().
Referenced by buildGeometry(), and buildGeometry().
|
inline |
See buildGeometry(std::vector<Geometry *>&) for semantics.
Will clone the geometries accessible through the iterator.
| T | an iterator yielding something which casts to const Geometry* |
| from | start iterator |
| toofar | end iterator |
References buildGeometry().
|
static |
|
static |
Constructs a GeometryFactory that generates Geometries having the given PrecisionModel and the default CoordinateSequence implementation.
| pm | the PrecisionModel to use |
|
static |
Constructs a GeometryFactory that generates Geometries having the given PrecisionModel and spatial-reference ID, and the default CoordinateSequence implementation.
| pm | the PrecisionModel to use, will be copied internally |
| newSRID | the SRID to use |
| std::unique_ptr< CurvePolygon > geos::geom::GeometryFactory::createCurvePolygon | ( | bool | hasZ, |
| bool | hasM ) const |
Construct an EMPTY CurvePolygon.
Referenced by createCurvePolygon().
| std::unique_ptr< CurvePolygon > geos::geom::GeometryFactory::createCurvePolygon | ( | std::unique_ptr< Curve > && | shell | ) | const |
Construct a CurvePolygon taking ownership of given arguments.
References createCurvePolygon().
| std::unique_ptr< Geometry > geos::geom::GeometryFactory::createEmpty | ( | GeometryTypeId | typeId | ) | const |
Creates an empty atomic geometry of the given type.
| typeId | the desired GeometryTypeId |
| std::unique_ptr< Geometry > geos::geom::GeometryFactory::createEmpty | ( | int | dimension | ) | const |
Creates an empty atomic geometry of the given dimension. If passed a dimension of -1 will create an empty GeometryCollection.
| dimension | the required dimension (-1, 0, 1 or 2) |
| std::unique_ptr< Geometry > geos::geom::GeometryFactory::createEmptyGeometry | ( | GeometryTypeId | type = GEOS_GEOMETRYCOLLECTION, |
| bool | hasZ = false, | ||
| bool | hasM = false ) const |
Construct the EMPTY Geometry.
References geos::geom::GEOS_GEOMETRYCOLLECTION.
| std::unique_ptr< LinearRing > geos::geom::GeometryFactory::createLinearRing | ( | std::size_t | coordinateDimension = 2 | ) | const |
Construct an EMPTY LinearRing.
References createLinearRing().
Referenced by createLinearRing(), and createLinearRing().
| std::unique_ptr< LinearRing > geos::geom::GeometryFactory::createLinearRing | ( | std::unique_ptr< CoordinateSequence > && | newCoords | ) | const |
Construct a LinearRing taking ownership of given arguments.
References createLinearRing().
| std::unique_ptr< LineString > geos::geom::GeometryFactory::createLineString | ( | std::size_t | coordinateDimension = 2 | ) | const |
| std::unique_ptr< MultiCurve > geos::geom::GeometryFactory::createMultiCurve | ( | ) | const |
Construct an EMPTY MultiCurve.
Referenced by createMultiCurve().
| std::unique_ptr< MultiCurve > geos::geom::GeometryFactory::createMultiCurve | ( | std::vector< std::unique_ptr< Geometry > > && | fromCurves | ) | const |
Construct a MultiCurve taking ownership of given arguments.
References createMultiCurve().
| std::unique_ptr< MultiLineString > geos::geom::GeometryFactory::createMultiLineString | ( | ) | const |
Construct an EMPTY MultiLineString.
Referenced by createMultiLineString().
| std::unique_ptr< MultiLineString > geos::geom::GeometryFactory::createMultiLineString | ( | std::vector< std::unique_ptr< LineString > > && | fromLines | ) | const |
Construct a MultiLineString taking ownership of given arguments.
References createMultiLineString().
| std::unique_ptr< MultiPoint > geos::geom::GeometryFactory::createMultiPoint | ( | ) | const |
Constructs an EMPTY MultiPoint.
References createMultiPoint(), and createPoint().
Referenced by createMultiPoint(), and createMultiPoint().
| std::unique_ptr< MultiPoint > geos::geom::GeometryFactory::createMultiPoint | ( | std::vector< std::unique_ptr< Point > > && | newPoints | ) | const |
Construct a MultiPoint taking ownership of given arguments.
References createMultiPoint().
| std::unique_ptr< MultiPolygon > geos::geom::GeometryFactory::createMultiPolygon | ( | ) | const |
Construct an EMPTY MultiPolygon.
Referenced by createMultiPolygon().
| std::unique_ptr< MultiPolygon > geos::geom::GeometryFactory::createMultiPolygon | ( | std::vector< std::unique_ptr< Polygon > > && | fromPolys | ) | const |
Construct a MultiPolygon taking ownership of given arguments.
References createMultiPolygon().
| std::unique_ptr< MultiSurface > geos::geom::GeometryFactory::createMultiSurface | ( | ) | const |
Construct an EMPTY MultiSurface.
Referenced by createMultiSurface().
| std::unique_ptr< MultiSurface > geos::geom::GeometryFactory::createMultiSurface | ( | std::vector< std::unique_ptr< Geometry > > && | from | ) | const |
Construct a MultiSurface taking ownership of given arguments.
References createMultiSurface().
| std::unique_ptr< Point > geos::geom::GeometryFactory::createPoint | ( | const Coordinate & | coordinate | ) | const |
Creates a Point using the given Coordinate.
References createPoint().
| std::unique_ptr< Point > geos::geom::GeometryFactory::createPoint | ( | std::size_t | coordinateDimension = 2 | ) | const |
Creates an EMPTY Point.
References createPoint().
Referenced by createMultiPoint(), createPoint(), and createPoint().
| std::unique_ptr< Polygon > geos::geom::GeometryFactory::createPolygon | ( | std::size_t | coordinateDimension = 2 | ) | const |
Construct an EMPTY Polygon.
References createPolygon().
Referenced by createPolygon(), and createPolygon().
| std::unique_ptr< Polygon > geos::geom::GeometryFactory::createPolygon | ( | std::unique_ptr< LinearRing > && | shell | ) | const |
Construct a Polygon taking ownership of given arguments.
References createPolygon().
| std::unique_ptr< Surface > geos::geom::GeometryFactory::createSurface | ( | std::unique_ptr< Curve > && | shell | ) | const |
Construct a Surface, taking ownership of given arguments If arguments are LinearRings, a Polygon will be returned. Otherwise, a CurvePolygon will be returned.
References createSurface().
Referenced by createSurface().
| void geos::geom::GeometryFactory::destroy | ( | ) |
Request that the instance is deleted.
It will really be deleted only after last child Geometry is deleted. Do not use the instance anymore after calling this function (unless you're a live child!).
| std::unique_ptr< Geometry > geos::geom::GeometryFactory::toGeometry | ( | const Envelope * | envelope | ) | const |