GEOS
3.4.2
|
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geometry objects. More...
#include <GeometryFactory.h>
Public Member Functions | |
GeometryFactory () | |
Constructs a GeometryFactory that generates Geometries having a floating PrecisionModel and a spatial-reference ID of 0. | |
GeometryFactory (const PrecisionModel *pm, int newSRID, CoordinateSequenceFactory *nCoordinateSequenceFactory) | |
Constructs a GeometryFactory that generates Geometries having the given PrecisionModel, spatial-reference ID, and CoordinateSequence implementation. More... | |
GeometryFactory (CoordinateSequenceFactory *nCoordinateSequenceFactory) | |
Constructs a GeometryFactory that generates Geometries having the given CoordinateSequence implementation, a double-precision 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. More... | |
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. More... | |
GeometryFactory (const GeometryFactory &gf) | |
Copy constructor. More... | |
virtual | ~GeometryFactory () |
Destructor. | |
Point * | createPointFromInternalCoord (const Coordinate *coord, const Geometry *exemplar) const |
Geometry * | toGeometry (const Envelope *envelope) const |
Converts an Envelope to a Geometry. More... | |
const PrecisionModel * | getPrecisionModel () const |
Returns the PrecisionModel that Geometries created by this factory will be associated with. | |
Point * | createPoint () const |
Creates an EMPTY Point. | |
Point * | createPoint (const Coordinate &coordinate) const |
Creates a Point using the given Coordinate. | |
Point * | createPoint (CoordinateSequence *coordinates) const |
Creates a Point taking ownership of the given CoordinateSequence. | |
Point * | createPoint (const CoordinateSequence &coordinates) const |
Creates a Point with a deep-copy of the given CoordinateSequence. | |
GeometryCollection * | createGeometryCollection () const |
Construct an EMPTY GeometryCollection. | |
Geometry * | createEmptyGeometry () const |
Construct the EMPTY Geometry. | |
GeometryCollection * | createGeometryCollection (std::vector< Geometry * > *newGeoms) const |
Construct a GeometryCollection taking ownership of given arguments. | |
GeometryCollection * | createGeometryCollection (const std::vector< Geometry * > &newGeoms) const |
Constructs a GeometryCollection with a deep-copy of args. | |
MultiLineString * | createMultiLineString () const |
Construct an EMPTY MultiLineString. | |
MultiLineString * | createMultiLineString (std::vector< Geometry * > *newLines) const |
Construct a MultiLineString taking ownership of given arguments. | |
MultiLineString * | createMultiLineString (const std::vector< Geometry * > &fromLines) const |
Construct a MultiLineString with a deep-copy of given arguments. | |
MultiPolygon * | createMultiPolygon () const |
Construct an EMPTY MultiPolygon. | |
MultiPolygon * | createMultiPolygon (std::vector< Geometry * > *newPolys) const |
Construct a MultiPolygon taking ownership of given arguments. | |
MultiPolygon * | createMultiPolygon (const std::vector< Geometry * > &fromPolys) const |
Construct a MultiPolygon with a deep-copy of given arguments. | |
LinearRing * | createLinearRing () const |
Construct an EMPTY LinearRing. | |
LinearRing * | createLinearRing (CoordinateSequence *newCoords) const |
Construct a LinearRing taking ownership of given arguments. | |
std::auto_ptr< Geometry > | createLinearRing (std::auto_ptr< CoordinateSequence > newCoords) const |
LinearRing * | createLinearRing (const CoordinateSequence &coordinates) const |
Construct a LinearRing with a deep-copy of given arguments. | |
MultiPoint * | createMultiPoint () const |
Constructs an EMPTY MultiPoint . | |
MultiPoint * | createMultiPoint (std::vector< Geometry * > *newPoints) const |
Construct a MultiPoint taking ownership of given arguments. | |
MultiPoint * | createMultiPoint (const std::vector< Geometry * > &fromPoints) const |
Construct a MultiPoint with a deep-copy of given arguments. | |
MultiPoint * | createMultiPoint (const CoordinateSequence &fromCoords) const |
Construct a MultiPoint containing a Point geometry for each Coordinate in the given list. | |
MultiPoint * | createMultiPoint (const std::vector< Coordinate > &fromCoords) const |
Construct a MultiPoint containing a Point geometry for each Coordinate in the given vector. | |
Polygon * | createPolygon () const |
Construct an EMPTY Polygon. | |
Polygon * | createPolygon (LinearRing *shell, std::vector< Geometry * > *holes) const |
Construct a Polygon taking ownership of given arguments. | |
Polygon * | createPolygon (const LinearRing &shell, const std::vector< Geometry * > &holes) const |
Construct a Polygon with a deep-copy of given arguments. | |
LineString * | createLineString () const |
Construct an EMPTY LineString. | |
std::auto_ptr< LineString > | createLineString (const LineString &ls) const |
Copy a LineString. | |
LineString * | createLineString (CoordinateSequence *coordinates) const |
Construct a LineString taking ownership of given argument. | |
std::auto_ptr< Geometry > | createLineString (std::auto_ptr< CoordinateSequence > coordinates) const |
LineString * | createLineString (const CoordinateSequence &coordinates) const |
Construct a LineString with a deep-copy of given argument. | |
Geometry * | buildGeometry (std::vector< Geometry * > *geoms) const |
template<class T > | |
std::auto_ptr< Geometry > | buildGeometry (T from, T toofar) const |
See buildGeometry(std::vector<Geometry *>&) for semantics. More... | |
Geometry * | buildGeometry (const std::vector< Geometry * > &geoms) const |
This function does the same thing of the omonimouse function taking vector pointer instead of reference. More... | |
int | getSRID () const |
const CoordinateSequenceFactory * | getCoordinateSequenceFactory () const |
Returns the CoordinateSequenceFactory associated with this GeometryFactory. | |
Geometry * | createGeometry (const Geometry *g) const |
Returns a clone of given Geometry. | |
void | destroyGeometry (Geometry *g) const |
Destroy a Geometry, or release it. | |
Static Public Member Functions | |
static const GeometryFactory * | getDefaultInstance () |
Return a pointer to the default GeometryFactory. This is a global shared object instantiated using default constructor. | |
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.
geos::geom::GeometryFactory::GeometryFactory | ( | const PrecisionModel * | pm, |
int | newSRID, | ||
CoordinateSequenceFactory * | nCoordinateSequenceFactory | ||
) |
Constructs a GeometryFactory that generates Geometries having the given PrecisionModel, spatial-reference ID, and CoordinateSequence implementation.
NOTES: (1) the given PrecisionModel is COPIED (2) the CoordinateSequenceFactory is NOT COPIED and must be available for the whole lifetime of the GeometryFactory
geos::geom::GeometryFactory::GeometryFactory | ( | const PrecisionModel * | pm | ) |
Constructs a GeometryFactory that generates Geometries having the given PrecisionModel and the default CoordinateSequence implementation.
pm | the PrecisionModel to use |
geos::geom::GeometryFactory::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.
pm | the PrecisionModel to use |
newSRID | the SRID to use |
geos::geom::GeometryFactory::GeometryFactory | ( | const GeometryFactory & | gf | ) |
Copy constructor.
gf | the GeometryFactory to clone from |
Build an appropriate Geometry
, MultiGeometry
, or GeometryCollection
to contain the Geometry
s in it.
For example:
geomList
contains a single Polygon
, the Polygon
is returned.geomList
contains several Polygon
s, a MultiPolygon
is returned.geomList
contains some Polygon
s and some LineString
s, 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.
newGeoms | the Geometry s 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
|
inline |
See buildGeometry(std::vector<Geometry *>&) for semantics.
Will clone the geometries accessible trough the iterator.
T | an iterator yelding something which casts to const Geometry* |
from | start iterator |
toofar | end iterator |
Geometry* geos::geom::GeometryFactory::buildGeometry | ( | const std::vector< 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.