MRTKLIB 0.7.14
Modernized GNSS Positioning Library
Loading...
Searching...
No Matches
mrtk_const.h
Go to the documentation of this file.
1/*------------------------------------------------------------------------------
2 * mrtk_const.h : physical, navigation, and system constants
3 *
4 * Copyright (C) 2026 H.SHIONO (MRTKLIB Project)
5 * Copyright (C) 2023-2025 Cabinet Office, Japan
6 * Copyright (C) 2024-2025 Lighthouse Technology & Consulting Co. Ltd.
7 * Copyright (C) 2023-2025 Japan Aerospace Exploration Agency
8 * Copyright (C) 2023-2025 TOSHIBA ELECTRONIC TECHNOLOGIES CORPORATION
9 * Copyright (C) 2015- Mitsubishi Electric Corp.
10 * Copyright (C) 2014 Geospatial Information Authority of Japan
11 * Copyright (C) 2014 T.SUZUKI
12 * Copyright (C) 2007-2023 T.TAKASU
13 *
14 * SPDX-License-Identifier: BSD-2-Clause
15 *----------------------------------------------------------------------------*/
16/**
17 * @file mrtk_const.h
18 * @brief MRTKLIB Constants — Physical, navigation, and system constants.
19 *
20 * This header provides fundamental physical constants (speed of light, earth
21 * parameters), GNSS frequency constants, navigation system identifiers, and
22 * miscellaneous constants used across the library and applications.
23 *
24 * All constants use #ifndef guards to avoid conflicts with local definitions
25 * in legacy .c files that duplicate these values.
26 *
27 * @note This header also contains legacy type definitions and function
28 * declarations for modules not yet implemented (TLE, GIS, download).
29 * These are preserved for API compatibility.
30 */
31#ifndef MRTK_CONST_H
32#define MRTK_CONST_H
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
38#include <stdio.h>
39
41#include "mrtklib/mrtk_peph.h"
42#include "mrtklib/mrtk_rinex.h"
43#include "mrtklib/mrtk_time.h"
44#include "mrtklib/mrtk_version.h"
45
46/*============================================================================
47 * Copyright Information
48 *===========================================================================*/
49
50#define COPYRIGHT_MRTKLIB \
51 "Copyright (C) 2007-2023 T.Takasu\nAll rights reserved." \
52 "Copyright (C) 2023-2025, TOSHIBA ELECTRONIC TECHNOLOGIES CORPORATION. All Rights Reserved." \
53 "Copyright (C) 2023-2025, Japan Aerospace Exploration Agency. All Rights Reserved."
54
55/*============================================================================
56 * Physical Constants
57 *===========================================================================*/
58
59#ifndef PI
60#define PI 3.1415926535897932 /* pi */
61#endif
62#ifndef D2R
63#define D2R (PI / 180.0) /* deg to rad */
64#endif
65#ifndef R2D
66#define R2D (180.0 / PI) /* rad to deg */
67#endif
68#ifndef CLIGHT
69#define CLIGHT 299792458.0 /* speed of light (m/s) */
70#endif
71#ifndef SC2RAD
72#define SC2RAD 3.1415926535898 /* semi-circle to radian (IS-GPS) */
73#endif
74#ifndef AU
75#define AU 149597870691.0 /* 1 AU (m) */
76#endif
77#ifndef AS2R
78#define AS2R (D2R / 3600.0) /* arc sec to radian */
79#endif
80#ifndef M2NS
81#define M2NS (1E9 / CLIGHT) /* m to ns */
82#endif
83#ifndef NS2M
84#define NS2M (CLIGHT / 1E9) /* ns to m */
85#endif
86#ifndef OMGE
87#define OMGE 7.2921151467E-5 /* earth angular velocity (IS-GPS) (rad/s) */
88#endif
89#ifndef RE_WGS84
90#define RE_WGS84 6378137.0 /* earth semimajor axis (WGS84) (m) */
91#endif
92#ifndef FE_WGS84
93#define FE_WGS84 (1.0 / 298.257223563) /* earth flattening (WGS84) */
94#endif
95#ifndef HION
96#define HION 350000.0 /* ionosphere height (m) */
97#endif
98
99/*============================================================================
100 * Frequency Constants
101 *===========================================================================*/
102
103#ifndef MAXFREQ
104#define MAXFREQ 7 /* max NFREQ */
105#endif
106#ifndef FREQ1
107#define FREQ1 1.57542E9 /* L1/E1/B1C frequency (Hz) */
108#endif
109#ifndef FREQ2
110#define FREQ2 1.22760E9 /* L2 frequency (Hz) */
111#endif
112#ifndef FREQ5
113#define FREQ5 1.17645E9 /* L5/E5a/B2a frequency (Hz) */
114#endif
115#ifndef FREQ6
116#define FREQ6 1.27875E9 /* E6/L6 frequency (Hz) */
117#endif
118#ifndef FREQ7
119#define FREQ7 1.20714E9 /* E5b frequency (Hz) */
120#endif
121#ifndef FREQ8
122#define FREQ8 1.191795E9 /* E5a+b frequency (Hz) */
123#endif
124#ifndef FREQ9
125#define FREQ9 2.492028E9 /* S frequency (Hz) */
126#endif
127#ifndef FREQ1_GLO
128#define FREQ1_GLO 1.60200E9 /* GLONASS G1 base frequency (Hz) */
129#endif
130#ifndef DFRQ1_GLO
131#define DFRQ1_GLO 0.56250E6 /* GLONASS G1 bias frequency (Hz/n) */
132#endif
133#ifndef FREQ2_GLO
134#define FREQ2_GLO 1.24600E9 /* GLONASS G2 base frequency (Hz) */
135#endif
136#ifndef DFRQ2_GLO
137#define DFRQ2_GLO 0.43750E6 /* GLONASS G2 bias frequency (Hz/n) */
138#endif
139#ifndef FREQ3_GLO
140#define FREQ3_GLO 1.202025E9 /* GLONASS G3 frequency (Hz) */
141#endif
142#ifndef FREQ1a_GLO
143#define FREQ1a_GLO 1.600995E9 /* GLONASS G1a frequency (Hz) */
144#endif
145#ifndef FREQ2a_GLO
146#define FREQ2a_GLO 1.248060E9 /* GLONASS G2a frequency (Hz) */
147#endif
148#ifndef FREQ1_CMP
149#define FREQ1_CMP 1.561098E9 /* BDS B1I frequency (Hz) */
150#endif
151#ifndef FREQ2_CMP
152#define FREQ2_CMP 1.20714E9 /* BDS B2I/B2b frequency (Hz) */
153#endif
154#ifndef FREQ3_CMP
155#define FREQ3_CMP 1.26852E9 /* BDS B3 frequency (Hz) */
156#endif
157
158/*============================================================================
159 * Error Factors
160 *===========================================================================*/
161
162#ifndef EFACT_GPS
163#define EFACT_GPS 1.0 /* error factor: GPS */
164#endif
165#ifndef EFACT_GLO
166#define EFACT_GLO 1.5 /* error factor: GLONASS */
167#endif
168#ifndef EFACT_GAL
169#define EFACT_GAL 1.0 /* error factor: Galileo */
170#endif
171#ifndef EFACT_QZS
172#define EFACT_QZS 1.0 /* error factor: QZSS */
173#endif
174#ifndef EFACT_CMP
175#define EFACT_CMP 1.0 /* error factor: BeiDou */
176#endif
177#ifndef EFACT_IRN
178#define EFACT_IRN 1.5 /* error factor: NavIC */
179#endif
180#ifndef EFACT_SBS
181#define EFACT_SBS 3.0 /* error factor: SBAS */
182#endif
183
184/*============================================================================
185 * Navigation System Identifiers
186 *===========================================================================*/
187
188#ifndef SYS_NONE
189#define SYS_NONE 0x00 /* navigation system: none */
190#endif
191#ifndef SYS_GPS
192#define SYS_GPS 0x01 /* navigation system: GPS */
193#endif
194#ifndef SYS_SBS
195#define SYS_SBS 0x02 /* navigation system: SBAS */
196#endif
197#ifndef SYS_GLO
198#define SYS_GLO 0x04 /* navigation system: GLONASS */
199#endif
200#ifndef SYS_GAL
201#define SYS_GAL 0x08 /* navigation system: Galileo */
202#endif
203#ifndef SYS_QZS
204#define SYS_QZS 0x10 /* navigation system: QZSS */
205#endif
206#ifndef SYS_CMP
207#define SYS_CMP 0x20 /* navigation system: BeiDou */
208#endif
209#ifndef SYS_IRN
210#define SYS_IRN 0x40 /* navigation system: NavIC */
211#endif
212#ifndef SYS_LEO
213#define SYS_LEO 0x80 /* navigation system: LEO */
214#endif
215#ifndef SYS_BD2
216#define SYS_BD2 0x100 /* navigation system: BeiDou-2 */
217#endif
218#define BDSGEN_2 2 /* BeiDou generation: BDS-2 (bds_gen()) */
219#define BDSGEN_3 3 /* BeiDou generation: BDS-3 (bds_gen()) */
220#ifndef SYS_ALL
221#define SYS_ALL 0xFFF /* navigation system: all */
222#endif
223
224/*============================================================================
225 * Time System Constants
226 *===========================================================================*/
227
228#ifndef TSYS_GPS
229#define TSYS_GPS 0 /* time system: GPS time */
230#endif
231#ifndef TSYS_UTC
232#define TSYS_UTC 1 /* time system: UTC */
233#endif
234#ifndef TSYS_GLO
235#define TSYS_GLO 2 /* time system: GLONASS time */
236#endif
237#ifndef TSYS_GAL
238#define TSYS_GAL 3 /* time system: Galileo time */
239#endif
240#ifndef TSYS_QZS
241#define TSYS_QZS 4 /* time system: QZSS time */
242#endif
243#ifndef TSYS_CMP
244#define TSYS_CMP 5 /* time system: BeiDou time */
245#endif
246#ifndef TSYS_IRN
247#define TSYS_IRN 6 /* time system: IRNSS time */
248#endif
249
250/*============================================================================
251 * Ephemeris / Navigation Constants
252 *===========================================================================*/
253
254#ifndef MAXDTOE
255#define MAXDTOE 7200.0 /* max time difference to GPS Toe (s) */
256#endif
257#ifndef MAXDTOE_QZS
258#define MAXDTOE_QZS 7200.0 /* max time difference to QZSS Toe (s) */
259#endif
260#ifndef MAXDTOE_GAL
261#define MAXDTOE_GAL 14400.0 /* max time difference to Galileo Toe (s) */
262#endif
263#ifndef MAXDTOE_CMP
264#define MAXDTOE_CMP 21600.0 /* max time difference to BeiDou Toe (s) */
265#endif
266#ifndef MAXDTOE_GLO
267#define MAXDTOE_GLO 1800.0 /* max time difference to GLONASS Toe (s) */
268#endif
269#ifndef MAXDTOE_IRN
270#define MAXDTOE_IRN 7200.0 /* max time difference to IRNSS Toe (s) */
271#endif
272#ifndef MAXDTOE_SBS
273#define MAXDTOE_SBS 360.0 /* max time difference to SBAS Toe (s) */
274#endif
275#ifndef MAXDTOE_S
276#define MAXDTOE_S 86400.0 /* max time difference to ephem toe (s) for other */
277#endif
278#ifndef MAXGDOP
279#define MAXGDOP 300.0 /* max GDOP */
280#endif
281
282/*============================================================================
283 * Swap / Timing Constants
284 *===========================================================================*/
285
286#define INT_SWAP_TRAC 86400.0 /* swap interval of trace file (s) */
287#define INT_SWAP_STAT 86400.0 /* swap interval of solution status file (s) */
288
289/*============================================================================
290 * SBAS Constants
291 *===========================================================================*/
292
293#define MAXSBSAGEF 30.0 /* max age of SBAS fast correction (s) */
294#define MAXSBSAGEL 1800.0 /* max age of SBAS long term corr (s) */
295#define MAXSBSURA 8 /* max URA of SBAS satellite */
296
297/*============================================================================
298 * RINEX Constants
299 *===========================================================================*/
300
301#define RNX2VER 2.10 /* RINEX ver.2 default output version */
302#define RNX3VER 3.00 /* RINEX ver.3 default output version */
303
304/*============================================================================
305 * Observation / Frequency Type Flags
306 *===========================================================================*/
307
308#define OBSTYPE_PR 0x01 /* observation type: pseudorange */
309#define OBSTYPE_CP 0x02 /* observation type: carrier-phase */
310#define OBSTYPE_DOP 0x04 /* observation type: doppler-freq */
311#define OBSTYPE_SNR 0x08 /* observation type: SNR */
312#define OBSTYPE_ALL 0xFF /* observation type: all */
313
314#define FREQTYPE_L1 0x01 /* frequency type: L1/E1/B1 */
315#define FREQTYPE_L2 0x02 /* frequency type: L2/E5b/B2 */
316#define FREQTYPE_L3 0x04 /* frequency type: L5/E5a/L3 */
317#define FREQTYPE_L4 0x08 /* frequency type: L6/E6/B3 */
318#define FREQTYPE_L5 0x10 /* frequency type: E5ab */
319#define FREQTYPE_ALL 0xFF /* frequency type: all */
320
321/*============================================================================
322 * Misc Constants
323 *===========================================================================*/
324
325#ifndef COMMENTH
326#define COMMENTH "%" /* comment line indicator for solution */
327#endif
328
329#ifndef LLI_SLIP
330#define LLI_SLIP 0x01 /* LLI: cycle-slip */
331#endif
332#ifndef LLI_HALFC
333#define LLI_HALFC 0x02 /* LLI: half-cycle not resovled */
334#endif
335#ifndef LLI_BOCTRK
336#define LLI_BOCTRK 0x04 /* LLI: boc tracking of mboc signal */
337#endif
338#ifndef LLI_HALFA
339#define LLI_HALFA 0x40 /* LLI: half-cycle added */
340#endif
341#ifndef LLI_HALFS
342#define LLI_HALFS 0x80 /* LLI: half-cycle subtracted */
343#endif
344
345#ifndef P2_5
346#define P2_5 0.03125 /* 2^-5 */
347#endif
348#ifndef P2_6
349#define P2_6 0.015625 /* 2^-6 */
350#endif
351#ifndef P2_11
352#define P2_11 4.882812500000000E-04 /* 2^-11 */
353#endif
354#ifndef P2_15
355#define P2_15 3.051757812500000E-05 /* 2^-15 */
356#endif
357#ifndef P2_17
358#define P2_17 7.629394531250000E-06 /* 2^-17 */
359#endif
360#ifndef P2_19
361#define P2_19 1.907348632812500E-06 /* 2^-19 */
362#endif
363#ifndef P2_20
364#define P2_20 9.536743164062500E-07 /* 2^-20 */
365#endif
366#ifndef P2_21
367#define P2_21 4.768371582031250E-07 /* 2^-21 */
368#endif
369#ifndef P2_23
370#define P2_23 1.192092895507810E-07 /* 2^-23 */
371#endif
372#ifndef P2_24
373#define P2_24 5.960464477539063E-08 /* 2^-24 */
374#endif
375#ifndef P2_27
376#define P2_27 7.450580596923828E-09 /* 2^-27 */
377#endif
378#ifndef P2_29
379#define P2_29 1.862645149230957E-09 /* 2^-29 */
380#endif
381#ifndef P2_30
382#define P2_30 9.313225746154785E-10 /* 2^-30 */
383#endif
384#ifndef P2_31
385#define P2_31 4.656612873077393E-10 /* 2^-31 */
386#endif
387#ifndef P2_32
388#define P2_32 2.328306436538696E-10 /* 2^-32 */
389#endif
390#ifndef P2_33
391#define P2_33 1.164153218269348E-10 /* 2^-33 */
392#endif
393#ifndef P2_35
394#define P2_35 2.910383045673370E-11 /* 2^-35 */
395#endif
396#ifndef P2_38
397#define P2_38 3.637978807091710E-12 /* 2^-38 */
398#endif
399#ifndef P2_39
400#define P2_39 1.818989403545856E-12 /* 2^-39 */
401#endif
402#ifndef P2_40
403#define P2_40 9.094947017729280E-13 /* 2^-40 */
404#endif
405#ifndef P2_43
406#define P2_43 1.136868377216160E-13 /* 2^-43 */
407#endif
408#ifndef P2_48
409#define P2_48 3.552713678800501E-15 /* 2^-48 */
410#endif
411#ifndef P2_50
412#define P2_50 8.881784197001252E-16 /* 2^-50 */
413#endif
414#ifndef P2_55
415#define P2_55 2.775557561562891E-17 /* 2^-55 */
416#endif
417
418/*============================================================================
419 * SSR Constants
420 *===========================================================================*/
421
422#define SSR_VENDOR_L6 0 /* vendor type L6(MADOCA-PPP) */
423#define SSR_VENDOR_RTCM 1 /* vendor type RTCM3(JAXA-MADOCA) */
424#define MAXAGESSRL6 60.0 /* max age of ssr satellite code and phase bias (s) */
425#define MIONO_MAX_AGE 300.0 /* max age of STEC correction (s) (Table 6.3.2-3) */
426#define SSR_INVALID_CBIAS -81.92 /* invalid value of ssr code bias (m) */
427#define SSR_INVALID_PBIAS -52.4288 /* invalid value of ssr phase bias (m) */
428
429/*============================================================================
430 * Satellite Attitude / Type Constants
431 *===========================================================================*/
432
433#define SATT_NORMAL 0 /* nominal attitude */
434#define GM_EGM 3.986004415E14 /* earth grav. constant (EGM96/2008) */
435#define DT_BETA_R 10.0 /* delta time for beta angle rate (s) */
436
437#define STYPE_NONE 0 /* satellite type: unknown */
438#define STYPE_GPSII 1 /* satellite type: GPS Block II */
439#define STYPE_GPSIIA 2 /* satellite type: GPS Block IIA */
440#define STYPE_GPSIIR 3 /* satellite type: GPS Block IIR */
441#define STYPE_GPSIIRM 4 /* satellite type: GPS Block IIR-M */
442#define STYPE_GPSIIF 5 /* satellite type: GPS Block IIF */
443#define STYPE_GPSIIIA 6 /* satellite type: GPS Block III-A */
444#define STYPE_GPSIIIB 7 /* satellite type: GPS Block III-B */
445#define STYPE_GLO 8 /* satellite type: GLONASS */
446#define STYPE_GLOM 9 /* satellite type: GLONASS-M */
447#define STYPE_GLOK 10 /* satellite type: GLONASS-K */
448#define STYPE_GAL 11 /* satellite type: Galileo IOV */
449#define STYPE_QZS 12 /* satellite type: QZSS Block IQ */
450#define STYPE_QZSIIQ 13 /* satellite type: QZSS Block IIQ */
451#define STYPE_QZSIIG 14 /* satellite type: QZSS Block IIG */
452#define STYPE_QZSIIIQ 15 /* satellite type: QZSS Block IIIQ */
453#define STYPE_QZSIIIG 16 /* satellite type: QZSS Block IIIG */
454#define STYPE_GAL_FOC 17 /* satellite type: Galileo FOC */
455#define STYPE_BDS_G 18 /* satellite type: BeiDou GEO */
456#define STYPE_BDS_I 19 /* satellite type: BeiDou IGSO */
457#define STYPE_BDS_M 20 /* satellite type: BeiDou MEO */
458#define STYPE_BDS_I_YS 21 /* satellite type: BeiDou IGSO(no ON mode) */
459#define STYPE_BDS_M_YS 22 /* satellite type: BeiDou MEO(no ON mode) */
460#define STYPE_BDS3_G 23 /* satellite type: BeiDou-3 GEO */
461#define STYPE_BDS3_I_C 24 /* satellite type: BeiDou-3 IGSO by CAST */
462#define STYPE_BDS3_I_S 25 /* satellite type: BeiDou-3 IGSO by SECM */
463#define STYPE_BDS3_M_C 26 /* satellite type: BeiDou-3 MEO by CAST */
464#define STYPE_BDS3_M_S 27 /* satellite type: BeiDou-3 MEO by SECM */
465#define STYPE_QZS_I_YS 30 /* satellite type: QZSS Block IQ(beta 15/17.5 deg) */
466#define STYPE_LEO 31 /* satellite type: LEO */
467#define STYPE_MAX 32 /* max satellite type */
468
469/*============================================================================
470 * Orbit Event Constants
471 *===========================================================================*/
472
473#define MAXNP_EVENT 6 /* max number of event parameters */
474
475#define EVENT_NONE 0 /* orbit event: no event */
476#define EVENT_ATT_EC 1 /* orbit event: ATT_EC */
477#define EVENT_ATT_YS 2 /* orbit event: ATT_YS */
478#define EVENT_ATT_EC_YS 3 /* orbit event: ATT_EC_YS */
479#define EVENT_ATT_YS_EC 4 /* orbit event: ATT_YS_EC */
480
481/*============================================================================
482 * Orbit Event Type
483 *===========================================================================*/
484
485typedef struct event_tag { /* orbit event list type */
486 gtime_t time; /* event time (gpst) */
487 int type; /* event type */
488 double p[MAXNP_EVENT]; /* event parameters */
489 double s[MAXNP_EVENT]; /* standard deviation of event parameters */
490 double p0[MAXNP_EVENT]; /* event parameters checkpoint */
491 double s0[MAXNP_EVENT]; /* standard deviation checkpoint */
492 int ix, nx; /* index/number of estimated parameters */
493 struct event_tag* next; /* pointer to next */
495
496/*============================================================================
497 * MADOCA-PPP / Local Correction Constants
498 *===========================================================================*/
499
500#define TOW_LSB 30.0 /* epoch time 30s */
501#define MAXTRP 2880 /* all time data, (1hour/1day) */
502
503#define SVR_CYCLE 10 /* server cycle (ms) */
504
505/*============================================================================
506 * Console / Application Constants
507 *===========================================================================*/
508
509#define LOGIN_PROMPT "*** LCLCMBRT MONITOR CONSOLE (" MRTKLIB_SOFTNAME " ver." MRTKLIB_VERSION_STRING ") ***"
510#define LOGIN_USER "admin" /* console login user */
511#define LOGIN_PASSWD "root" /* console login password */
512#define INACT_TIMEOUT 300 /* console inactive timeout (s) */
513
514#define ESC_CLEAR "\033[H\033[2J" /* ansi/vt100 escape: erase screen */
515#define ESC_RESET "\033[0m" /* ansi/vt100 escape: reset attribute */
516#define ESC_BOLD "\033[1m" /* ansi/vt100 escape: bold */
517
518/*============================================================================
519 * RTCM Constants
520 *===========================================================================*/
521
522#ifndef RTCM3PREAMB
523#define RTCM3PREAMB 0xD3 /* rtcm ver.3 frame preamble */
524#endif
525
526/*============================================================================
527 * Download Option Constants
528 *===========================================================================*/
529
530#define DLOPT_FORCE 0x01 /* download option: force download existing */
531#define DLOPT_KEEPCMP 0x02 /* download option: keep compressed file */
532#define DLOPT_HOLDERR 0x04 /* download option: hold on error file */
533#define DLOPT_HOLDLST 0x08 /* download option: hold on listing file */
534
535/*============================================================================
536 * Legacy Types (not yet implemented — preserved for API compatibility)
537 *===========================================================================*/
538
539typedef struct { /* NORAD TLE data type */
540 char name[32]; /* common name */
541 char alias[32]; /* alias name */
542 char satno[16]; /* satellite catalog number */
543 char satclass; /* classification */
544 char desig[16]; /* international designator */
545 gtime_t epoch; /* element set epoch (UTC) */
546 double ndot; /* 1st derivative of mean motion */
547 double nddot; /* 2nd derivative of mean motion */
548 double bstar; /* B* drag term */
549 int etype; /* element set type */
550 int eleno; /* element number */
551 double inc; /* orbit inclination (deg) */
552 double OMG; /* right ascension of ascending node (deg) */
553 double ecc; /* eccentricity */
554 double omg; /* argument of perigee (deg) */
555 double M; /* mean anomaly (deg) */
556 double n; /* mean motion (rev/day) */
557 int rev; /* revolution number at epoch */
558} tled_t;
559
560typedef struct { /* NORAD TLE (two line element) type */
561 int n, nmax; /* number/max number of two line element data */
562 tled_t* data; /* NORAD TLE data */
563} tle_t;
564
565typedef struct { /* download URL type */
566 char type[32]; /* data type */
567 char path[1024]; /* URL path */
568 char dir[1024]; /* local directory */
569 double tint; /* time interval (s) */
570} url_t;
571
572typedef struct { /* GIS data point type */
573 double pos[3]; /* point data {lat,lon,height} (rad,m) */
574} gis_pnt_t;
575
576typedef struct { /* GIS data polyline type */
577 int npnt; /* number of points */
578 double bound[4]; /* boundary {lat0,lat1,lon0,lon1} */
579 double* pos; /* position data (3 x npnt) */
580} gis_poly_t;
581
582typedef struct { /* GIS data polygon type */
583 int npnt; /* number of points */
584 double bound[4]; /* boundary {lat0,lat1,lon0,lon1} */
585 double* pos; /* position data (3 x npnt) */
587
588typedef struct gisd_tag { /* GIS data list type */
589 int type; /* data type (1:point,2:polyline,3:polygon) */
590 void* data; /* data body */
591 struct gisd_tag* next; /* pointer to next */
593
594typedef struct { /* GIS type */
595 char name[MAXGISLAYER][256]; /* name */
596 int flag[MAXGISLAYER]; /* flag */
597 gisd_t* data[MAXGISLAYER]; /* gis data list */
598 double bound[4]; /* boundary {lat0,lat1,lon0,lon1} */
599} gis_t;
600
601/*============================================================================
602 * Legacy Function Declarations (not yet implemented)
603 *===========================================================================*/
604
605/* datum transformation */
606int loaddatump(const char* file);
607int tokyo2jgd(double* pos);
608int jgd2tokyo(double* pos);
609
610/* RINEX conversion */
611int convrnx(int format, rnxopt_t* opt, const char* file, char** ofile);
612
613/* NORAD TLE functions */
614int tle_read(const char* file, tle_t* tle);
615int tle_name_read(const char* file, tle_t* tle);
616int tle_pos(gtime_t time, const char* name, const char* satno, const char* desig, const tle_t* tle, const erp_t* erp,
617 double* rs);
618
619/* Google Earth KML converter */
620int convkml(const char* infile, const char* outfile, gtime_t ts, gtime_t te, double tint, int qflg, double* offset,
621 int tcolor, int pcolor, int outalt, int outtime);
622
623/* GPX converter */
624int convgpx(const char* infile, const char* outfile, gtime_t ts, gtime_t te, double tint, int qflg, double* offset,
625 int outtrk, int outpnt, int outalt, int outtime);
626
627/* downloader functions */
628int dl_readurls(const char* file, char** types, int ntype, url_t* urls, int nmax);
629int dl_readstas(const char* file, char** stas, int nmax);
630int dl_exec(gtime_t ts, gtime_t te, double ti, int seqnos, int seqnoe, const url_t* urls, int nurl, char** stas,
631 int nsta, const char* dir, const char* usr, const char* pwd, const char* proxy, int opts, char* msg,
632 FILE* fp);
633void dl_test(gtime_t ts, gtime_t te, double ti, const url_t* urls, int nurl, char** stas, int nsta, const char* dir,
634 int ncol, int datefmt, FILE* fp);
635
636/* GIS data functions */
637int gis_read(const char* file, gis_t* gis, int layer);
638void gis_free(gis_t* gis);
639
640/*============================================================================
641 * Application-Defined Callbacks
642 *===========================================================================*/
643
644/**
645 * @brief Show status message (application-defined).
646 * @param[in] format printf-style format string
647 * @return Status (0:ok)
648 */
649extern int showmsg(const char* format, ...);
650
651/**
652 * @brief Set time span for progress display (application-defined).
653 * @param[in] ts Start time
654 * @param[in] te End time
655 */
656extern void settspan(gtime_t ts, gtime_t te);
657
658/**
659 * @brief Set current time for progress display (application-defined).
660 * @param[in] time Current processing time
661 */
662extern void settime(gtime_t time);
663
664#ifdef __cplusplus
665}
666#endif
667
668#endif /* MRTK_CONST_H */
int tle_name_read(const char *file, tle_t *tle)
int dl_exec(gtime_t ts, gtime_t te, double ti, int seqnos, int seqnoe, const url_t *urls, int nurl, char **stas, int nsta, const char *dir, const char *usr, const char *pwd, const char *proxy, int opts, char *msg, FILE *fp)
int dl_readstas(const char *file, char **stas, int nmax)
int tokyo2jgd(double *pos)
void gis_free(gis_t *gis)
struct event_tag event_t
int convgpx(const char *infile, const char *outfile, gtime_t ts, gtime_t te, double tint, int qflg, double *offset, int outtrk, int outpnt, int outalt, int outtime)
int convkml(const char *infile, const char *outfile, gtime_t ts, gtime_t te, double tint, int qflg, double *offset, int tcolor, int pcolor, int outalt, int outtime)
int dl_readurls(const char *file, char **types, int ntype, url_t *urls, int nmax)
void settime(gtime_t time)
Set current time for progress display (application-defined).
int convrnx(int format, rnxopt_t *opt, const char *file, char **ofile)
int tle_pos(gtime_t time, const char *name, const char *satno, const char *desig, const tle_t *tle, const erp_t *erp, double *rs)
#define MAXNP_EVENT
Definition mrtk_const.h:473
struct gisd_tag gisd_t
int tle_read(const char *file, tle_t *tle)
int loaddatump(const char *file)
int gis_read(const char *file, gis_t *gis, int layer)
void settspan(gtime_t ts, gtime_t te)
Set time span for progress display (application-defined).
int showmsg(const char *format,...)
Show status message (application-defined).
int jgd2tokyo(double *pos)
void dl_test(gtime_t ts, gtime_t te, double ti, const url_t *urls, int nurl, char **stas, int nsta, const char *dir, int ncol, int datefmt, FILE *fp)
MRTKLIB Foundation — Common types, standard includes, and system constants (MAXSAT,...
#define MAXGISLAYER
int satno(int sys, int prn)
Convert satellite system+prn/slot number to satellite number.
Definition mrtk_nav.c:58
MRTKLIB Precise Ephemeris Module — Earth rotation parameter types and ERP I/O functions.
static sta_t stas[MAXRCV]
MRTKLIB RINEX Module — RINEX file read/write types and functions.
MRTKLIB Time Module — GNSS time types and conversion functions.
ERP (earth rotation parameter) type.
Definition mrtk_peph.h:59
double s[6]
Definition mrtk_const.h:489
gtime_t time
Definition mrtk_const.h:486
struct event_tag * next
Definition mrtk_const.h:493
double p[6]
Definition mrtk_const.h:488
double p0[6]
Definition mrtk_const.h:490
double s0[6]
Definition mrtk_const.h:491
double pos[3]
Definition mrtk_const.h:573
double * pos
Definition mrtk_const.h:579
double bound[4]
Definition mrtk_const.h:578
double bound[4]
Definition mrtk_const.h:584
double * pos
Definition mrtk_const.h:585
gisd_t * data[MAXGISLAYER]
Definition mrtk_const.h:597
int flag[MAXGISLAYER]
Definition mrtk_const.h:596
double bound[4]
Definition mrtk_const.h:598
char name[MAXGISLAYER][256]
Definition mrtk_const.h:595
struct gisd_tag * next
Definition mrtk_const.h:591
void * data
Definition mrtk_const.h:590
GNSS time representation.
Definition mrtk_time.h:49
RINEX options type.
Definition mrtk_rinex.h:49
int n
Definition mrtk_const.h:561
tled_t * data
Definition mrtk_const.h:562
int nmax
Definition mrtk_const.h:561
gtime_t epoch
Definition mrtk_const.h:545
double OMG
Definition mrtk_const.h:552
int etype
Definition mrtk_const.h:549
char name[32]
Definition mrtk_const.h:540
double nddot
Definition mrtk_const.h:547
int rev
Definition mrtk_const.h:557
double n
Definition mrtk_const.h:556
double omg
Definition mrtk_const.h:554
double bstar
Definition mrtk_const.h:548
char desig[16]
Definition mrtk_const.h:544
double ecc
Definition mrtk_const.h:553
int eleno
Definition mrtk_const.h:550
char satclass
Definition mrtk_const.h:543
char alias[32]
Definition mrtk_const.h:541
double M
Definition mrtk_const.h:555
char satno[16]
Definition mrtk_const.h:542
double inc
Definition mrtk_const.h:551
double ndot
Definition mrtk_const.h:546
double tint
Definition mrtk_const.h:569
char path[1024]
Definition mrtk_const.h:567
char type[32]
Definition mrtk_const.h:566
char dir[1024]
Definition mrtk_const.h:568