org.h2gis.h2spatialext.function.spatial.earth
Class SunCalc

java.lang.Object
  extended by org.h2gis.h2spatialext.function.spatial.earth.SunCalc

public class SunCalc
extends Object

This class is a partial Java port of SunCalc. A BSD-licensed JavaScript library for calculating sun position, sunlight phases (times for sunrise, sunset, dusk, etc.), moon position and lunar phase for the given location and time, created by Vladimir Agafonkin (@mourner) as a part of the SunCalc.net project.

Author:
Erwan Bocher

Method Summary
static com.vividsolutions.jts.geom.Coordinate getPosition(Date date, double lat, double lng)
          Returns the sun position as a coordinate with the following properties x: sun azimuth in radians (direction along the horizon, measured from south to west), e.g. 0 is south and Math.PI * 3/4 is northwest.
static boolean isGeographic(double latitude, double longitude)
          Test if the point has valid latitude and longitude coordinates.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getPosition

public static com.vividsolutions.jts.geom.Coordinate getPosition(Date date,
                                                                 double lat,
                                                                 double lng)
Returns the sun position as a coordinate with the following properties x: sun azimuth in radians (direction along the horizon, measured from south to west), e.g. 0 is south and Math.PI * 3/4 is northwest. y: sun altitude above the horizon in radians, e.g. 0 at the horizon and PI/2 at the zenith (straight over your head).

Parameters:
date -
lat -
lng -
Returns:

isGeographic

public static boolean isGeographic(double latitude,
                                   double longitude)
Test if the point has valid latitude and longitude coordinates.

Parameters:
latitude -
longitude -
Returns:


Copyright © 2015 IRSTV CNRS-FR-2488. All Rights Reserved.