Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | Related Pages

geos::geom::GeometryFactory Class Reference

Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geometry objects. More...

#include <GeometryFactory.h>

List of all members.

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.
 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.
 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.
PointcreatePointFromInternalCoord (const Coordinate *coord, const Geometry *exemplar) const
GeometrytoGeometry (const Envelope *envelope) const
 Converts an Envelope to a Geometry.
const PrecisionModelgetPrecisionModel () const
 Returns the PrecisionModel that Geometries created by this factory will be associated with.
PointcreatePoint () const
 Creates an EMPTY Point.
PointcreatePoint (const Coordinate &coordinate) const
 Creates a Point using the given Coordinate.
PointcreatePoint (CoordinateSequence *coordinates) const
 Creates a Point taking ownership of the given CoordinateSequence.
PointcreatePoint (const CoordinateSequence &coordinates) const
 Creates a Point with a deep-copy of the given CoordinateSequence.
GeometryCollectioncreateGeometryCollection () const
 Construct an EMPTY GeometryCollection.
GeometrycreateEmptyGeometry () const
 Construct the EMPTY Geometry.
GeometryCollectioncreateGeometryCollection (std::vector< Geometry * > *newGeoms) const
 Construct a GeometryCollection taking ownership of given arguments.
GeometryCollectioncreateGeometryCollection (const std::vector< Geometry * > &newGeoms) const
 Constructs a GeometryCollection with a deep-copy of args.
MultiLineStringcreateMultiLineString () const
 Construct an EMPTY MultiLineString.
MultiLineStringcreateMultiLineString (std::vector< Geometry * > *newLines) const
 Construct a MultiLineString taking ownership of given arguments.
MultiLineStringcreateMultiLineString (const std::vector< Geometry * > &fromLines) const
 Construct a MultiLineString with a deep-copy of given arguments.
MultiPolygoncreateMultiPolygon () const
 Construct an EMPTY MultiPolygon.
MultiPolygoncreateMultiPolygon (std::vector< Geometry * > *newPolys) const
 Construct a MultiPolygon taking ownership of given arguments.
MultiPolygoncreateMultiPolygon (const std::vector< Geometry * > &fromPolys) const
 Construct a MultiPolygon with a deep-copy of given arguments.
LinearRingcreateLinearRing () const
 Construct an EMPTY LinearRing.
LinearRingcreateLinearRing (CoordinateSequence *newCoords) const
 Construct a LinearRing taking ownership of given arguments.
std::auto_ptr< GeometrycreateLinearRing (std::auto_ptr< CoordinateSequence > newCoords) const
LinearRingcreateLinearRing (const CoordinateSequence &coordinates) const
 Construct a LinearRing with a deep-copy of given arguments.
MultiPointcreateMultiPoint () const
 Constructs an EMPTY MultiPoint.
MultiPointcreateMultiPoint (std::vector< Geometry * > *newPoints) const
 Construct a MultiPoint taking ownership of given arguments.
MultiPointcreateMultiPoint (const std::vector< Geometry * > &fromPoints) const
 Construct a MultiPoint with a deep-copy of given arguments.
MultiPointcreateMultiPoint (const CoordinateSequence &fromCoords) const
 Construct a MultiPoint containing a Point geometry for each Coordinate in the given list.
PolygoncreatePolygon () const
 Construct an EMPTY Polygon.
PolygoncreatePolygon (LinearRing *shell, std::vector< Geometry * > *holes) const
 Construct a Polygon taking ownership of given arguments.
PolygoncreatePolygon (const LinearRing &shell, const std::vector< Geometry * > &holes) const
 Construct a Polygon with a deep-copy of given arguments.
LineStringcreateLineString () const
 Construct an EMPTY LineString.
std::auto_ptr< LineStringcreateLineString (const LineString &ls) const
 Copy a LineString.
LineStringcreateLineString (CoordinateSequence *coordinates) const
 Construct a LineString taking ownership of given argument.
std::auto_ptr< GeometrycreateLineString (std::auto_ptr< CoordinateSequence > coordinates) const
LineStringcreateLineString (const CoordinateSequence &coordinates) const
 Construct a LineString with a deep-copy of given argument.
GeometrybuildGeometry (std::vector< Geometry * > *geoms) const
GeometrybuildGeometry (const std::vector< Geometry * > &geoms) const
 This function does the same thing of the omonimouse function taking vector pointer instead of reference.
int getSRID () const
const CoordinateSequenceFactorygetCoordinateSequenceFactory () const
 Returns the CoordinateSequenceFactory associated with this GeometryFactory.
GeometrycreateGeometry (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 GeometryFactorygetDefaultInstance ()
 Return a pointer to the default GeometryFactory. This is a global shared object instantiated using default constructor.


Detailed Description

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.


Constructor & Destructor Documentation

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.

Parameters:
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.

Parameters:
pm the PrecisionModel to use
newSRID the SRID to use

geos::geom::GeometryFactory::GeometryFactory const GeometryFactory gf  ) 
 

Copy constructor.

Parameters:
gf the GeometryFactory to clone from


Member Function Documentation

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.

Geometry* geos::geom::GeometryFactory::buildGeometry std::vector< Geometry * > *  geoms  )  const
 

Build an appropriate Geometry, MultiGeometry, or GeometryCollection to contain the Geometrys in it.

For example:

Note 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.

Parameters:
newGeoms the Geometrys to combine
Returns:
A 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

Geometry* geos::geom::GeometryFactory::toGeometry const Envelope envelope  )  const
 

Converts an Envelope to a Geometry.

Returned Geometry can be a Point, a Polygon or an EMPTY geom.


The documentation for this class was generated from the following file:
Generated on Thu Jun 11 06:17:02 2009 for GEOS by  doxygen 1.4.4