GeometryTransformer.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2011 Sandro Santilli <strk@kbt.io>
* Copyright (C) 2006 Refractions Research Inc.
*
* 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/GeometryTransformer.java r320 (JTS-1.12)
*
**********************************************************************/
#pragma once
#include <geos/export.h>
#include <geos/geom/Coordinate.h> // destructor visibility for vector
#include <geos/geom/Geometry.h> // destructor visibility for unique_ptr
#include <geos/geom/CoordinateSequence.h> // destructor visibility for unique_ptr
#include <memory> // for unique_ptr
#include <vector>
// Forward declarations
namespace geos {
namespace geom {
class Geometry;
class GeometryFactory;
class Point;
class LinearRing;
class LineString;
class Polygon;
class MultiPoint;
class MultiPolygon;
class MultiLineString;
class GeometryCollection;
namespace util {
//class GeometryEditorOperation;
}
}
}
namespace geos {
namespace geom { // geos.geom
namespace util { // geos.geom.util
class GEOS_DLL GeometryTransformer {
public:
GeometryTransformer();
virtual ~GeometryTransformer() = default;
std::unique_ptr<Geometry> transform(const Geometry* nInputGeom);
void setSkipTransformedInvalidInteriorRings(bool b);
protected:
const GeometryFactory* factory;
virtual CoordinateSequence::Ptr transformCoordinates(
const CoordinateSequence* coords,
const Geometry* parent);
virtual Geometry::Ptr transformPoint(
const Point* geom,
const Geometry* parent);
virtual Geometry::Ptr transformMultiPoint(
const MultiPoint* geom,
const Geometry* parent);
virtual Geometry::Ptr transformLinearRing(
const LinearRing* geom,
const Geometry* parent);
virtual Geometry::Ptr transformLineString(
const LineString* geom,
const Geometry* parent);
virtual Geometry::Ptr transformMultiLineString(
const MultiLineString* geom,
const Geometry* parent);
virtual Geometry::Ptr transformPolygon(
const Polygon* geom,
const Geometry* parent);
virtual Geometry::Ptr transformMultiPolygon(
const MultiPolygon* geom,
const Geometry* parent);
virtual Geometry::Ptr transformGeometryCollection(
const GeometryCollection* geom,
const Geometry* parent);
private:
const Geometry* inputGeom;
// these could eventually be exposed to clients
bool pruneEmptyGeometry;
bool preserveGeometryCollectionType;
// bool preserveCollections;
bool preserveType;
bool skipTransformedInvalidInteriorRings;
// Declare type as noncopyable
GeometryTransformer(const GeometryTransformer& other) = delete;
GeometryTransformer& operator=(const GeometryTransformer& rhs) = delete;
};
} // namespace geos.geom.util
} // namespace geos.geom
} // namespace geos
geos::geom::CoordinateSequence
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:56
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::Geometry::Ptr
std::unique_ptr< Geometry > Ptr
An unique_ptr of Geometry.
Definition Geometry.h:209
geos::geom::LineString
Definition LineString.h:66
geos::geom::LinearRing
Models an OGC SFS LinearRing. A LinearRing is a LineString which is both closed and simple.
Definition LinearRing.h:54
geos::geom::MultiLineString
Models a collection of LineStrings.
Definition MultiLineString.h:49
geos::geom::MultiPoint
Definition MultiPoint.h:50
geos::geom::MultiPolygon
Definition MultiPolygon.h:58
geos::geom::Point
Definition Point.h:61
geos::geom::Polygon
Represents a linear polygon, which may include holes.
Definition Polygon.h:61
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