File: overlaps_gc.cpp

package info (click to toggle)
boost1.88 1.88.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 576,932 kB
  • sloc: cpp: 4,149,234; xml: 136,789; ansic: 35,092; python: 33,910; asm: 5,698; sh: 4,604; ada: 1,681; makefile: 1,633; pascal: 1,139; perl: 1,124; sql: 640; yacc: 478; ruby: 271; java: 77; lisp: 24; csh: 6
file content (58 lines) | stat: -rw-r--r-- 2,416 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Boost.Geometry

// Copyright (c) 2022 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle

// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#include "test_overlaps.hpp"

using pt_t = bg::model::point<double, 2, bg::cs::cartesian>;
using ls_t = bg::model::linestring<pt_t>;
using po_t = bg::model::polygon<pt_t>;
using mpt_t = bg::model::multi_point<pt_t>;
using mls_t = bg::model::multi_linestring<ls_t>;
using mpo_t = bg::model::multi_polygon<po_t>;
using var_t = boost::variant<pt_t, ls_t, po_t, mpt_t, mls_t, mpo_t>;
//using var_t = boost::variant2::variant<pt_t, ls_t, po_t, mpt_t, mls_t, mpo_t>;
using gc_t = bg::model::geometry_collection<var_t>;

void test_gc()
{
    test_geometry<gc_t, gc_t>("GEOMETRYCOLLECTION(MULTIPOINT(0 0,1 1,2 2))",
                              "GEOMETRYCOLLECTION(MULTIPOINT(1 1,3 3,4 4))",
                              true);
    test_geometry<gc_t, gc_t>("GEOMETRYCOLLECTION(MULTIPOINT(0 0,1 1,2 2))",
                              "GEOMETRYCOLLECTION(MULTIPOINT(1 1,2 2))",
                              false);

    test_geometry<gc_t, gc_t>("GEOMETRYCOLLECTION(POINT(0 0), POINT(1 1), POINT(2 2))",
                              "GEOMETRYCOLLECTION(POINT(1 1), POINT(3 3), POINT(4 4))",
                              true);
    test_geometry<gc_t, gc_t>("GEOMETRYCOLLECTION(POINT(0 0), POINT(1 1), POINT(2 2))",
                              "GEOMETRYCOLLECTION(POINT(1 1), POINT(2 2))",
                              false);

    test_geometry<mpt_t, gc_t>("MULTIPOINT(0 0,1 1,2 2)",
                               "GEOMETRYCOLLECTION(MULTIPOINT(1 1,3 3,4 4))",
                               true);
    test_geometry<gc_t, mpt_t>("GEOMETRYCOLLECTION(MULTIPOINT(0 0,1 1,2 2))",
                               "MULTIPOINT(1 1,2 2)",
                               false);

    test_geometry<gc_t, mpt_t>("GEOMETRYCOLLECTION(MULTIPOINT(0 0,1 1,2 2))",
                               "MULTIPOINT(1 1,3 3,4 4)",
                               true);
    test_geometry<mpt_t, gc_t>("MULTIPOINT(0 0,1 1,2 2)",
                               "GEOMETRYCOLLECTION(MULTIPOINT(1 1,2 2))",
                               false);
}

int test_main(int , char* [])
{
    test_gc();

    return 0;
}