geos::GeometryFactory Class Reference

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

#include <geos.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.
GeometrytoGeometry (const Envelope *envelope) const
 Envelope to Geometry converter.
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.
GeometryCollectioncreateGeometryCollection (vector< Geometry * > *newGeoms) const
 Construct a GeometryCollection taking ownership of given arguments.
GeometryCollectioncreateGeometryCollection (const vector< Geometry * > &newGeoms) const
 Constructs a GeometryCollection with a deep-copy of args.
MultiLineStringcreateMultiLineString () const
 Construct an EMPTY MultiLineString.
MultiLineStringcreateMultiLineString (vector< Geometry * > *newLines) const
 Construct a MultiLineString taking ownership of given arguments.
MultiLineStringcreateMultiLineString (const vector< Geometry * > &fromLines) const
 Construct a MultiLineString with a deep-copy of given arguments.
MultiPolygoncreateMultiPolygon () const
 Construct an EMPTY MultiPolygon.
MultiPolygoncreateMultiPolygon (vector< Geometry * > *newPolys) const
 Construct a MultiPolygon taking ownership of given arguments.
MultiPolygoncreateMultiPolygon (const 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.
LinearRingcreateLinearRing (const CoordinateSequence &coordinates) const
 Construct a LinearRing with a deep-copy of given arguments.
MultiPointcreateMultiPoint () const
 Constructs an EMPTY MultiPoint.
MultiPointcreateMultiPoint (vector< Geometry * > *newPoints) const
 Construct a MultiPoint taking ownership of given arguments.
MultiPointcreateMultiPoint (const 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, vector< Geometry * > *holes) const
 Construct a Polygon taking ownership of given arguments.
PolygoncreatePolygon (const LinearRing &shell, const vector< Geometry * > &holes) const
 Construct a Polygon with a deep-copy of given arguments.
LineStringcreateLineString () const
 Construct an EMPTY LineString.
LineStringcreateLineString (CoordinateSequence *coordinates) const
 Construct a LineString taking ownership of given argument.
LineStringcreateLineString (const CoordinateSequence &coordinates) const
 Construct a LineString with a deep-copy of given argument.
GeometrybuildGeometry (vector< Geometry * > *geoms) const
 Construct the most suitable Geometry using the given Geometries; will take ownership of arguments.
GeometrybuildGeometry (const vector< Geometry * > &geoms) const
 Construct the most suitable Geometry using the given Geometries; will use a deep-copy of arguments.
GeometrycreateGeometry (const Geometry *g) const
 Returns a clone of given Geometry.
void destroyGeometry (Geometry *g) const
 Destroy a Geometry, or release it.


Detailed Description

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


Constructor & Destructor Documentation

geos::GeometryFactory::GeometryFactory  ) 
 

Constructs a GeometryFactory that generates Geometries having a floating PrecisionModel and a spatial-reference ID of 0.

Constructs a GeometryFactory that generates Geometries having a floating PrecisionModel and a spatial-reference ID of 0.

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

Constructs a GeometryFactory that generates Geometries having the given PrecisionModel, spatial-reference ID, and CoordinateSequence implementation.

geos::GeometryFactory::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.

Constructs a GeometryFactory that generates Geometries having the given CoordinateSequence implementation, a double-precision floating PrecisionModel and a spatial-reference ID of 0.

geos::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::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::GeometryFactory::GeometryFactory const GeometryFactory gf  ) 
 

Copy constructor.

Parameters:
gf the GeometryFactory to clone from


Member Function Documentation

Geometry * geos::GeometryFactory::buildGeometry const vector< Geometry * > &  fromGeoms  )  const
 

Construct the most suitable Geometry using the given Geometries; will use a deep-copy of arguments.

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::GeometryFactory::buildGeometry vector< Geometry * > *  newGeoms  )  const
 

Construct the most suitable Geometry using the given Geometries; will take ownership of arguments.

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::GeometryFactory::createGeometry const Geometry g  )  const
 

Returns a clone of given Geometry.

Returns:
a clone of g based on a CoordinateSequence created by this GeometryFactory's CoordinateSequenceFactory

GeometryCollection * geos::GeometryFactory::createGeometryCollection const vector< Geometry * > &  fromGeoms  )  const
 

Constructs a GeometryCollection with a deep-copy of args.

Parameters:
fromGeoms the Geometrys for this GeometryCollection, Elements may be empty Geometrys, but not nulls.
fromGeoms vector and elements will be copied.

GeometryCollection * geos::GeometryFactory::createGeometryCollection vector< Geometry * > *  newGeoms  )  const
 

Construct a GeometryCollection taking ownership of given arguments.

Constructs a GeometryCollection.

Parameters:
newGeoms The Geometrys for this GeometryCollection, or null or an empty array to create the empty geometry. Elements may be empty Geometrys, but not nulls.
If construction succeed the created object will take ownership of newGeoms vector and elements.

If construction fails "IllegalArgumentException *" is thrown and it is your responsibility to delete newGeoms vector and content.

GeometryCollection * geos::GeometryFactory::createGeometryCollection  )  const
 

Construct an EMPTY GeometryCollection.

Constructs an EMPTY GeometryCollection.

LinearRing * geos::GeometryFactory::createLinearRing CoordinateSequence newCoords  )  const
 

Construct a LinearRing taking ownership of given arguments.

Creates a LinearRing using the given CoordinateSequence; a null or empty CoordinateSequence will create an empty LinearRing. The points must form a closed and simple linestring. Consecutive points must not be equal.

Parameters:
newCoords a CoordinateSequence possibly empty, or null.
LinearRing will take ownership of coordinates.

LinearRing * geos::GeometryFactory::createLinearRing  )  const
 

Construct an EMPTY LinearRing.

Creates an EMPTY LinearRing

LineString * geos::GeometryFactory::createLineString const CoordinateSequence fromCoords  )  const
 

Construct a LineString with a deep-copy of given argument.

Constructs a LineString copying the given CoordinateSequence.

Parameters:
fromCoords the list of coordinates making up the linestring. Consecutive points may not be equal.

LineString * geos::GeometryFactory::createLineString CoordinateSequence newCoords  )  const
 

Construct a LineString taking ownership of given argument.

Constructs a LineString taking ownership of the given CoordinateSequence.

Parameters:
newCoords the list of coordinates making up the linestring, or null to create the empty geometry. Consecutive points may not be equal. Created object will take ownership of CoordinateSequence.

LineString * geos::GeometryFactory::createLineString  )  const
 

Construct an EMPTY LineString.

Constructs an EMPTY LineString

MultiLineString * geos::GeometryFactory::createMultiLineString const vector< Geometry * > &  fromLines  )  const
 

Construct a MultiLineString with a deep-copy of given arguments.

Constructs a MultiLineString.

Parameters:
fromLines the LineStringss for this MultiLineString, or an empty array to create the empty geometry. Elements may be empty LineStrings, but not nulls.
Constructed object will copy the vector and its elements.

MultiLineString * geos::GeometryFactory::createMultiLineString vector< Geometry * > *  newLines  )  const
 

Construct a MultiLineString taking ownership of given arguments.

Constructs a MultiLineString.

Parameters:
newLines the LineStringss for this MultiLineString, or null or an empty array to create the empty geometry. Elements may be empty LineStrings, but not nulls.
Constructed object will take ownership of the vector and its elements.

MultiLineString * geos::GeometryFactory::createMultiLineString  )  const
 

Construct an EMPTY MultiLineString.

Construct an EMPTY MultiLineString

MultiPoint * geos::GeometryFactory::createMultiPoint const CoordinateSequence fromCoords  )  const
 

Construct a MultiPoint containing a Point geometry for each Coordinate in the given list.

Creates a MultiPoint using the given CoordinateSequence.

Parameters:
fromCoords a CoordinateSequence used for Points construction.

MultiPoint * geos::GeometryFactory::createMultiPoint const vector< Geometry * > &  fromPoints  )  const
 

Construct a MultiPoint with a deep-copy of given arguments.

Constructs a MultiPoint.

Parameters:
fromPoints the Points for this MultiPoint, or an empty array to create the empty geometry. Elements may be empty Points, but not nulls.
Constructed object will copy the vector and its elements.

MultiPoint * geos::GeometryFactory::createMultiPoint vector< Geometry * > *  newPoints  )  const
 

Construct a MultiPoint taking ownership of given arguments.

Constructs a MultiPoint.

Parameters:
newPoints the Points for this MultiPoint, or null or an empty array to create the empty geometry. Elements may be empty Points, but not nulls.
Constructed object will take ownership of the vector and its elements.

MultiPoint * geos::GeometryFactory::createMultiPoint  )  const
 

Constructs an EMPTY MultiPoint.

Creates an EMPTY MultiPoint

MultiPolygon * geos::GeometryFactory::createMultiPolygon const vector< Geometry * > &  fromPolys  )  const
 

Construct a MultiPolygon with a deep-copy of given arguments.

Parameters:
fromPolys the Polygons for this MultiPolygon, or an empty array to create the empty geometry. Elements may be empty Polygons, but not nulls. The polygons must conform to the assertions specified in the OpenGIS Simple Features Specification for SQL .
Constructed object will copy the vector and its elements.

MultiPolygon * geos::GeometryFactory::createMultiPolygon vector< Geometry * > *  newPolys  )  const
 

Construct a MultiPolygon taking ownership of given arguments.

Parameters:
newPolys the Polygons for this MultiPolygon, or null or an empty array to create the empty geometry. Elements may be empty Polygons, but not nulls. The polygons must conform to the assertions specified in the OpenGIS Simple Features Specification for SQL .
Constructed object will take ownership of the vector and its elements.

Point * geos::GeometryFactory::createPoint const CoordinateSequence fromCoords  )  const
 

Creates a Point with a deep-copy of the given CoordinateSequence.

Creates a Point using the given CoordinateSequence (must have 1 element)

Parameters:
fromCoords contains the single coordinate on which to base this Point.

Point * geos::GeometryFactory::createPoint CoordinateSequence newCoords  )  const
 

Creates a Point taking ownership of the given CoordinateSequence.

Creates a Point using the given CoordinateSequence (must have 1 element)

Parameters:
newCoords contains the single coordinate on which to base this Point or null to create the empty geometry.
If not null the created Point will take ownership of newCoords.

Point * geos::GeometryFactory::createPoint const Coordinate coordinate  )  const
 

Creates a Point using the given Coordinate.

Creates a Point using the given Coordinate; a null Coordinate will create an empty Geometry.

Point * geos::GeometryFactory::createPoint  )  const
 

Creates an EMPTY Point.

Creates the EMPTY Point

Polygon * geos::GeometryFactory::createPolygon const LinearRing shell,
const vector< Geometry * > &  holes
const
 

Construct a Polygon with a deep-copy of given arguments.

Constructs a Polygon with the given exterior boundary and interior boundaries.

Parameters:
shell the outer boundary of the new Polygon
holes the inner boundaries of the new Polygon Note that these must be LinearRings

Polygon * geos::GeometryFactory::createPolygon LinearRing shell,
vector< Geometry * > *  holes
const
 

Construct a Polygon taking ownership of given arguments.

Constructs a Polygon with the given exterior boundary and interior boundaries.

Parameters:
shell the outer boundary of the new Polygon, or null or an empty LinearRing if the empty geometry is to be created.
holes the inner boundaries of the new Polygon, or null or empty LinearRing s if the empty geometry is to be created.

Polygon * geos::GeometryFactory::createPolygon  )  const
 

Construct an EMPTY Polygon.

Constructs an EMPTY Polygon

void geos::GeometryFactory::destroyGeometry Geometry g  )  const
 

Destroy a Geometry, or release it.

Destroy a Geometry, or release it.

const PrecisionModel * geos::GeometryFactory::getPrecisionModel  )  const
 

Returns the PrecisionModel that Geometries created by this factory will be associated with.

Returns the PrecisionModel that Geometries created by this factory will be associated with.

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

Envelope to Geometry converter.

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 files:
Generated on Wed Jan 10 23:34:00 2007 for GEOS by  doxygen 1.4.6