GEOS
3.9.1dev
|
A framework for processes which transform an input Geometry into an output Geometry, possibly changing its structure and type(s). More...
#include <GeometryTransformer.h>
Public Member Functions | |
GeometryTransformer () | |
virtual | ~GeometryTransformer ()=default |
std::unique_ptr< Geometry > | transform (const Geometry *nInputGeom) |
void | setSkipTransformedInvalidInteriorRings (bool b) |
Protected Attributes | |
const GeometryFactory * | factory |
Private Member Functions | |
GeometryTransformer (const GeometryTransformer &other)=delete | |
GeometryTransformer & | operator= (const GeometryTransformer &rhs)=delete |
Private Attributes | |
const Geometry * | inputGeom |
bool | pruneEmptyGeometry |
bool | preserveGeometryCollectionType |
bool | preserveType |
bool | skipTransformedInvalidInteriorRings |
A framework for processes which transform an input Geometry into an output Geometry, possibly changing its structure and type(s).
This class is a framework for implementing subclasses which perform transformations on various different Geometry subclasses. It provides an easy way of applying specific transformations to given geometry types, while allowing unhandled types to be simply copied. Also, the framework ensures that if subcomponents change type the parent geometries types change appropriately to maintain valid structure. Subclasses will override whichever transformX
methods they need to to handle particular Geometry types.
A typically usage would be a transformation that may transform Polygons into Polygons, LineStrings or Points. This class would likely need to override the GeometryTransformer::transformMultiPolygon(const MultiPolygon* geom, const Geometry* parent)
method to ensure that if input Polygons change type the result is a GeometryCollection, not a MultiPolygon
The default behaviour of this class is to simply recursively transform each Geometry component into an identical object by copying.
Note that all transformX
methods may return null
, to avoid creating empty geometry objects. This will be handled correctly by the transformer. The GeometryTransformer::transform(const Geometry* nInputGeom)
method itself will always return a geometry object.
Possible extensions: getParent() method to return immediate parent e.g. of LinearRings in Polygons
Definition at line 89 of file GeometryTransformer.h.
geos::geom::util::GeometryTransformer::GeometryTransformer | ( | ) |
|
virtualdefault |
|
privatedelete |
|
protected |
Convenience method which provides standard way of creating a CoordinateSequence.
coords | the coordinate array to copy |
[final]
|
privatedelete |
void geos::geom::util::GeometryTransformer::setSkipTransformedInvalidInteriorRings | ( | bool | b | ) |
std::unique_ptr<Geometry> geos::geom::util::GeometryTransformer::transform | ( | const Geometry * | nInputGeom | ) |
|
protectedvirtual |
Reimplemented in geos::geom::util::Densifier::DensifyTransformer.
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
Reimplemented in geos::geom::util::Densifier::DensifyTransformer.
|
protectedvirtual |
|
protectedvirtual |
Reimplemented in geos::geom::util::Densifier::DensifyTransformer.
|
protected |
Definition at line 103 of file GeometryTransformer.h.
|
private |
Definition at line 155 of file GeometryTransformer.h.
|
private |
true
if a homogenous collection result from a GeometryCollection should still be a general GeometryCollection
Definition at line 168 of file GeometryTransformer.h.
|
private |
true
if the output from a collection argument should still be a collection true
if the type of the input should be preserved
Definition at line 178 of file GeometryTransformer.h.
|
private |
true
if empty geometries should not be included in the result
Definition at line 161 of file GeometryTransformer.h.
|
private |
true
if transformed invalid interior rings should be skipped
Definition at line 183 of file GeometryTransformer.h.