GEOS 3.14.0dev
LineStringExtracter.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (c) 2024 Martin Davis
7 * Copyright (C) 2024 Paul Ramsey <pramsey@cleverelephant.ca>
8 *
9 * This is free software; you can redistribute and/or modify it under
10 * the terms of the GNU Lesser General Public Licence as published
11 * by the Free Software Foundation.
12 * See the COPYING file for more information.
13 *
14 **********************************************************************/
15
16#pragma once
17
18#include <geos/geom/GeometryFilter.h>
19#include <geos/export.h>
20
21#include <memory>
22#include <vector>
23
24// Forward declarations
25namespace geos {
26namespace geom {
27 class LineString;
28 class Geometry;
29}
30}
31
32namespace geos { // geos.
33namespace operation { // geos.operation
34namespace relateng { // geos.operation.relateng
35
36
37class GEOS_DLL LineStringExtracter : public geos::geom::GeometryFilter {
38 using LineString = geos::geom::LineString;
39 using Geometry = geos::geom::Geometry;
40
41private:
42
43 std::vector<const LineString*>& comps;
44
45
46public:
47
48 LineStringExtracter(std::vector<const LineString*>& p_comps)
49 : comps(p_comps)
50 {}
51
52 void filter_ro(const geom::Geometry* geom) override;
53
54 static void getLines(const Geometry* geom, std::vector<const LineString*>& lines);
55
56 static std::vector<const LineString*> getLines(const Geometry* geom);
57
65 // static std::unique_ptr<Geometry> getGeometry(const Geometry* geom);
66
67};
68
69
70} // namespace geos.operation.relateng
71} // namespace geos.operation
72} // namespace geos
73
Geometry classes support the concept of applying a Geometry filter to the Geometry.
Definition GeometryFilter.h:45
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:197
Definition LineString.h:66
Basic namespace for all GEOS functionalities.
Definition geos.h:39