GEOS 3.14.0dev
GeometryTypeName.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2024 ISciences, LLC
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
17namespace geos {
18namespace geom {
19
20class Curve;
21class CurvePolygon;
22class GeometryCollection;
23class LineString;
24class LinearRing;
25class MultiCurve;
26class MultiLineString;
27class MultiPoint;
28class MultiPolygon;
29class MultiSurface;
30class Point;
31class Polygon;
32class SimpleCurve;
33class Surface;
34
35// These structures allow templates to have compile-time access to a type's human-readable name.
36template<typename T>
37struct GeometryTypeName {};
38
39template<>
40struct GeometryTypeName<geom::Curve> {
41 static constexpr const char* name = "Curve";
42};
43
44template<>
45struct GeometryTypeName<geom::CurvePolygon> {
46 static constexpr const char* name = "CurvePolygon";
47};
48
49template<>
50struct GeometryTypeName<geom::GeometryCollection> {
51 static constexpr const char* name = "GeometryCollection";
52};
53
54template<>
55struct GeometryTypeName<geom::LineString> {
56 static constexpr const char* name = "LineString";
57};
58
59template<>
60struct GeometryTypeName<geom::LinearRing> {
61 static constexpr const char* name = "LinearRing";
62};
63
64template<>
65struct GeometryTypeName<geom::MultiCurve> {
66 static constexpr const char* name = "MultiCurve";
67};
68
69template<>
70struct GeometryTypeName<geom::MultiLineString> {
71 static constexpr const char* name = "MultiLineString";
72};
73
74template<>
75struct GeometryTypeName<geom::MultiPoint> {
76 static constexpr const char* name = "MultiPoint";
77};
78
79template<>
80struct GeometryTypeName<geom::MultiPolygon> {
81 static constexpr const char* name = "MultiPolygon";
82};
83
84template<>
85struct GeometryTypeName<geom::MultiSurface> {
86 static constexpr const char* name = "MultiSurface";
87};
88
89template<>
90struct GeometryTypeName<geom::Point> {
91 static constexpr const char* name = "Point";
92};
93
94template<>
95struct GeometryTypeName<geom::Polygon> {
96 static constexpr const char* name = "Polygon";
97};
98
99template<>
100struct GeometryTypeName<geom::SimpleCurve> {
101 static constexpr const char* name = "SimpleCurve";
102};
103
104template<>
105struct GeometryTypeName<geom::Surface> {
106 static constexpr const char* name = "Surface";
107};
108
109}
110}
Basic namespace for all GEOS functionalities.
Definition geos.h:39