SharedPathsOp.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2010 Sandro Santilli <strk@kbt.io>
*
* 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: original work
*
* Developed by Sandro Santilli (strk@kbt.io)
* for Faunalia (http://www.faunalia.it)
* with funding from Regione Toscana - Settore SISTEMA INFORMATIVO
* TERRITORIALE ED AMBIENTALE - for the project: "Sviluppo strumenti
* software per il trattamento di dati geografici basati su QuantumGIS
* e Postgis (CIG 0494241492)"
*
**********************************************************************/
#pragma once
#include <geos/export.h> // for GEOS_DLL
#include <vector>
// Forward declarations
namespace geos {
namespace geom {
class LineString;
class Geometry;
class GeometryFactory;
}
}
namespace geos {
namespace operation { // geos.operation
namespace sharedpaths { // geos.operation.sharedpaths
class GEOS_DLL SharedPathsOp {
public:
typedef std::vector<geom::LineString*> PathList;
static void sharedPathsOp(const geom::Geometry& g1,
const geom::Geometry& g2,
PathList& sameDirection,
PathList& oppositeDirection);
SharedPathsOp(const geom::Geometry& g1, const geom::Geometry& g2);
void getSharedPaths(PathList& sameDirection, PathList& oppositeDirection);
static void clearEdges(PathList& from);
private:
void findLinearIntersections(PathList& to);
bool isForward(const geom::LineString& edge,
const geom::Geometry& geom);
bool
isSameDirection(const geom::LineString& edge)
{
return (isForward(edge, _g1) == isForward(edge, _g2));
}
void checkLinealInput(const geom::Geometry& g);
const geom::Geometry& _g1;
const geom::Geometry& _g2;
const geom::GeometryFactory& _gf;
// Declare type as noncopyable
SharedPathsOp(const SharedPathsOp& other) = delete;
SharedPathsOp& operator=(const SharedPathsOp& rhs) = delete;
};
} // namespace geos.operation.sharedpaths
} // namespace geos.operation
} // namespace geos
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::LineString
Definition LineString.h:66
geos::operation::sharedpaths::SharedPathsOp
Find shared paths among two linear Geometry objects.
Definition SharedPathsOp.h:65
geos::operation::sharedpaths::SharedPathsOp::sharedPathsOp
static void sharedPathsOp(const geom::Geometry &g1, const geom::Geometry &g2, PathList &sameDirection, PathList &oppositeDirection)
geos::operation::sharedpaths::SharedPathsOp::PathList
std::vector< geom::LineString * > PathList
LineString vector (list of edges).
Definition SharedPathsOp.h:69
geos::operation::sharedpaths::SharedPathsOp::getSharedPaths
void getSharedPaths(PathList &sameDirection, PathList &oppositeDirection)
geos::operation::sharedpaths::SharedPathsOp::clearEdges
static void clearEdges(PathList &from)
Delete all edges in the list.
geos::operation::sharedpaths::SharedPathsOp::SharedPathsOp
SharedPathsOp(const geom::Geometry &g1, const geom::Geometry &g2)
geos::geom
Definition Angle.h:26
geos::operation::sharedpaths
Find shared paths among two linear Geometry objects.
Definition namespaces.h:283
geos::operation
Provides classes for implementing operations on geometries.
Definition CleanCoverage.h:34
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38