geos::geom::util::GeometryMapper Class Reference

`#include <GeometryMapper.h>`

## Public Types

typedef std::function< std::unique_ptr< Geometry >(const Geometry &)> | mapOp

## Static Public Member Functions

static std::unique_ptr< Geometry > | map (const Geometry &geom, mapOp op)
static std::unique_ptr< Geometry > | flatMap (const Geometry &geom, int emptyDim, mapOp op)

## Detailed Description

Methods to map various collections of `Geometry`s via defined mapping functions.

Author
  Martin Davis

## Member Typedef Documentation

## mapOp

typedef std::function<std::unique_ptr<Geometry>(const Geometry&)> geos::geom::util::GeometryMapper::mapOp

An interface for geometry functions that map a geometry input to a geometry output. The output may be nullptr if there is no valid output value for the given input value.

## Member Function Documentation

## flatMap()

std::unique_ptr< Geometry > geos::geom::util::GeometryMapper::flatMap | ( | const Geometry & | geom,
|  | int | emptyDim,
|  | mapOp | op )

static

Maps the atomic elements of a `Geometry` (which may be atomic or composite) using a mapOp mapping operation into an atomic Geometry or a flat collection of the most specific type. null and empty values returned from the mapping operation are discarded.

Parameters

  geom | the geometry to map
  emptyDim | the dimension of empty geometry to create
  op | the mapping operation

Returns
  the mapped result

References flatMap().

Referenced by flatMap().

## map()

std::unique_ptr< Geometry > geos::geom::util::GeometryMapper::map | ( | const Geometry & | geom,
|  | mapOp | op )

static

Maps the members of a `Geometry` (which may be atomic or composite) into another Geometry of most specific type. null results are skipped. In the case of hierarchical `GeometryCollection`s, only the first level of members are mapped.

Parameters

  geom | the input atomic or composite geometry
  op | the mapping operation

Returns
  a result collection or geometry of most specific type

The documentation for this class was generated from the following file:

- GeometryMapper.h