Package org.fluxtream.core.domain.metadata

Examples of org.fluxtream.core.domain.metadata.City


    public VisitedCityModel(VisitedCity vcity, Configuration env, String date){
        this.visitedCityId = vcity.getId();
        this.daysInferred = vcity.daysInferred;
        this.date = date;
        source = vcity.locationSource.toString();
        City city = vcity.city;
        name = city.geo_name;
        country = env.getCountry(city.geo_country_code);
        if (country == null)
            return;
        country = WordUtils.capitalize(country.toLowerCase());
View Full Code Here


    @Autowired
    WWOHelper wwoHelper;

    @Override
  public TimeZone getTimeZone(double latitude, double longitude) {
    City closestCity = getClosestCity(latitude, longitude);
    TimeZone timeZone = TimeZone.getTimeZone(closestCity.geo_timezone);
    return timeZone;
  }
View Full Code Here

        em.flush();
    }

    @Override
    public void setDayMainCity(final long guestId, final float latitude, final float longitude, final String date) {
        final City closestCity = getClosestCity(latitude, longitude);
        setDayMainCity(guestId, date, closestCity);
    }
View Full Code Here

    }

    @Override
    public List<WeatherInfo> getWeatherInfo(double latitude, double longitude,
                                            String date) {
        City closestCity = getClosestCity(latitude, longitude);
        List<WeatherInfo> weather = JPAUtils.find(em, WeatherInfo.class, "weather.byDateAndCity.between", closestCity.geo_name, date);

        if (weather != null && weather.size() > 0) {
            addIcons(weather);
            return weather;
View Full Code Here

            }
        });
        // local vars: current city and current day
        String currentDate = "";
        Point2D.Double anchorLocation = new Point2D.Double(locationResources.get(0).latitude, locationResources.get(0).longitude);
        City anchorCity = getClosestCity(anchorLocation.x, anchorLocation.y);
        int count = 0;
        LocationFacet lastLocationResourceMatchingAnchor=locationResources.get(0);
        long start = locationResources.get(0).start;

        for (LocationFacet locationResource : locationResources) {
            try {
                City newCity = anchorCity;
                Point2D.Double location = new Point2D.Double(locationResource.latitude, locationResource.longitude);
                boolean withinAnchorRange = isWithinRange(location, anchorLocation);

                if (!withinAnchorRange) {
                    anchorLocation = new Point2D.Double(locationResource.latitude, locationResource.longitude);
View Full Code Here

        DayMetadata dayMetadata = metadataService.getDayMetadata(guestId, date);
        WeatherModel model = new WeatherModel(settings.temperatureUnit);
        model.tbounds = getStartEndResponseBoundaries(dayMetadata.start, dayMetadata.end);

        City city = dayMetadata.consensusVisitedCity.city;
        if (city != null){
            final List<WeatherInfo> weatherInfo = metadataService.getWeatherInfo(city.geo_latitude, city.geo_longitude, date);
            Collections.sort(weatherInfo);
            model.hourlyWeatherData = weatherInfo;
            setMinMaxTemperatures(model, weatherInfo);
View Full Code Here

TOP

Related Classes of org.fluxtream.core.domain.metadata.City

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.