Coverage Report

Created: 2024-11-18 10:37

/root/doris/be/src/geo/geo_common.cpp
Line
Count
Source (jump to first uncovered line)
1
// Licensed to the Apache Software Foundation (ASF) under one
2
// or more contributor license agreements.  See the NOTICE file
3
// distributed with this work for additional information
4
// regarding copyright ownership.  The ASF licenses this file
5
// to you under the Apache License, Version 2.0 (the
6
// "License"); you may not use this file except in compliance
7
// with the License.  You may obtain a copy of the License at
8
//
9
//   http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing,
12
// software distributed under the License is distributed on an
13
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
// KIND, either express or implied.  See the License for the
15
// specific language governing permissions and limitations
16
// under the License.
17
18
#include "geo/geo_common.h"
19
20
namespace doris {
21
22
0
std::string to_string(GeoParseStatus status) {
23
0
    switch (status) {
24
0
    case GEO_PARSE_OK:
25
0
        return "OK";
26
0
    case GEO_PARSE_COORD_INVALID:
27
0
        return "Coordinate invalid";
28
0
    case GEO_PARSE_LOOP_NOT_CLOSED:
29
0
        return "Loop is not closed";
30
0
    case GEO_PARSE_LOOP_LACK_VERTICES:
31
0
        return "Loop lack enough vertices";
32
0
    case GEO_PARSE_LOOP_INVALID:
33
0
        return "Loop invalid";
34
0
    case GEO_PARSE_POLYGON_NOT_HOLE:
35
0
        return "Loop not contained in the first loop";
36
0
    case GEO_PARSE_POLYLINE_LACK_VERTICES:
37
0
        return "Line string lack vertices";
38
0
    case GEO_PARSE_POLYLINE_INVALID:
39
0
        return "Line string invalid";
40
0
    case GEO_PARSE_CIRCLE_INVALID:
41
0
        return "Circle invalid";
42
0
    case GEO_PARSE_WKT_SYNTAX_ERROR:
43
0
        return "WKT syntax error";
44
0
    default:
45
0
        return "Unknown";
46
0
    }
47
0
}
48
49
0
std::ostream& operator<<(std::ostream& os, GeoParseStatus status) {
50
0
    os << to_string(status);
51
0
    return os;
52
0
}
53
54
} // namespace doris