/** * GeoLocation constructor with parameters for all required fields. * * @param name The location name for display use such as "Lakewood, NJ" * @param latitude the latitude in a double format such as 40.095965 for Lakewood, NJ. <b>Note: * </b> For latitudes south of the equator, a negative value should be used. * @param longitude double the longitude in a double format such as -74.222130 for Lakewood, NJ. * <b>Note: </b> For longitudes east of the <a * href="http://en.wikipedia.org/wiki/Prime_Meridian">Prime Meridian </a> (Greenwich), a * negative value should be used. * @param elevation the elevation above sea level in Meters. Elevation is not used in most * algorithms used for calculating sunrise and set. * @param timeZone the <code>TimeZone</code> for the location. */ public GeoLocation( String name, double latitude, double longitude, double elevation, TimeZone timeZone) { setLocationName(name); setLatitude(latitude); setLongitude(longitude); setElevation(elevation); setTimeZone(timeZone); }
/** * Default GeoLocation constructor will set location to the Prime Meridian at Greenwich, England * and a TimeZone of GMT. The longitude will be set to 0 and the latitude will be 51.4772 to match * the location of the <a href="http://www.rog.nmm.ac.uk">Royal Observatory, Greenwich </a>. No * daylight savings time will be used. */ public GeoLocation() { setLocationName("Greenwich, England"); setLongitude(0); // added for clarity setLatitude(51.4772); setTimeZone(TimeZone.getTimeZone("GMT")); }