Coverage Report

Created: 2025-07-23 06:58

/src/PROJ/src/datums.cpp
Line
Count
Source
1
/******************************************************************************
2
 * Project:  PROJ.4
3
 * Purpose:  Built in datum list.
4
 * Author:   Frank Warmerdam, warmerda@home.com
5
 *
6
 ******************************************************************************
7
 * Copyright (c) 2000, Frank Warmerdam
8
 *
9
 * Permission is hereby granted, free of charge, to any person obtaining a
10
 * copy of this software and associated documentation files (the "Software"),
11
 * to deal in the Software without restriction, including without limitation
12
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13
 * and/or sell copies of the Software, and to permit persons to whom the
14
 * Software is furnished to do so, subject to the following conditions:
15
 *
16
 * The above copyright notice and this permission notice shall be included
17
 * in all copies or substantial portions of the Software.
18
 *
19
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25
 * DEALINGS IN THE SOFTWARE.
26
 *****************************************************************************/
27
28
#include <stddef.h>
29
30
#include "proj.h"
31
32
#include "proj_internal.h"
33
34
/*
35
 * The ellipse code must match one from pj_ellps.c.  The datum id should
36
 * be kept to 12 characters or less if possible.  Use the official OGC
37
 * datum name for the comments if available.
38
 */
39
40
static const struct PJ_DATUMS pj_datums[] = {
41
    /* id       definition                               ellipse  comments */
42
    /* --       ----------                               -------  -------- */
43
    {"WGS84", "towgs84=0,0,0", "WGS84", ""},
44
    {"GGRS87", "towgs84=-199.87,74.79,246.62", "GRS80",
45
     "Greek_Geodetic_Reference_System_1987"},
46
    {"NAD83", "towgs84=0,0,0", "GRS80", "North_American_Datum_1983"},
47
    {"NAD27", "nadgrids=@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat", "clrk66",
48
     "North_American_Datum_1927"},
49
    {"potsdam", /*"towgs84=598.1,73.7,418.2,0.202,0.045,-2.455,6.7",*/
50
     "nadgrids=@BETA2007.gsb", "bessel", "Potsdam Rauenberg 1950 DHDN"},
51
    {"carthage", "towgs84=-263.0,6.0,431.0", "clrk80ign",
52
     "Carthage 1934 Tunisia"},
53
    {"hermannskogel", "towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232",
54
     "bessel", "Hermannskogel"},
55
    {"ire65", "towgs84=482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",
56
     "mod_airy", "Ireland 1965"},
57
    {"nzgd49", "towgs84=59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993", "intl",
58
     "New Zealand Geodetic Datum 1949"},
59
    {"OSGB36", "towgs84=446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",
60
     "airy", "Airy 1830"},
61
    {nullptr, nullptr, nullptr, nullptr}};
62
63
7.26k
const struct PJ_DATUMS *pj_get_datums_ref() { return pj_datums; }
64
65
/*
66
 * This list is no longer updated, and some values may conflict with
67
 * other sources.
68
 */
69
70
static const struct PJ_PRIME_MERIDIANS pj_prime_meridians[] = {
71
    /* id        definition                         */
72
    /* --        ----------                         */
73
    {"greenwich", "0dE"},
74
    {"lisbon", "9d07'54.862\"W"},
75
    {"paris", "2d20'14.025\"E"},
76
    {"bogota", "74d04'51.3\"W"},
77
    {"madrid", "3d41'16.58\"W"}, /* EPSG:8905 is 3d41'14.55"W */
78
    {"rome", "12d27'8.4\"E"},
79
    {"bern", "7d26'22.5\"E"},
80
    {"jakarta", "106d48'27.79\"E"},
81
    {"ferro", "17d40'W"},
82
    {"brussels", "4d22'4.71\"E"},
83
    {"stockholm", "18d3'29.8\"E"},
84
    {"athens", "23d42'58.815\"E"},
85
    {"oslo", "10d43'22.5\"E"},
86
    {"copenhagen", "12d34'40.35\"E"}, /* EPSG:1026 is 12d34'39.9"E */
87
    {nullptr, nullptr}};
88
89
308k
const PJ_PRIME_MERIDIANS *proj_list_prime_meridians(void) {
90
308k
    return pj_prime_meridians;
91
308k
}