GeometryMapper.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2021 Paul Ramsey <pramsey@cleverelephant.ca>
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************
*
* Last port: geom/util/GeometryMapper.java
*
**********************************************************************/
#pragma once
#include <memory>
#include <vector>
#include <functional>
#include <geos/export.h>
// Forward declarations
namespace geos {
namespace geom {
class Geometry;
class GeometryCollection;
class GeometryFactory;
}
}
namespace geos {
namespace geom { // geos.geom
namespace util { // geos.geom.util
class GEOS_DLL GeometryMapper {
public:
typedef std::function<std::unique_ptr<Geometry>(const Geometry&)> mapOp;
static std::unique_ptr<Geometry> map(
const Geometry& geom,
mapOp op);
static std::unique_ptr<Geometry> flatMap(
const Geometry& geom,
int emptyDim,
mapOp op);
private:
static void flatMap(
const Geometry& geom,
mapOp op,
std::vector<std::unique_ptr<Geometry>>& mapped);
static void addFlat(
std::unique_ptr<Geometry>& geom,
std::vector<std::unique_ptr<Geometry>>& geomList);
};
} // namespace geos.geom.util
} // namespace geos.geom
} // namespace geos
geos::geom::GeometryCollection
Represents a collection of heterogeneous Geometry objects.
Definition GeometryCollection.h:51
geos::geom::GeometryFactory
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition GeometryFactory.h:70
geos::geom::Geometry
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:196
geos::geom::util::GeometryMapper
Definition GeometryMapper.h:49
geos::geom::util::GeometryMapper::flatMap
static std::unique_ptr< Geometry > flatMap(const Geometry &geom, int emptyDim, mapOp op)
geos::geom::util::GeometryMapper::map
static std::unique_ptr< Geometry > map(const Geometry &geom, mapOp op)
geos::geom::util::GeometryMapper::mapOp
std::function< std::unique_ptr< Geometry >(const Geometry &)> mapOp
Definition GeometryMapper.h:58
geos::geom::util
Provides classes that parse and modify Geometry objects.
Definition ComponentCoordinateExtracter.h:28
geos::geom
Definition Angle.h:26
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38