Coverage Report

Created: 2025-08-25 06:57

/src/geos/include/geos/operation/union/UnionStrategy.h
Line
Count
Source
1
/**********************************************************************
2
 *
3
 * GEOS - Geometry Engine Open Source
4
 * http://geos.osgeo.org
5
 *
6
 * Copyright (C) 2020 Paul Ramsey <pramsey@cleverelephant.ca>
7
 *
8
 * This is free software; you can redistribute and/or modify it under
9
 * the terms of the GNU Lesser General Public Licence as published
10
 * by the Free Software Foundation.
11
 * See the COPYING file for more information.
12
 *
13
 **********************************************************************/
14
15
#pragma once
16
17
#include <geos/export.h>
18
19
#include <memory>
20
21
22
// Forward declarations
23
namespace geos {
24
namespace geom {
25
class Geometry;
26
}
27
}
28
29
namespace geos {
30
namespace operation { // geos::operation
31
namespace geounion {  // geos::operation::geounion
32
33
/**
34
 * A strategy class that adapts UnaryUnion to different
35
 * kinds of overlay algorithms.
36
 *
37
 * @author Martin Davis
38
 *
39
 */
40
class GEOS_DLL UnionStrategy {
41
42
public:
43
44
72.5k
    virtual ~UnionStrategy() {};
45
46
    /**
47
    * Computes the union of two geometries.
48
    * This method may throw a {@link util::TopologyException}
49
    * if one is encountered
50
    */
51
    virtual std::unique_ptr<geom::Geometry> Union(const geom::Geometry*, const geom::Geometry*) = 0;
52
53
    virtual std::unique_ptr<geom::Geometry> Union(std::unique_ptr<geom::Geometry> &&,
54
                                                  std::unique_ptr<geom::Geometry> &&);
55
56
    /**
57
    * Indicates whether the union function operates using
58
    * a floating (full) precision model.
59
    * If this is the case, then the unary union code
60
    * can make use of the operation::union::OverlapUnion performance optimization,
61
    * and perhaps other optimizations as well.
62
    * Otherwise, the union result extent may not be the same as the extent of the inputs,
63
    * which prevents using some optimizations.
64
    */
65
    virtual bool isFloatingPrecision() const = 0;
66
67
68
};
69
70
} // namespace geos::operation::geounion
71
} // namespace geos::operation
72
} // namespace geos
73