Coder Social home page Coder Social logo

nik-makarov / sunrisesunsetlib-java Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mikereedell/sunrisesunsetlib-java

0.0 1.0 0.0 236 KB

Library for computing the sunrise/sunset from GPS coordinates and a date, in Java.

Home Page: http://mikereedell.github.com/sunrisesunsetlib-java/

License: Apache License 2.0

Java 97.29% Ruby 2.71%

sunrisesunsetlib-java's Introduction

Sunrise/SunsetLib - Java

Description

Java library to compute the local sunrise and sunset at a given latitude/longitue and date combination. Uses the algorithm found at https://web.archive.org/web/20161202180207/http://williams.best.vwh.net/sunrise_sunset_algorithm.htm.

Dependencies

None

Installation

Download the jar or clone the repo and run $ mvn clean install to build from source.

Maven

You can now use Maven to pull in SunriseSunsetLib into your project, just add:

<dependency>
  <groupId>com.luckycatlabs</groupId>
  <artifactId>SunriseSunsetCalculator</artifactId>
  <version>1.2</version>
</dependency>

to your pom.xml.

If you use gradle, add the following to your build.gradle file:

repositories {
    mavenCentral()
}

dependencies {
    compile 'com.luckycatlabs:SunriseSunsetCalculator:1.2'
}

Usage

Create a SunriseSunsetCalculator with a location and time zone identifier:

Location location = new Location("39.9522222", "-75.1641667");
SunriseSunsetCalculator calculator = new SunriseSunsetCalculator(location, "America/New_York");

Then call the method for the type of sunrise/sunset you want to calculate:

String officialSunrise = calculator.getOfficialSunriseForDate(Calendar.getInstance());
Calendar officialSunset = calculator.getOfficialSunsetCalendarForDate(Calendar.getInstance());

Bug Reports

When filing a bug report, please include the following information:

  • Date sunrise/set calculation was being run for.
  • Latitude/longitute sunrise/set calculation was being run for.
  • Timezone (either "America/New_York" or GMT-0500)

Author

Mike Reedell

Donate with Pledgie

License

Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0

sunrisesunsetlib-java's People

Contributors

mikereedell avatar frogonwheels avatar ngdelamo avatar aragaer avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.