Package com.luckycatlabs.sunrisesunset.dto

Examples of com.luckycatlabs.sunrisesunset.dto.Location


        computeSunriseSunset(locationResource, city, visitedCity);
        em.persist(visitedCity);
    }

    private void computeSunriseSunset(final LocationFacet locationFacet, final City city, final VisitedCity mdFacet) {
        Location location = new Location(String.valueOf(locationFacet.latitude), String.valueOf(locationFacet.longitude));
        final TimeZone timeZone = TimeZone.getTimeZone(city.geo_timezone);
        SunriseSunsetCalculator calc = new SunriseSunsetCalculator(location, timeZone);
        Calendar c = Calendar.getInstance(timeZone);
        c.setTimeInMillis(locationFacet.start);
        Calendar sunrise = calc.getOfficialSunriseCalendarForDate(c);
View Full Code Here


  }

  private SolarInfoModel getSolarInfo(double latitude, double longitude,
      DayMetadata dayMetadata) {
    SolarInfoModel solarInfo = new SolarInfoModel();
    Location location = new Location(String.valueOf(latitude),
        String.valueOf(longitude));
    TimeZone timeZone = metadataService.getTimeZone(latitude, longitude);
    SunriseSunsetCalculator calc = new SunriseSunsetCalculator(location,
        timeZone);
    Calendar c = dayMetadata.getStartCalendar();
View Full Code Here

        assertTimeEquals("18:00", calc.getOfficialSunsetForDate(eventDate), eventDate.getTime().toString());
    }

    @Test
    public void testSpecificDateLocationAndTimezone() {
        Location loc = new Location("55.03", "82.91");
        SunriseSunsetCalculator calculator = new SunriseSunsetCalculator(loc, "GMT");

        Calendar calendar = Calendar.getInstance();
        calendar.set(2012, 4, 7);
View Full Code Here

        if (longitude.endsWith("W")) {
            longitude = "-" + longitude;
        }
        latitude = latitude.substring(0, latitude.length() - 1);
        longitude = longitude.substring(0, longitude.length() - 1);
        return new Location(latitude, longitude);
    }
View Full Code Here

        eventDate = Calendar.getInstance();
        eventDate.set(Calendar.YEAR, year);
        eventDate.set(Calendar.MONTH, month);
        eventDate.set(Calendar.DAY_OF_MONTH, day);
        eventDate.setTimeZone(TimeZone.getTimeZone(timeZoneIdentifier));
        location = new Location(longitude, latitude);
    }
View Full Code Here

     *            corresponds to 6 degrees.
     * @return the requested sunset time as a <code>Calendar</code> object.
     */

    public static Calendar getSunrise(double latitude, double longitude, TimeZone timeZone, Calendar date, double degrees) {
        SolarEventCalculator solarEventCalculator = new SolarEventCalculator(new Location(latitude, longitude), timeZone);
        return solarEventCalculator.computeSunriseCalendar(new Zenith(90 - degrees), date);
    }
View Full Code Here

     *            corresponds to 6 degrees.
     * @return the requested sunset time as a <code>Calendar</code> object.
     */

    public static Calendar getSunset(double latitude, double longitude, TimeZone timeZone, Calendar date, double degrees) {
        SolarEventCalculator solarEventCalculator = new SolarEventCalculator(new Location(latitude, longitude), timeZone);
        return solarEventCalculator.computeSunsetCalendar(new Zenith(90 - degrees), date);
    }
View Full Code Here

TOP

Related Classes of com.luckycatlabs.sunrisesunset.dto.Location

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.