#include <geos.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. | |
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. | |
Geometry * | toGeometry (const Envelope *envelope) const |
Envelope to Geometry converter. | |
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. | |
GeometryCollection * | createGeometryCollection (vector< Geometry * > *newGeoms) const |
Construct a GeometryCollection taking ownership of given arguments. | |
GeometryCollection * | createGeometryCollection (const vector< Geometry * > &newGeoms) const |
Constructs a GeometryCollection with a deep-copy of args. | |
MultiLineString * | createMultiLineString () const |
Construct an EMPTY MultiLineString. | |
MultiLineString * | createMultiLineString (vector< Geometry * > *newLines) const |
Construct a MultiLineString taking ownership of given arguments. | |
MultiLineString * | createMultiLineString (const vector< Geometry * > &fromLines) const |
Construct a MultiLineString with a deep-copy of given arguments. | |
MultiPolygon * | createMultiPolygon () const |
Construct an EMPTY MultiPolygon. | |
MultiPolygon * | createMultiPolygon (vector< Geometry * > *newPolys) const |
Construct a MultiPolygon taking ownership of given arguments. | |
MultiPolygon * | createMultiPolygon (const 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. | |
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 (vector< Geometry * > *newPoints) const |
Construct a MultiPoint taking ownership of given arguments. | |
MultiPoint * | createMultiPoint (const 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. | |
Polygon * | createPolygon () const |
Construct an EMPTY Polygon. | |
Polygon * | createPolygon (LinearRing *shell, vector< Geometry * > *holes) const |
Construct a Polygon taking ownership of given arguments. | |
Polygon * | createPolygon (const LinearRing &shell, const vector< Geometry * > &holes) const |
Construct a Polygon with a deep-copy of given arguments. | |
LineString * | createLineString () const |
Construct an EMPTY LineString. | |
LineString * | createLineString (CoordinateSequence *coordinates) const |
Construct a LineString taking ownership of given argument. | |
LineString * | createLineString (const CoordinateSequence &coordinates) const |
Construct a LineString with a deep-copy of given argument. | |
Geometry * | buildGeometry (vector< Geometry * > *geoms) const |
Construct the most suitable Geometry using the given Geometries; will take ownership of arguments. | |
Geometry * | buildGeometry (const vector< Geometry * > &geoms) const |
Construct the most suitable Geometry using the given Geometries; will use a deep-copy of arguments. | |
Geometry * | createGeometry (const Geometry *g) const |
Returns a clone of given Geometry. | |
void | destroyGeometry (Geometry *g) const |
Destroy a Geometry, or release it. |
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.
References geos::DefaultCoordinateSequenceFactory::instance().
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.
pm | the PrecisionModel to use |
precisionModel | the PrecisionModel to use |
References geos::DefaultCoordinateSequenceFactory::instance().
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.
pm | the PrecisionModel to use | |
newSRID | the SRID to use |
precisionModel | the PrecisionModel to use | |
SRID | the SRID to use |
References geos::DefaultCoordinateSequenceFactory::instance().
geos::GeometryFactory::GeometryFactory | ( | const GeometryFactory & | gf | ) |
Copy constructor.
gf | the GeometryFactory to clone from |
References coordinateListFactory, precisionModel, and SRID.
Envelope to Geometry converter.
Converts an Envelope to a Geometry. Returned Geometry can be a Point, a Polygon or an EMPTY geom.
References geos::CoordinateSequence::add(), geos::CoordinateSequenceFactory::create(), createLinearRing(), createPoint(), createPolygon(), geos::Envelope::getMaxX(), geos::Envelope::getMaxY(), geos::Envelope::getMinX(), geos::Envelope::getMinY(), geos::DefaultCoordinateSequenceFactory::instance(), geos::Envelope::isNull(), geos::Coordinate::x, and geos::Coordinate::y.
Referenced by geos::Geometry::getEnvelope().
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.
Referenced by geos::GeometricShapeFactory::createArc(), geos::Geometry::getPrecisionModel(), and geos::WKTReader::WKTReader().
Point * geos::GeometryFactory::createPoint | ( | ) | const |
Creates an EMPTY Point.
Creates the EMPTY Point
Referenced by createMultiPoint(), createPoint(), and toGeometry().
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.
References geos::CoordinateSequenceFactory::create(), and createPoint().
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)
newCoords | contains the single coordinate on which to base this Point or null to create the empty geometry. |
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)
fromCoords | contains the single coordinate on which to base this Point . |
References geos::CoordinateSequence::clone().
GeometryCollection * geos::GeometryFactory::createGeometryCollection | ( | ) | const |
Construct an EMPTY GeometryCollection.
Constructs an EMPTY GeometryCollection
.
Referenced by buildGeometry(), geos::Polygon::getBoundary(), geos::Point::getBoundary(), geos::MultiPolygon::getBoundary(), geos::MultiPoint::getBoundary(), geos::MultiLineString::getBoundary(), and geos::LineString::getBoundary().
GeometryCollection * geos::GeometryFactory::createGeometryCollection | ( | vector< Geometry * > * | newGeoms | ) | const |
Construct a GeometryCollection taking ownership of given arguments.
Constructs a GeometryCollection.
newGeoms | The Geometry s for this GeometryCollection , or null or an empty array to create the empty geometry. Elements may be empty Geometry s, but not null s. |
If construction fails "IllegalArgumentException *" is thrown and it is your responsibility to delete newGeoms vector and content.
GeometryCollection * geos::GeometryFactory::createGeometryCollection | ( | const vector< Geometry * > & | fromGeoms | ) | const |
Constructs a GeometryCollection with a deep-copy of args.
fromGeoms | the Geometry s for this GeometryCollection , Elements may be empty Geometry s, but not null s. |
References geos::GeometryCollection::clone().
MultiLineString * geos::GeometryFactory::createMultiLineString | ( | ) | const |
Construct an EMPTY MultiLineString.
Construct an EMPTY MultiLineString
Referenced by buildGeometry(), geos::Polygon::getBoundary(), and geos::MultiPolygon::getBoundary().
MultiLineString * geos::GeometryFactory::createMultiLineString | ( | vector< Geometry * > * | newLines | ) | const |
Construct a MultiLineString taking ownership of given arguments.
Constructs a MultiLineString
.
newLines | the LineStrings s for this MultiLineString , or null or an empty array to create the empty geometry. Elements may be empty LineString s, but not null s. |
MultiLineString * geos::GeometryFactory::createMultiLineString | ( | const vector< Geometry * > & | fromLines | ) | const |
Construct a MultiLineString with a deep-copy of given arguments.
Constructs a MultiLineString
.
fromLines | the LineStrings s for this MultiLineString , or an empty array to create the empty geometry. Elements may be empty LineString s, but not null s. |
MultiPolygon * geos::GeometryFactory::createMultiPolygon | ( | vector< Geometry * > * | newPolys | ) | const |
Construct a MultiPolygon taking ownership of given arguments.
newPolys | the Polygon s for this MultiPolygon , or null or an empty array to create the empty geometry. Elements may be empty Polygon s, but not null s. The polygons must conform to the assertions specified in the OpenGIS Simple Features Specification for SQL . |
MultiPolygon * geos::GeometryFactory::createMultiPolygon | ( | const vector< Geometry * > & | fromPolys | ) | const |
Construct a MultiPolygon with a deep-copy of given arguments.
fromPolys | the Polygon s for this MultiPolygon , or an empty array to create the empty geometry. Elements may be empty Polygon s, but not null s. The polygons must conform to the assertions specified in the OpenGIS Simple Features Specification for SQL . |
References geos::GeometryCollection::clone().
LinearRing * geos::GeometryFactory::createLinearRing | ( | ) | const |
Construct an EMPTY LinearRing.
Creates an EMPTY LinearRing
Referenced by geos::GeometricShapeFactory::createCircle(), geos::GeometricShapeFactory::createRectangle(), geos::Polygon::Polygon(), and toGeometry().
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.
newCoords | a CoordinateSequence possibly empty, or null. |
MultiPoint * geos::GeometryFactory::createMultiPoint | ( | ) | const |
Constructs an EMPTY MultiPoint
.
Creates an EMPTY MultiPoint
Referenced by buildGeometry(), createMultiPoint(), geos::MultiLineString::getBoundary(), and geos::LineString::getBoundary().
MultiPoint * geos::GeometryFactory::createMultiPoint | ( | vector< Geometry * > * | newPoints | ) | const |
Construct a MultiPoint taking ownership of given arguments.
Constructs a MultiPoint
.
newPoints | the Point s for this MultiPoint , or null or an empty array to create the empty geometry. Elements may be empty Point s, but not null s. |
MultiPoint * geos::GeometryFactory::createMultiPoint | ( | const vector< Geometry * > & | fromPoints | ) | const |
Construct a MultiPoint with a deep-copy of given arguments.
Constructs a MultiPoint
.
fromPoints | the Point s for this MultiPoint , or an empty array to create the empty geometry. Elements may be empty Point s, but not null s. |
References geos::GeometryCollection::clone().
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.
fromCoords | a CoordinateSequence used for Points construction. |
References createMultiPoint(), createPoint(), geos::CoordinateSequence::getAt(), and geos::CoordinateSequence::getSize().
Polygon * geos::GeometryFactory::createPolygon | ( | ) | const |
Construct an EMPTY Polygon.
Constructs an EMPTY Polygon
Referenced by geos::GeometricShapeFactory::createCircle(), geos::GeometricShapeFactory::createRectangle(), and toGeometry().
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.
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 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.
shell | the outer boundary of the new Polygon | |
holes | the inner boundaries of the new Polygon Note that these must be LinearRings |
References geos::Geometry::clone(), and geos::LinearRing::clone().
LineString * geos::GeometryFactory::createLineString | ( | ) | const |
Construct an EMPTY LineString.
Constructs an EMPTY LineString
Referenced by geos::GeometricShapeFactory::createArc().
LineString * geos::GeometryFactory::createLineString | ( | CoordinateSequence * | newCoords | ) | const |
Construct a LineString taking ownership of given argument.
Constructs a LineString
taking ownership of the given CoordinateSequence.
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 CoordinateSequence & | fromCoords | ) | const |
Construct a LineString with a deep-copy of given argument.
Constructs a LineString
copying the given CoordinateSequence.
fromCoords | the list of coordinates making up the linestring. Consecutive points may not be equal. |
References geos::CoordinateSequence::clone().
Construct the most suitable Geometry using the given Geometries; will take ownership of arguments.
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 returned
newGeoms | the Geometry s to combine |
Geometry
of the "smallest", "most type-specific" class that can contain the elements of geomList
.References createGeometryCollection(), createMultiLineString(), createMultiPoint(), and createMultiPolygon().
Referenced by geos::Geometry::Union().
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.
References geos::Geometry::clone(), createGeometryCollection(), createMultiLineString(), createMultiPoint(), and createMultiPolygon().
Returns a clone of given Geometry.
References geos::Geometry::clone().
Referenced by geos::Geometry::toInternalGeometry().
void geos::GeometryFactory::destroyGeometry | ( | Geometry * | g | ) | const |