All Projects → spatie → sun

spatie / sun

Licence: MIT License
Get information on the position of the sun

Programming Languages

PHP
23972 projects - #3 most used programming language

Labels

Projects that are alternatives of or similar to sun

rust-sun
A Rust library for calculating sun positions
Stars: ✭ 31 (-51.56%)
Mutual labels:  geo, sun
fgpv-vpgf
RAMP2 FGP Visualiser / Visualisateur pour la PGF PCAR2 - The Reusable Accessible Mapping Platform (RAMP), also known as the Federal Geospatial Platform Visualiser (FGPV), is a Javascript based web mapping platform that provides a reusable, responsive and WCAG 2.1 "AA" compliant common viewer platform for the Government of Canada. This is an unsu…
Stars: ✭ 34 (-46.87%)
Mutual labels:  geo
pyturf
A modular geospatial engine written in python
Stars: ✭ 15 (-76.56%)
Mutual labels:  geo
Geodesy
Geodesy functions in Swift 🌎
Stars: ✭ 17 (-73.44%)
Mutual labels:  geo
geostat
GeoStat, Python script for parsing Nginx and Apache logs files and getting GEO data from incoming IP's.
Stars: ✭ 50 (-21.87%)
Mutual labels:  geo
tile38
Real-time Geospatial and Geofencing
Stars: ✭ 8,117 (+12582.81%)
Mutual labels:  geo
GMT.jl
Generic Mapping Tools Library Wrapper for Julia
Stars: ✭ 148 (+131.25%)
Mutual labels:  geo
home-assistant-sun-card
Home assistant sun card based on Google weather design
Stars: ✭ 279 (+335.94%)
Mutual labels:  sun
astro
自用天文算法,公历农历转换、八大行星位置、日出日落月出月落时间、节气物候时间等
Stars: ✭ 33 (-48.44%)
Mutual labels:  sun
georef-ar-api
API del Servicio de Normalización de Datos Geográficos de Argentina.
Stars: ✭ 102 (+59.38%)
Mutual labels:  geo
GEO-network-client
Reference implementation of the GEO Protocol.
Stars: ✭ 19 (-70.31%)
Mutual labels:  geo
BeautifulMakie
https://lazarusa.github.io/BeautifulMakie/
Stars: ✭ 281 (+339.06%)
Mutual labels:  geo
WPS
The 52°North Web Processing Service enables the deployment of geo-processes on the web in a standardized way.
Stars: ✭ 57 (-10.94%)
Mutual labels:  geo
ProjCL
GPU and vector-enabled map projections, geodesic calculations, and image warping 🌎🌍🌏
Stars: ✭ 81 (+26.56%)
Mutual labels:  geo
mbmatch
An MBTiles server for PBF, which is also a map matcher.
Stars: ✭ 34 (-46.87%)
Mutual labels:  geo
georaster-layer-for-leaflet
Display GeoTIFFs and soon other types of raster on your Leaflet Map
Stars: ✭ 168 (+162.5%)
Mutual labels:  geo
cis
Home of the Community Intercomparison Suite.
Stars: ✭ 30 (-53.12%)
Mutual labels:  geo
tailormap
B3partners Tailormap repository
Stars: ✭ 26 (-59.37%)
Mutual labels:  geo
ClimateChangeProjections
An embeddable map that shows climate change projections. How hot will it be by 2070 if we don't do something about it? Accessible at https://climatechange.codeforafrica.org
Stars: ✭ 29 (-54.69%)
Mutual labels:  geo
PHPCoord
PHPCoord is a PHP library to aid in handling coordinates. It can convert coordinates for a point from one system to another and also calculate distance between points
Stars: ✭ 78 (+21.88%)
Mutual labels:  geo

Get information on the position of the sun

Latest Version on Packagist GitHub Tests Action Status Total Downloads

This package can determine several things on the position of the sun.

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Installation

You can install the package via composer:

composer require spatie/sun

Usage

When instantiating Spatie\Sun\Sun you should pass it coordinates.

$coordinatesOfAntwerp = ['lat' => 51.260197, 'lng' => 4.402771];

$sun = new Sun($coordinatesOfAntwerp['lat'], $coordinatesOfAntwerp['lng']);

Get the time of sunrise

You can get the time of the sunrise.

$sun->sunrise(); // returns an instance of \Carbon\Carbon

You can get the time of the sunrise on a specific date by passing in instance of Carbon\Carbon to sunrise

$sun->sunrise($carbon); // returns an instance of \Carbon\Carbon

Get the time of zenith

You can get the time of the zenith.

$sun->zenith(); // returns an instance of \Carbon\Carbon

You can get the time of the zenith on a specific date by passing in instance of Carbon\Carbon to zenith

$sun->zenith($carbon); // returns an instance of \Carbon\Carbon

Get the time of sunset

You can get the time of the sunset.

$sun->sunset(); // returns an instance of \Carbon\Carbon

You can get the time of the sunset on a specific date by passing in instance of Carbon\Carbon to sunset

$sun->sunset($carbon); // returns an instance of \Carbon\Carbon

Determine if the sun is up

This is how you can determine if the sun is up:

$sun->sunIsUp(); // returns a boolean

You can get determine if the sun is up at a specific moment by passing in instance of Carbon\Carbon to sunIsUp

$sun->sunIsUp($carbon); // returns a boolean

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].