libosmscout
1.1.1
Toggle main menu visibility
Loading...
Searching...
No Matches
libosmscout
include
osmscout
util
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
28
#include <
osmscout/lib/CoreImportExport.h
>
29
#include <
osmscout/GeoCoord.h
>
30
#include <
osmscout/system/Compiler.h
>
31
#include <
osmscout/system/Math.h
>
32
#include <
osmscout/util/Time.h
>
33
#include <
osmscout/util/String.h
>
34
#include <
osmscout/util/SunriseSunset.h
>
35
36
#include <optional>
37
#include <string>
38
39
namespace
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
Compiler.h
CoreImportExport.h
OSMSCOUT_API
#define OSMSCOUT_API
Definition
CoreImportExport.h:45
GeoCoord.h
Math.h
String.h
Time.h
SunriseSunset.h
osmscout
Definition
Area.h:39
osmscout::Timestamp
std::chrono::system_clock::time_point Timestamp
Definition
Time.h:27
osmscout::GetAstronomicalTwilight
OSMSCOUT_API SunriseSunsetRes GetAstronomicalTwilight(const GeoCoord &location, const Timestamp &day=Timestamp::clock::now())
osmscout::GetSunriseSunset
OSMSCOUT_API SunriseSunsetRes GetSunriseSunset(const GeoCoord &location, const Timestamp &day, double sunAltitude)
osmscout::SunriseSunsetRes
std::optional< std::tuple< Timestamp, Timestamp > > SunriseSunsetRes
Definition
SunriseSunset.h:41
osmscout::GetNauticalTwilight
OSMSCOUT_API SunriseSunsetRes GetNauticalTwilight(const GeoCoord &location, const Timestamp &day=Timestamp::clock::now())
osmscout::GetCivilTwilight
OSMSCOUT_API SunriseSunsetRes GetCivilTwilight(const GeoCoord &location, const Timestamp &day=Timestamp::clock::now())
Generated by
1.17.0