libosmscout 1.1.1
Loading...
Searching...
No Matches
SunriseSunset.h
Go to the documentation of this file.
1#ifndef LIBOSMSCOUT_SUNRISESUNSET_H
2#define LIBOSMSCOUT_SUNRISESUNSET_H
3
4/*
5 Sunrise Sunset Calculator.
6 inspired by Java implementation https://github.com/caarmen/SunriseSunset (LGPL-2.1 License)
7
8 This source is part of the libosmscout library
9
10 Copyright (C) 2013-2017 Carmen Alvarez
11 Copyright (C) 2021 Lukáš Karas
12
13 This library is free software; you can redistribute it and/or
14 modify it under the terms of the GNU Lesser General Public
15 License as published by the Free Software Foundation; either
16 version 2.1 of the License, or (at your option) any later version.
17
18 This library is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 Lesser General Public License for more details.
22
23 You should have received a copy of the GNU Lesser General Public
24 License along with this library; if not, write to the Free Software
25 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26*/
27
29#include <osmscout/GeoCoord.h>
32#include <osmscout/util/Time.h>
35
36#include <optional>
37#include <string>
38
39namespace osmscout {
40
41 using SunriseSunsetRes=std::optional<std::tuple<Timestamp, Timestamp>>;
42
55 extern OSMSCOUT_API SunriseSunsetRes GetSunriseSunset(const GeoCoord &location, const Timestamp &day, double sunAltitude);
56
66 extern OSMSCOUT_API SunriseSunsetRes GetCivilTwilight(const GeoCoord &location, const Timestamp &day = Timestamp::clock::now());
67
77 extern OSMSCOUT_API SunriseSunsetRes GetNauticalTwilight(const GeoCoord &location, const Timestamp &day = Timestamp::clock::now());
78
88 extern OSMSCOUT_API SunriseSunsetRes GetAstronomicalTwilight(const GeoCoord &location, const Timestamp &day = Timestamp::clock::now());
89
90
101 extern OSMSCOUT_API SunriseSunsetRes GetSunriseSunset(const GeoCoord &location, const Timestamp &day = Timestamp::clock::now());
102
103}
104
105#endif //LIBOSMSCOUT_SUNRISESUNSET_H
#define OSMSCOUT_API
Definition CoreImportExport.h:45
Definition Area.h:39
std::chrono::system_clock::time_point Timestamp
Definition Time.h:27
OSMSCOUT_API SunriseSunsetRes GetAstronomicalTwilight(const GeoCoord &location, const Timestamp &day=Timestamp::clock::now())
OSMSCOUT_API SunriseSunsetRes GetSunriseSunset(const GeoCoord &location, const Timestamp &day, double sunAltitude)
std::optional< std::tuple< Timestamp, Timestamp > > SunriseSunsetRes
Definition SunriseSunset.h:41
OSMSCOUT_API SunriseSunsetRes GetNauticalTwilight(const GeoCoord &location, const Timestamp &day=Timestamp::clock::now())
OSMSCOUT_API SunriseSunsetRes GetCivilTwilight(const GeoCoord &location, const Timestamp &day=Timestamp::clock::now())