/src/proj/src/iso19111/static.cpp
Line | Count | Source |
1 | | /****************************************************************************** |
2 | | * |
3 | | * Project: PROJ |
4 | | * Purpose: ISO19111:2019 implementation |
5 | | * Author: Even Rouault <even dot rouault at spatialys dot com> |
6 | | * |
7 | | ****************************************************************************** |
8 | | * Copyright (c) 2018, Even Rouault <even dot rouault at spatialys dot com> |
9 | | * |
10 | | * Permission is hereby granted, free of charge, to any person obtaining a |
11 | | * copy of this software and associated documentation files (the "Software"), |
12 | | * to deal in the Software without restriction, including without limitation |
13 | | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
14 | | * and/or sell copies of the Software, and to permit persons to whom the |
15 | | * Software is furnished to do so, subject to the following conditions: |
16 | | * |
17 | | * The above copyright notice and this permission notice shall be included |
18 | | * in all copies or substantial portions of the Software. |
19 | | * |
20 | | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
21 | | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
22 | | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
23 | | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
24 | | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
25 | | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
26 | | * DEALINGS IN THE SOFTWARE. |
27 | | ****************************************************************************/ |
28 | | |
29 | | #ifndef FROM_PROJ_CPP |
30 | | #define FROM_PROJ_CPP |
31 | | #endif |
32 | | |
33 | | #include "proj/common.hpp" |
34 | | #include "proj/coordinateoperation.hpp" |
35 | | #include "proj/coordinatesystem.hpp" |
36 | | #include "proj/crs.hpp" |
37 | | #include "proj/datum.hpp" |
38 | | #include "proj/io.hpp" |
39 | | #include "proj/metadata.hpp" |
40 | | #include "proj/util.hpp" |
41 | | |
42 | | #include "operation/oputils.hpp" |
43 | | #include "proj/internal/coordinatesystem_internal.hpp" |
44 | | #include "proj/internal/io_internal.hpp" |
45 | | |
46 | | #include <map> |
47 | | #include <set> |
48 | | #include <string> |
49 | | |
50 | | #ifndef M_PI |
51 | | #define M_PI 3.14159265358979323846 |
52 | | #endif |
53 | | |
54 | | // We put all static definitions in the same compilation unit, and in |
55 | | // increasing order of dependency, to avoid the "static initialization fiasco" |
56 | | // See https://isocpp.org/wiki/faq/ctors#static-init-order |
57 | | |
58 | | using namespace NS_PROJ::crs; |
59 | | using namespace NS_PROJ::datum; |
60 | | using namespace NS_PROJ::io; |
61 | | using namespace NS_PROJ::metadata; |
62 | | using namespace NS_PROJ::operation; |
63 | | using namespace NS_PROJ::util; |
64 | | |
65 | | NS_PROJ_START |
66 | | |
67 | | // --------------------------------------------------------------------------- |
68 | | |
69 | | const NameSpaceNNPtr NameSpace::GLOBAL(NameSpace::createGLOBAL()); |
70 | | |
71 | | // --------------------------------------------------------------------------- |
72 | | |
73 | | /** \brief Key to set the authority citation of a metadata::Identifier. |
74 | | * |
75 | | * The value is to be provided as a string or a metadata::Citation. |
76 | | */ |
77 | | const std::string Identifier::AUTHORITY_KEY("authority"); |
78 | | |
79 | | /** \brief Key to set the code of a metadata::Identifier. |
80 | | * |
81 | | * The value is to be provided as a integer or a string. |
82 | | */ |
83 | | const std::string Identifier::CODE_KEY("code"); |
84 | | |
85 | | /** \brief Key to set the organization responsible for definition and |
86 | | * maintenance of the code of a metadata::Identifier. |
87 | | * |
88 | | * The value is to be provided as a string. |
89 | | */ |
90 | | const std::string Identifier::CODESPACE_KEY("codespace"); |
91 | | |
92 | | /** \brief Key to set the version identifier for the namespace of a |
93 | | * metadata::Identifier. |
94 | | * |
95 | | * The value is to be provided as a string. |
96 | | */ |
97 | | const std::string Identifier::VERSION_KEY("version"); |
98 | | |
99 | | /** \brief Key to set the natural language description of the meaning of the |
100 | | * code value of a metadata::Identifier. |
101 | | * |
102 | | * The value is to be provided as a string. |
103 | | */ |
104 | | const std::string Identifier::DESCRIPTION_KEY("description"); |
105 | | |
106 | | /** \brief Key to set the URI of a metadata::Identifier. |
107 | | * |
108 | | * The value is to be provided as a string. |
109 | | */ |
110 | | const std::string Identifier::URI_KEY("uri"); |
111 | | |
112 | | /** \brief EPSG codespace. |
113 | | */ |
114 | | const std::string Identifier::EPSG("EPSG"); |
115 | | |
116 | | /** \brief OGC codespace. |
117 | | */ |
118 | | const std::string Identifier::OGC("OGC"); |
119 | | |
120 | | // --------------------------------------------------------------------------- |
121 | | |
122 | | /** \brief Key to set the name of a common::IdentifiedObject |
123 | | * |
124 | | * The value is to be provided as a string or metadata::IdentifierNNPtr. |
125 | | */ |
126 | | const std::string common::IdentifiedObject::NAME_KEY("name"); |
127 | | |
128 | | /** \brief Key to set the identifier(s) of a common::IdentifiedObject |
129 | | * |
130 | | * The value is to be provided as a common::IdentifierNNPtr or a |
131 | | * util::ArrayOfBaseObjectNNPtr |
132 | | * of common::IdentifierNNPtr. |
133 | | */ |
134 | | const std::string common::IdentifiedObject::IDENTIFIERS_KEY("identifiers"); |
135 | | |
136 | | /** \brief Key to set the alias(es) of a common::IdentifiedObject |
137 | | * |
138 | | * The value is to be provided as string, a util::GenericNameNNPtr or a |
139 | | * util::ArrayOfBaseObjectNNPtr |
140 | | * of util::GenericNameNNPtr. |
141 | | */ |
142 | | const std::string common::IdentifiedObject::ALIAS_KEY("alias"); |
143 | | |
144 | | /** \brief Key to set the remarks of a common::IdentifiedObject |
145 | | * |
146 | | * The value is to be provided as a string. |
147 | | */ |
148 | | const std::string common::IdentifiedObject::REMARKS_KEY("remarks"); |
149 | | |
150 | | /** \brief Key to set the deprecation flag of a common::IdentifiedObject |
151 | | * |
152 | | * The value is to be provided as a boolean. |
153 | | */ |
154 | | const std::string common::IdentifiedObject::DEPRECATED_KEY("deprecated"); |
155 | | |
156 | | // --------------------------------------------------------------------------- |
157 | | |
158 | | /** \brief Key to set the scope of a common::ObjectUsage |
159 | | * |
160 | | * The value is to be provided as a string. |
161 | | */ |
162 | | const std::string common::ObjectUsage::SCOPE_KEY("scope"); |
163 | | |
164 | | /** \brief Key to set the domain of validity of a common::ObjectUsage |
165 | | * |
166 | | * The value is to be provided as a common::ExtentNNPtr. |
167 | | */ |
168 | | const std::string |
169 | | common::ObjectUsage::DOMAIN_OF_VALIDITY_KEY("domainOfValidity"); |
170 | | |
171 | | /** \brief Key to set the object domain(s) of a common::ObjectUsage |
172 | | * |
173 | | * The value is to be provided as a common::ObjectDomainNNPtr or a |
174 | | * util::ArrayOfBaseObjectNNPtr |
175 | | * of common::ObjectDomainNNPtr. |
176 | | */ |
177 | | const std::string common::ObjectUsage::OBJECT_DOMAIN_KEY("objectDomain"); |
178 | | |
179 | | // --------------------------------------------------------------------------- |
180 | | |
181 | | /** \brief World extent. */ |
182 | | const ExtentNNPtr |
183 | | Extent::WORLD(Extent::createFromBBOX(-180, -90, 180, 90, |
184 | | util::optional<std::string>("World"))); |
185 | | |
186 | | // --------------------------------------------------------------------------- |
187 | | |
188 | | //! @cond Doxygen_Suppress |
189 | | |
190 | | std::vector<std::string> WKTConstants::constants_; |
191 | | |
192 | 210 | const char *WKTConstants::createAndAddToConstantList(const char *text) { |
193 | 210 | WKTConstants::constants_.push_back(text); |
194 | 210 | return text; |
195 | 210 | } |
196 | | |
197 | | #define DEFINE_WKT_CONSTANT(x) \ |
198 | | const std::string WKTConstants::x(createAndAddToConstantList(#x)) |
199 | | |
200 | | DEFINE_WKT_CONSTANT(GEOCCS); |
201 | | DEFINE_WKT_CONSTANT(GEOGCS); |
202 | | DEFINE_WKT_CONSTANT(DATUM); |
203 | | DEFINE_WKT_CONSTANT(UNIT); |
204 | | DEFINE_WKT_CONSTANT(SPHEROID); |
205 | | DEFINE_WKT_CONSTANT(AXIS); |
206 | | DEFINE_WKT_CONSTANT(PRIMEM); |
207 | | DEFINE_WKT_CONSTANT(AUTHORITY); |
208 | | DEFINE_WKT_CONSTANT(PROJCS); |
209 | | DEFINE_WKT_CONSTANT(PROJECTION); |
210 | | DEFINE_WKT_CONSTANT(PARAMETER); |
211 | | DEFINE_WKT_CONSTANT(VERT_CS); |
212 | | DEFINE_WKT_CONSTANT(VERTCS); |
213 | | DEFINE_WKT_CONSTANT(VERT_DATUM); |
214 | | DEFINE_WKT_CONSTANT(COMPD_CS); |
215 | | DEFINE_WKT_CONSTANT(TOWGS84); |
216 | | DEFINE_WKT_CONSTANT(EXTENSION); |
217 | | DEFINE_WKT_CONSTANT(LOCAL_CS); |
218 | | DEFINE_WKT_CONSTANT(LOCAL_DATUM); |
219 | | DEFINE_WKT_CONSTANT(LINUNIT); |
220 | | |
221 | | DEFINE_WKT_CONSTANT(GEODCRS); |
222 | | DEFINE_WKT_CONSTANT(LENGTHUNIT); |
223 | | DEFINE_WKT_CONSTANT(ANGLEUNIT); |
224 | | DEFINE_WKT_CONSTANT(SCALEUNIT); |
225 | | DEFINE_WKT_CONSTANT(TIMEUNIT); |
226 | | DEFINE_WKT_CONSTANT(ELLIPSOID); |
227 | | const std::string WKTConstants::CS_(createAndAddToConstantList("CS")); |
228 | | DEFINE_WKT_CONSTANT(ID); |
229 | | DEFINE_WKT_CONSTANT(PROJCRS); |
230 | | DEFINE_WKT_CONSTANT(BASEGEODCRS); |
231 | | DEFINE_WKT_CONSTANT(MERIDIAN); |
232 | | DEFINE_WKT_CONSTANT(ORDER); |
233 | | DEFINE_WKT_CONSTANT(ANCHOR); |
234 | | DEFINE_WKT_CONSTANT(ANCHOREPOCH); |
235 | | DEFINE_WKT_CONSTANT(CONVERSION); |
236 | | DEFINE_WKT_CONSTANT(METHOD); |
237 | | DEFINE_WKT_CONSTANT(REMARK); |
238 | | DEFINE_WKT_CONSTANT(GEOGCRS); |
239 | | DEFINE_WKT_CONSTANT(BASEGEOGCRS); |
240 | | DEFINE_WKT_CONSTANT(SCOPE); |
241 | | DEFINE_WKT_CONSTANT(AREA); |
242 | | DEFINE_WKT_CONSTANT(BBOX); |
243 | | DEFINE_WKT_CONSTANT(CITATION); |
244 | | DEFINE_WKT_CONSTANT(URI); |
245 | | DEFINE_WKT_CONSTANT(VERTCRS); |
246 | | DEFINE_WKT_CONSTANT(VDATUM); |
247 | | DEFINE_WKT_CONSTANT(COMPOUNDCRS); |
248 | | DEFINE_WKT_CONSTANT(PARAMETERFILE); |
249 | | DEFINE_WKT_CONSTANT(COORDINATEOPERATION); |
250 | | DEFINE_WKT_CONSTANT(SOURCECRS); |
251 | | DEFINE_WKT_CONSTANT(TARGETCRS); |
252 | | DEFINE_WKT_CONSTANT(INTERPOLATIONCRS); |
253 | | DEFINE_WKT_CONSTANT(OPERATIONACCURACY); |
254 | | DEFINE_WKT_CONSTANT(CONCATENATEDOPERATION); |
255 | | DEFINE_WKT_CONSTANT(STEP); |
256 | | DEFINE_WKT_CONSTANT(BOUNDCRS); |
257 | | DEFINE_WKT_CONSTANT(ABRIDGEDTRANSFORMATION); |
258 | | DEFINE_WKT_CONSTANT(DERIVINGCONVERSION); |
259 | | DEFINE_WKT_CONSTANT(TDATUM); |
260 | | DEFINE_WKT_CONSTANT(CALENDAR); |
261 | | DEFINE_WKT_CONSTANT(TIMEORIGIN); |
262 | | DEFINE_WKT_CONSTANT(TIMECRS); |
263 | | DEFINE_WKT_CONSTANT(VERTICALEXTENT); |
264 | | DEFINE_WKT_CONSTANT(TIMEEXTENT); |
265 | | DEFINE_WKT_CONSTANT(USAGE); |
266 | | DEFINE_WKT_CONSTANT(DYNAMIC); |
267 | | DEFINE_WKT_CONSTANT(FRAMEEPOCH); |
268 | | DEFINE_WKT_CONSTANT(MODEL); |
269 | | DEFINE_WKT_CONSTANT(VELOCITYGRID); |
270 | | DEFINE_WKT_CONSTANT(ENSEMBLE); |
271 | | DEFINE_WKT_CONSTANT(MEMBER); |
272 | | DEFINE_WKT_CONSTANT(ENSEMBLEACCURACY); |
273 | | DEFINE_WKT_CONSTANT(DERIVEDPROJCRS); |
274 | | DEFINE_WKT_CONSTANT(BASEPROJCRS); |
275 | | DEFINE_WKT_CONSTANT(EDATUM); |
276 | | DEFINE_WKT_CONSTANT(ENGCRS); |
277 | | DEFINE_WKT_CONSTANT(PDATUM); |
278 | | DEFINE_WKT_CONSTANT(PARAMETRICCRS); |
279 | | DEFINE_WKT_CONSTANT(PARAMETRICUNIT); |
280 | | DEFINE_WKT_CONSTANT(BASEVERTCRS); |
281 | | DEFINE_WKT_CONSTANT(BASEENGCRS); |
282 | | DEFINE_WKT_CONSTANT(BASEPARAMCRS); |
283 | | DEFINE_WKT_CONSTANT(BASETIMECRS); |
284 | | DEFINE_WKT_CONSTANT(VERSION); |
285 | | DEFINE_WKT_CONSTANT(GEOIDMODEL); |
286 | | DEFINE_WKT_CONSTANT(COORDINATEMETADATA); |
287 | | DEFINE_WKT_CONSTANT(EPOCH); |
288 | | DEFINE_WKT_CONSTANT(AXISMINVALUE); |
289 | | DEFINE_WKT_CONSTANT(AXISMAXVALUE); |
290 | | DEFINE_WKT_CONSTANT(RANGEMEANING); |
291 | | DEFINE_WKT_CONSTANT(POINTMOTIONOPERATION); |
292 | | |
293 | | DEFINE_WKT_CONSTANT(GEODETICCRS); |
294 | | DEFINE_WKT_CONSTANT(GEODETICDATUM); |
295 | | DEFINE_WKT_CONSTANT(PROJECTEDCRS); |
296 | | DEFINE_WKT_CONSTANT(PRIMEMERIDIAN); |
297 | | DEFINE_WKT_CONSTANT(GEOGRAPHICCRS); |
298 | | DEFINE_WKT_CONSTANT(TRF); |
299 | | DEFINE_WKT_CONSTANT(VERTICALCRS); |
300 | | DEFINE_WKT_CONSTANT(VERTICALDATUM); |
301 | | DEFINE_WKT_CONSTANT(VRF); |
302 | | DEFINE_WKT_CONSTANT(TIMEDATUM); |
303 | | DEFINE_WKT_CONSTANT(TEMPORALQUANTITY); |
304 | | DEFINE_WKT_CONSTANT(ENGINEERINGDATUM); |
305 | | DEFINE_WKT_CONSTANT(ENGINEERINGCRS); |
306 | | DEFINE_WKT_CONSTANT(PARAMETRICDATUM); |
307 | | |
308 | | //! @endcond |
309 | | |
310 | | // --------------------------------------------------------------------------- |
311 | | |
312 | | namespace common { |
313 | | |
314 | | /** \brief "Empty"/"None", unit of measure of type NONE. */ |
315 | | const UnitOfMeasure UnitOfMeasure::NONE("", 1.0, UnitOfMeasure::Type::NONE); |
316 | | |
317 | | /** \brief Scale unity, unit of measure of type SCALE. */ |
318 | | const UnitOfMeasure UnitOfMeasure::SCALE_UNITY("unity", 1.0, |
319 | | UnitOfMeasure::Type::SCALE, |
320 | | Identifier::EPSG, "9201"); |
321 | | |
322 | | /** \brief Parts-per-million, unit of measure of type SCALE. */ |
323 | | const UnitOfMeasure UnitOfMeasure::PARTS_PER_MILLION("parts per million", 1e-6, |
324 | | UnitOfMeasure::Type::SCALE, |
325 | | Identifier::EPSG, "9202"); |
326 | | |
327 | | /** \brief Metre, unit of measure of type LINEAR (SI unit). */ |
328 | | const UnitOfMeasure UnitOfMeasure::METRE("metre", 1.0, |
329 | | UnitOfMeasure::Type::LINEAR, |
330 | | Identifier::EPSG, "9001"); |
331 | | |
332 | | /** \brief Foot, unit of measure of type LINEAR. */ |
333 | | const UnitOfMeasure UnitOfMeasure::FOOT("foot", 0.3048, |
334 | | UnitOfMeasure::Type::LINEAR, |
335 | | Identifier::EPSG, "9002"); |
336 | | |
337 | | /** \brief US survey foot, unit of measure of type LINEAR. */ |
338 | | const UnitOfMeasure UnitOfMeasure::US_FOOT("US survey foot", |
339 | | 0.304800609601219241184, |
340 | | UnitOfMeasure::Type::LINEAR, |
341 | | Identifier::EPSG, "9003"); |
342 | | |
343 | | /** \brief Degree, unit of measure of type ANGULAR. */ |
344 | | const UnitOfMeasure UnitOfMeasure::DEGREE("degree", M_PI / 180., |
345 | | UnitOfMeasure::Type::ANGULAR, |
346 | | Identifier::EPSG, "9122"); |
347 | | |
348 | | /** \brief Arc-second, unit of measure of type ANGULAR. */ |
349 | | const UnitOfMeasure UnitOfMeasure::ARC_SECOND("arc-second", M_PI / 180. / 3600., |
350 | | UnitOfMeasure::Type::ANGULAR, |
351 | | Identifier::EPSG, "9104"); |
352 | | |
353 | | /** \brief Grad, unit of measure of type ANGULAR. */ |
354 | | const UnitOfMeasure UnitOfMeasure::GRAD("grad", M_PI / 200., |
355 | | UnitOfMeasure::Type::ANGULAR, |
356 | | Identifier::EPSG, "9105"); |
357 | | |
358 | | /** \brief Radian, unit of measure of type ANGULAR (SI unit). */ |
359 | | const UnitOfMeasure UnitOfMeasure::RADIAN("radian", 1.0, |
360 | | UnitOfMeasure::Type::ANGULAR, |
361 | | Identifier::EPSG, "9101"); |
362 | | |
363 | | /** \brief Microradian, unit of measure of type ANGULAR. */ |
364 | | const UnitOfMeasure UnitOfMeasure::MICRORADIAN("microradian", 1e-6, |
365 | | UnitOfMeasure::Type::ANGULAR, |
366 | | Identifier::EPSG, "9109"); |
367 | | |
368 | | /** \brief Second, unit of measure of type TIME (SI unit). */ |
369 | | const UnitOfMeasure UnitOfMeasure::SECOND("second", 1.0, |
370 | | UnitOfMeasure::Type::TIME, |
371 | | Identifier::EPSG, "1040"); |
372 | | |
373 | | /** \brief Year, unit of measure of type TIME */ |
374 | | const UnitOfMeasure UnitOfMeasure::YEAR("year", 31556925.445, |
375 | | UnitOfMeasure::Type::TIME, |
376 | | Identifier::EPSG, "1029"); |
377 | | |
378 | | /** \brief Metre per year, unit of measure of type LINEAR. */ |
379 | | const UnitOfMeasure UnitOfMeasure::METRE_PER_YEAR("metres per year", |
380 | | 1.0 / 31556925.445, |
381 | | UnitOfMeasure::Type::LINEAR, |
382 | | Identifier::EPSG, "1042"); |
383 | | |
384 | | /** \brief Arc-second per year, unit of measure of type ANGULAR. */ |
385 | | const UnitOfMeasure UnitOfMeasure::ARC_SECOND_PER_YEAR( |
386 | | "arc-seconds per year", M_PI / 180. / 3600. / 31556925.445, |
387 | | UnitOfMeasure::Type::ANGULAR, Identifier::EPSG, "1043"); |
388 | | |
389 | | /** \brief Parts-per-million per year, unit of measure of type SCALE. */ |
390 | | const UnitOfMeasure UnitOfMeasure::PPM_PER_YEAR("parts per million per year", |
391 | | 1e-6 / 31556925.445, |
392 | | UnitOfMeasure::Type::SCALE, |
393 | | Identifier::EPSG, "1036"); |
394 | | |
395 | | } // namespace common |
396 | | |
397 | | // --------------------------------------------------------------------------- |
398 | | |
399 | | namespace cs { |
400 | | std::map<std::string, const AxisDirection *> AxisDirection::registry; |
401 | | |
402 | | /** Axis positive direction is north. In a geodetic or projected CRS, north is |
403 | | * defined through the geodetic reference frame. In an engineering CRS, north |
404 | | * may be defined with respect to an engineering object rather than a |
405 | | * geographical direction. */ |
406 | | const AxisDirection AxisDirection::NORTH("north"); |
407 | | |
408 | | /** Axis positive direction is approximately north-north-east. */ |
409 | | const AxisDirection AxisDirection::NORTH_NORTH_EAST("northNorthEast"); |
410 | | |
411 | | /** Axis positive direction is approximately north-east. */ |
412 | | const AxisDirection AxisDirection::NORTH_EAST("northEast"); |
413 | | |
414 | | /** Axis positive direction is approximately east-north-east. */ |
415 | | const AxisDirection AxisDirection::EAST_NORTH_EAST("eastNorthEast"); |
416 | | |
417 | | /** Axis positive direction is 90deg clockwise from north. */ |
418 | | const AxisDirection AxisDirection::EAST("east"); |
419 | | |
420 | | /** Axis positive direction is approximately east-south-east. */ |
421 | | const AxisDirection AxisDirection::EAST_SOUTH_EAST("eastSouthEast"); |
422 | | |
423 | | /** Axis positive direction is approximately south-east. */ |
424 | | const AxisDirection AxisDirection::SOUTH_EAST("southEast"); |
425 | | |
426 | | /** Axis positive direction is approximately south-south-east. */ |
427 | | const AxisDirection AxisDirection::SOUTH_SOUTH_EAST("southSouthEast"); |
428 | | |
429 | | /** Axis positive direction is 180deg clockwise from north. */ |
430 | | const AxisDirection AxisDirection::SOUTH("south"); |
431 | | |
432 | | /** Axis positive direction is approximately south-south-west. */ |
433 | | const AxisDirection AxisDirection::SOUTH_SOUTH_WEST("southSouthWest"); |
434 | | |
435 | | /** Axis positive direction is approximately south-west. */ |
436 | | const AxisDirection AxisDirection::SOUTH_WEST("southWest"); |
437 | | |
438 | | /** Axis positive direction is approximately west-south-west. */ |
439 | | const AxisDirection AxisDirection::WEST_SOUTH_WEST("westSouthWest"); |
440 | | |
441 | | /** Axis positive direction is 270deg clockwise from north. */ |
442 | | const AxisDirection AxisDirection::WEST("west"); |
443 | | |
444 | | /** Axis positive direction is approximately west-north-west. */ |
445 | | const AxisDirection AxisDirection::WEST_NORTH_WEST("westNorthWest"); |
446 | | |
447 | | /** Axis positive direction is approximately north-west. */ |
448 | | const AxisDirection AxisDirection::NORTH_WEST("northWest"); |
449 | | |
450 | | /** Axis positive direction is approximately north-north-west. */ |
451 | | const AxisDirection AxisDirection::NORTH_NORTH_WEST("northNorthWest"); |
452 | | |
453 | | /** Axis positive direction is up relative to gravity. */ |
454 | | const AxisDirection AxisDirection::UP("up"); |
455 | | |
456 | | /** Axis positive direction is down relative to gravity. */ |
457 | | const AxisDirection AxisDirection::DOWN("down"); |
458 | | |
459 | | /** Axis positive direction is in the equatorial plane from the centre of the |
460 | | * modelled Earth towards the intersection of the equator with the prime |
461 | | * meridian. */ |
462 | | const AxisDirection AxisDirection::GEOCENTRIC_X("geocentricX"); |
463 | | |
464 | | /** Axis positive direction is in the equatorial plane from the centre of the |
465 | | * modelled Earth towards the intersection of the equator and the meridian 90deg |
466 | | * eastwards from the prime meridian. */ |
467 | | const AxisDirection AxisDirection::GEOCENTRIC_Y("geocentricY"); |
468 | | |
469 | | /** Axis positive direction is from the centre of the modelled Earth parallel to |
470 | | * its rotation axis and towards its north pole. */ |
471 | | const AxisDirection AxisDirection::GEOCENTRIC_Z("geocentricZ"); |
472 | | |
473 | | /** Axis positive direction is towards higher pixel column. */ |
474 | | const AxisDirection AxisDirection::COLUMN_POSITIVE("columnPositive"); |
475 | | |
476 | | /** Axis positive direction is towards lower pixel column. */ |
477 | | const AxisDirection AxisDirection::COLUMN_NEGATIVE("columnNegative"); |
478 | | |
479 | | /** Axis positive direction is towards higher pixel row. */ |
480 | | const AxisDirection AxisDirection::ROW_POSITIVE("rowPositive"); |
481 | | |
482 | | /** Axis positive direction is towards lower pixel row. */ |
483 | | const AxisDirection AxisDirection::ROW_NEGATIVE("rowNegative"); |
484 | | |
485 | | /** Axis positive direction is right in display. */ |
486 | | const AxisDirection AxisDirection::DISPLAY_RIGHT("displayRight"); |
487 | | |
488 | | /** Axis positive direction is left in display. */ |
489 | | const AxisDirection AxisDirection::DISPLAY_LEFT("displayLeft"); |
490 | | |
491 | | /** Axis positive direction is towards top of approximately vertical display |
492 | | * surface. */ |
493 | | const AxisDirection AxisDirection::DISPLAY_UP("displayUp"); |
494 | | |
495 | | /** Axis positive direction is towards bottom of approximately vertical display |
496 | | * surface. */ |
497 | | const AxisDirection AxisDirection::DISPLAY_DOWN("displayDown"); |
498 | | |
499 | | /** Axis positive direction is forward; for an observer at the centre of the |
500 | | * object this is will be towards its front, bow or nose. */ |
501 | | const AxisDirection AxisDirection::FORWARD("forward"); |
502 | | |
503 | | /** Axis positive direction is aft; for an observer at the centre of the object |
504 | | * this will be towards its back, stern or tail. */ |
505 | | const AxisDirection AxisDirection::AFT("aft"); |
506 | | |
507 | | /** Axis positive direction is port; for an observer at the centre of the object |
508 | | * this will be towards its left. */ |
509 | | const AxisDirection AxisDirection::PORT("port"); |
510 | | |
511 | | /** Axis positive direction is starboard; for an observer at the centre of the |
512 | | * object this will be towards its right. */ |
513 | | const AxisDirection AxisDirection::STARBOARD("starboard"); |
514 | | |
515 | | /** Axis positive direction is clockwise from a specified direction. */ |
516 | | const AxisDirection AxisDirection::CLOCKWISE("clockwise"); |
517 | | |
518 | | /** Axis positive direction is counter clockwise from a specified direction. */ |
519 | | const AxisDirection AxisDirection::COUNTER_CLOCKWISE("counterClockwise"); |
520 | | |
521 | | /** Axis positive direction is towards the object. */ |
522 | | const AxisDirection AxisDirection::TOWARDS("towards"); |
523 | | |
524 | | /** Axis positive direction is away from the object. */ |
525 | | const AxisDirection AxisDirection::AWAY_FROM("awayFrom"); |
526 | | |
527 | | /** Temporal axis positive direction is towards the future. */ |
528 | | const AxisDirection AxisDirection::FUTURE("future"); |
529 | | |
530 | | /** Temporal axis positive direction is towards the past. */ |
531 | | const AxisDirection AxisDirection::PAST("past"); |
532 | | |
533 | | /** Axis positive direction is unspecified. */ |
534 | | const AxisDirection AxisDirection::UNSPECIFIED("unspecified"); |
535 | | |
536 | | // --------------------------------------------------------------------------- |
537 | | |
538 | | std::map<std::string, const RangeMeaning *> RangeMeaning::registry; |
539 | | |
540 | | /** any value between and including minimumValue and maximumValue is valid. */ |
541 | | const RangeMeaning RangeMeaning::EXACT("exact"); |
542 | | |
543 | | /** Axis is continuous with values wrapping around at the minimumValue and |
544 | | * maximumValue */ |
545 | | const RangeMeaning RangeMeaning::WRAPAROUND("wraparound"); |
546 | | |
547 | | // --------------------------------------------------------------------------- |
548 | | |
549 | | //! @cond Doxygen_Suppress |
550 | | |
551 | | std::map<std::string, const AxisDirectionWKT1 *> AxisDirectionWKT1::registry; |
552 | | |
553 | | const AxisDirectionWKT1 AxisDirectionWKT1::NORTH("NORTH"); |
554 | | const AxisDirectionWKT1 AxisDirectionWKT1::EAST("EAST"); |
555 | | const AxisDirectionWKT1 AxisDirectionWKT1::SOUTH("SOUTH"); |
556 | | const AxisDirectionWKT1 AxisDirectionWKT1::WEST("WEST"); |
557 | | const AxisDirectionWKT1 AxisDirectionWKT1::UP("UP"); |
558 | | const AxisDirectionWKT1 AxisDirectionWKT1::DOWN("DOWN"); |
559 | | const AxisDirectionWKT1 AxisDirectionWKT1::OTHER("OTHER"); |
560 | | |
561 | | //! @endcond |
562 | | |
563 | | // --------------------------------------------------------------------------- |
564 | | |
565 | | //! @cond Doxygen_Suppress |
566 | | const std::string AxisName::Longitude("Longitude"); |
567 | | const std::string AxisName::Latitude("Latitude"); |
568 | | const std::string AxisName::Easting("Easting"); |
569 | | const std::string AxisName::Northing("Northing"); |
570 | | const std::string AxisName::Westing("Westing"); |
571 | | const std::string AxisName::Southing("Southing"); |
572 | | const std::string AxisName::Ellipsoidal_height("Ellipsoidal height"); |
573 | | const std::string AxisName::Geocentric_X("Geocentric X"); |
574 | | const std::string AxisName::Geocentric_Y("Geocentric Y"); |
575 | | const std::string AxisName::Geocentric_Z("Geocentric Z"); |
576 | | //! @endcond |
577 | | |
578 | | // --------------------------------------------------------------------------- |
579 | | |
580 | | //! @cond Doxygen_Suppress |
581 | | const std::string AxisAbbreviation::lon("lon"); |
582 | | const std::string AxisAbbreviation::lat("lat"); |
583 | | const std::string AxisAbbreviation::E("E"); |
584 | | const std::string AxisAbbreviation::N("N"); |
585 | | const std::string AxisAbbreviation::h("h"); |
586 | | const std::string AxisAbbreviation::X("X"); |
587 | | const std::string AxisAbbreviation::Y("Y"); |
588 | | const std::string AxisAbbreviation::Z("Z"); |
589 | | //! @endcond |
590 | | |
591 | | } // namespace cs |
592 | | |
593 | | // --------------------------------------------------------------------------- |
594 | | |
595 | | /** \brief The realization is by adjustment of a levelling network fixed to one |
596 | | * or more tide gauges. */ |
597 | | const RealizationMethod RealizationMethod::LEVELLING("levelling"); |
598 | | /** \brief The realization is through a geoid height model or a height |
599 | | * correction model. This is applied to a specified geodetic CRS. */ |
600 | | const RealizationMethod RealizationMethod::GEOID("geoid"); |
601 | | /** \brief The realization is through a tidal model or by tidal predictions. */ |
602 | | const RealizationMethod RealizationMethod::TIDAL("tidal"); |
603 | | |
604 | | // --------------------------------------------------------------------------- |
605 | | |
606 | | /** \brief The Greenwich PrimeMeridian */ |
607 | | const PrimeMeridianNNPtr |
608 | | PrimeMeridian::GREENWICH(PrimeMeridian::createGREENWICH()); |
609 | | /** \brief The "Reference Meridian" PrimeMeridian. |
610 | | * |
611 | | * This is a meridian of longitude 0 to be used with non-Earth bodies. */ |
612 | | const PrimeMeridianNNPtr PrimeMeridian::REFERENCE_MERIDIAN( |
613 | | PrimeMeridian::createREFERENCE_MERIDIAN()); |
614 | | /** \brief The Paris PrimeMeridian */ |
615 | | const PrimeMeridianNNPtr PrimeMeridian::PARIS(PrimeMeridian::createPARIS()); |
616 | | |
617 | | // --------------------------------------------------------------------------- |
618 | | |
619 | | /** \brief Earth celestial body */ |
620 | | const std::string Ellipsoid::EARTH("Earth"); |
621 | | |
622 | | /** \brief The EPSG:7008 / "Clarke 1866" Ellipsoid */ |
623 | | const EllipsoidNNPtr Ellipsoid::CLARKE_1866(Ellipsoid::createCLARKE_1866()); |
624 | | |
625 | | /** \brief The EPSG:7030 / "WGS 84" Ellipsoid */ |
626 | | const EllipsoidNNPtr Ellipsoid::WGS84(Ellipsoid::createWGS84()); |
627 | | |
628 | | /** \brief The EPSG:7019 / "GRS 1980" Ellipsoid */ |
629 | | const EllipsoidNNPtr Ellipsoid::GRS1980(Ellipsoid::createGRS1980()); |
630 | | |
631 | | // --------------------------------------------------------------------------- |
632 | | |
633 | | /** \brief The EPSG:6267 / "North_American_Datum_1927" GeodeticReferenceFrame */ |
634 | | const GeodeticReferenceFrameNNPtr GeodeticReferenceFrame::EPSG_6267( |
635 | | GeodeticReferenceFrame::createEPSG_6267()); |
636 | | |
637 | | /** \brief The EPSG:6269 / "North_American_Datum_1983" GeodeticReferenceFrame */ |
638 | | const GeodeticReferenceFrameNNPtr GeodeticReferenceFrame::EPSG_6269( |
639 | | GeodeticReferenceFrame::createEPSG_6269()); |
640 | | |
641 | | /** \brief The EPSG:6326 / "WGS_1984" GeodeticReferenceFrame */ |
642 | | const GeodeticReferenceFrameNNPtr GeodeticReferenceFrame::EPSG_6326( |
643 | | GeodeticReferenceFrame::createEPSG_6326()); |
644 | | |
645 | | // --------------------------------------------------------------------------- |
646 | | |
647 | | /** \brief The proleptic Gregorian calendar. */ |
648 | | const std::string |
649 | | TemporalDatum::CALENDAR_PROLEPTIC_GREGORIAN("proleptic Gregorian"); |
650 | | |
651 | | // --------------------------------------------------------------------------- |
652 | | |
653 | | /** \brief EPSG:4978 / "WGS 84" Geocentric */ |
654 | | const GeodeticCRSNNPtr GeodeticCRS::EPSG_4978(GeodeticCRS::createEPSG_4978()); |
655 | | |
656 | | // --------------------------------------------------------------------------- |
657 | | |
658 | | /** \brief EPSG:4267 / "NAD27" 2D GeographicCRS */ |
659 | | const GeographicCRSNNPtr |
660 | | GeographicCRS::EPSG_4267(GeographicCRS::createEPSG_4267()); |
661 | | |
662 | | /** \brief EPSG:4269 / "NAD83" 2D GeographicCRS */ |
663 | | const GeographicCRSNNPtr |
664 | | GeographicCRS::EPSG_4269(GeographicCRS::createEPSG_4269()); |
665 | | |
666 | | /** \brief EPSG:4326 / "WGS 84" 2D GeographicCRS */ |
667 | | const GeographicCRSNNPtr |
668 | | GeographicCRS::EPSG_4326(GeographicCRS::createEPSG_4326()); |
669 | | |
670 | | /** \brief OGC:CRS84 / "CRS 84" 2D GeographicCRS (long, lat)*/ |
671 | | const GeographicCRSNNPtr |
672 | | GeographicCRS::OGC_CRS84(GeographicCRS::createOGC_CRS84()); |
673 | | |
674 | | /** \brief EPSG:4807 / "NTF (Paris)" 2D GeographicCRS */ |
675 | | const GeographicCRSNNPtr |
676 | | GeographicCRS::EPSG_4807(GeographicCRS::createEPSG_4807()); |
677 | | |
678 | | /** \brief EPSG:4979 / "WGS 84" 3D GeographicCRS */ |
679 | | const GeographicCRSNNPtr |
680 | | GeographicCRS::EPSG_4979(GeographicCRS::createEPSG_4979()); |
681 | | |
682 | | // --------------------------------------------------------------------------- |
683 | | |
684 | | /** \brief Key to set the operation version of a operation::CoordinateOperation |
685 | | * |
686 | | * The value is to be provided as a string. |
687 | | */ |
688 | | const std::string |
689 | | operation::CoordinateOperation::OPERATION_VERSION_KEY("operationVersion"); |
690 | | |
691 | | //! @cond Doxygen_Suppress |
692 | | const common::Measure operation::nullMeasure{}; |
693 | | |
694 | | const std::string operation::INVERSE_OF = "Inverse of "; |
695 | | |
696 | | const std::string operation::AXIS_ORDER_CHANGE_2D_NAME = |
697 | | "axis order change (2D)"; |
698 | | const std::string operation::AXIS_ORDER_CHANGE_3D_NAME = |
699 | | "axis order change (geographic3D horizontal)"; |
700 | | //! @endcond |
701 | | |
702 | | // --------------------------------------------------------------------------- |
703 | | |
704 | | NS_PROJ_END |