00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef GEOS_OP_LINEMERGE_LINEMERGER_H
00020 #define GEOS_OP_LINEMERGE_LINEMERGER_H
00021
00022 #include <geos/export.h>
00023 #include <geos/operation/linemerge/LineMergeGraph.h>
00024
00025 #include <vector>
00026
00027 #ifdef _MSC_VER
00028 #pragma warning(push)
00029 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
00030 #endif
00031
00032
00033 namespace geos {
00034 namespace geom {
00035 class LineString;
00036 class GeometryFactory;
00037 class Geometry;
00038 }
00039 namespace planargraph {
00040 class Node;
00041 }
00042 namespace operation {
00043 namespace linemerge {
00044 class EdgeString;
00045 class LineMergeDirectedEdge;
00046 }
00047 }
00048 }
00049
00050
00051 namespace geos {
00052 namespace operation {
00053 namespace linemerge {
00054
00075 class GEOS_DLL LineMerger {
00076
00077 private:
00078
00079 LineMergeGraph graph;
00080
00081 std::vector<geom::LineString*> *mergedLineStrings;
00082
00083 std::vector<EdgeString*> edgeStrings;
00084
00085 const geom::GeometryFactory *factory;
00086
00087 void merge();
00088
00089 void buildEdgeStringsForObviousStartNodes();
00090
00091 void buildEdgeStringsForIsolatedLoops();
00092
00093 void buildEdgeStringsForUnprocessedNodes();
00094
00095 void buildEdgeStringsForNonDegree2Nodes();
00096
00097 void buildEdgeStringsStartingAt(planargraph::Node *node);
00098
00099 EdgeString* buildEdgeStringStartingWith(LineMergeDirectedEdge *start);
00100
00101 public:
00102 LineMerger();
00103 ~LineMerger();
00104
00113 void add(std::vector<geom::Geometry*> *geometries);
00114
00123 void add(const geom::Geometry *geometry);
00124
00131 std::vector<geom::LineString*>* getMergedLineStrings();
00132
00133 void add(const geom::LineString *lineString);
00134
00135 };
00136
00137 }
00138 }
00139 }
00140
00141 #ifdef _MSC_VER
00142 #pragma warning(pop)
00143 #endif
00144
00145 #endif // GEOS_OP_LINEMERGE_LINEMERGER_H