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