precipitationAmount

17 results found

Post

Replies

Boosts

Views

Activity

WeatherKit HourWeather precipitationAmount
I'm trying to access this element of the HourWeather retrieved from a call to weatherService. When I print in the debugger what is received, it's clear that there is an element there called precipitationAmount. Here is an example of everything retrieved in HourWeather for a particular hour: HourWeather(date: 2022-06-12 22:00:00 +0000, cloudCover: 0.46, condition: Breezy, symbolName: wind, dewPoint: 9.12 °C, humidity: 0.71, isDaylight: true, precipitation: rain, precipitationChance: 0.23, precipitationAmount: 0.21 mm, snowfallAmount: 0.0 mm, pressure: 997.65 mbar, pressureTrend: Rising, temperature: 14.34 °C, apparentTemperature: 13.74 °C, uvIndex: WeatherKit.UVIndex(value: 1, category: Low), visibility: 25915.82 m, wind: WeatherKit.Wind(compassDirection: Northwest, direction: 304.0 °, speed: 29.47 km/h, gust: Optional(41.56 km/h))) But when I try to access that element as part of a SwiftUI view in Xcode (14.0 beta), I get this error: Value of type 'HourWeather' has no member 'precipitationAmount
3
0
944
Jun ’22
precipitationAmount inaccurate in hour forecast in Canada
I've been getting at the precipitationAmount data using this hack from another thread. I've often found that the precip amount is 0mm for every hour of the day. Every entry for today has the same precipAmount of 0mm: HourWeather(date: 2022-06-27 22:00:00 +0000, cloudCover: 0.15, condition: Mostly Clear, symbolName: sun.max, dewPoint: 12.43 °C, humidity: 0.78, isDaylight: true, precipitation: , precipitationChance: 0.0, precipitationAmount: 0.0 mm However the iOS 16 beta 2 weather app is showing precip data for today at the same location. Is the iOS 16 Weather App using the same WeatherKit as I am? I'm finding the data in weatherkit to be pretty different than the data in the weather app.
1
0
484
Jun ’22
Reply to Hourly precipitation amounts seem drastically low
According to the documentation for precipitationAmount (https://developer.apple.com/documentation/weatherkit/hourweather/precipitationamount/): This value refers to the liquid equivalent of all precipitation amounts. A quick internet search told me that the liquid amount can vary drastically, but 10:1 (snow to water) is the usual rule of thumb. Under that assumption, the results you're getting look reasonable.
Dec ’22
Reply to WeatherKit HourWeather precipitationAmount
So I've solved my own issue for now. It may not be pretty (haven't used strings much), but by defining this function I was able to extract the precipitation amount as a Measurement, just like other elements of the HourWeather struct. // Function to get precipitationAmount as a measurement from one instance of HourWeather // Written by Neil Gordon, 14 June 2022 - pending inclusion of precipitationAmount in the // WeatherKit definition of the Structure for HourWeather func precipitationAmount(hourWeatherElement: HourWeather) -> Measurement { var contents : String = var answer = Measurement(value: -9.9, unit: UnitLength.millimeters) // Default if problems print (hourWeatherElement, to: &contents) // Get the contents of the instance as a string if let firstRange = contents.range(of: precipitationAmount: ) { // Find where precip amount should be let startIndex = firstRange.upperBound // Drop everything before that contents = String(contents[startIndex...]) // Find posit
Jun ’22
Reply to Inaccurate overnightForecast condition code
daytimeForecast: { forecastStart: 2023-04-03T11:00:00Z, forecastEnd: 2023-04-03T23:00:00Z, cloudCover: 0.9, conditionCode: Cloudy, humidity: 0.55, precipitationAmount: 0, precipitationAmountByType: {}, precipitationChance: 0, precipitationType: clear, snowfallAmount: 0, windDirection: 172, windSpeed: 8.91 }, overnightForecast: { forecastStart: 2023-04-03T23:00:00Z, forecastEnd: 2023-04-04T11:00:00Z, cloudCover: 0.49, conditionCode: WintryMix, humidity: 0.8, precipitationAmount: 0, precipitationAmountByType: {}, precipitationChance: 0.36, precipitationType: mixed, snowfallAmount: 0, windDirection: 185, windSpeed: 8.87 }, restOfDayForecast: { forecastStart: 2023-04-04T00:12:12Z, forecastEnd: 2023-04-04T04:00:00Z, cloudCover: 0.8, conditionCode: MostlyCloudy, humidity: 0.73, precipitationAmount: 0, precipitationAmountByType: {}, precipitationChance: 0, precipitationType: clear, snowfallAmount: 0, windDirection: 178, windSpeed: 10.86 } }
Apr ’23
Reply to Does WK snowfallAmount == Dark Sky precipAccumulation?
snowfallAmount gives the amount of precipitation that falls as snow measured as the depth of snow crystals with no melting, as opposed to precipitationAmount which is the amount of precipitation measured as depth of water after melting. The difference is usually around a factor of 10. Snow is mostly empty space, and how much empty space is in the snow--how fluffy it is--is partially a function of temperature. The snowfallAmount gives depth of snow if it were to fall on the ground with no melting, no change in its temperature, and no compression as layers of snow accumulate. precipitationAmount gives the depth water you would have if you let all the precipitation fall and then melted it with no evaporation. snowfallAmount may be greater than the observed snow accumulation since snow that falls on warm ground will melt rather than accumulate.
Jan ’23
Reply to Hourly precipitation amounts seem drastically low
I'm bumping my old thread with more info. I did a deep dive into the hourly WeatherKit data that is returned. I've been using precipitationAmount to report the snow amout, but there's actually a property returned called snowfallAmount!! And it appears to contain values that are what I have been expecting for snow. WeatherKit.HourWeather(date: 2024-01-09 15:00:00 +0000, cloudCover: 0.98, cloudCoverLow: 0.0, cloudCoverMid: 0.0, cloudCoverHigh: 0.0, condition: Heavy Snow, symbolName: cloud.snow, dewPoint: -0.44 °C, humidity: 0.96, isDaylight: true, precipitation: snow, precipitationChance: 0.61, precipitationAmount: 2.75 mm, snowfallAmount: 27.16 mm, pressure: 1018.33 mbar, pressureTrend: Falling, temperature: 0.16 °C, apparentTemperature: -4.72 °C, uvIndex: WeatherKit.UVIndex(value: 1, category: Low), visibility: 778.16 m, wind: WeatherKit.Wind(compassDirection: Southeast, direction: 127.0 °, speed: 17.97 km/h, gust: Optional(51.98 km/h))), BUT if you look at the HourWeather in SwiftUI the sno
Jan ’24
Reply to WeatherKit HourWeather precipitationAmount
Incidentally, the WeatherKit REST API includes precipitationAmount for hourly weather conditions: https://developer.apple.com/documentation/weatherkitrestapi/hourweatherconditions so it seems odd and inconsistent that it is not included in the Structure definition for HourWeather: https://developer.apple.com/documentation/weatherkit/hourweather
Jun ’22
Reply to MinuteWeather precipitationIntensity why speed not amount?
I don't think Apple uses kph for precipitation intensity, at least not currently / anymore. I ran a 240h hourly API request and the precipitation amount ranges from 0 to 1.9. The precipitation intensity is identical to the precipitation amount. Since it's hourly granularity, the unit of speed is definitely not per second so not m/s. also K/h is implausible because 1.9 kph = 75000 inches per hour. I would venture to guess that precipitation is cm and precipitation intensity is cm/h Has anyone found explicit confirmation of the units? I don't see it anywhere in Apple's documentation. cloudCover: % daylight: T/F humidity: % precipitationAmount: cm ? precipitationIntensity: cm/h ? precipitationChance:% pressure: hPa ? snowfallIntensity: cm/h snowfallAmount: cm temperature: C temperatureApparent: C temperatureDewPoint: C uvIndex: 0-10? visibility: m? windDirection: degrees ? windGust: m/s ? windSpeed: m/s ?
Aug ’23
Inaccurate overnightForecast condition code
At the moment (8:30 PM), for a number of counties in my area, WeatherKit is indicating a conditionCode of WintryMix for overnightForecast. The low is above freezing, and according to the iPhone weather app there is zero percent chance of precipitation overnight. WeatherKit shows a 0.36 (36%) chance of precipitation but 0 precipitationAmount and 0 snowfallAmount. No other weather data I can find indicates any precipitation overnight in this area. In fact it's supposed to be clear overnight. For now, as an immediate fix, I'm using the restOfDayForecast to get me to midnight, as it seems to be correct. However this is extremely concerning, and my users are very concerned (we're in a fairly southern area) because of this totally false WintryMix conditionCode. I'm really not sure what to do about this. Maybe ignore the condition code if it indicates precipitation but with a 0 precipitationAmount? I'd also like to know why the iPhone weather widget is correct but this WeatherKit data is not. There
2
0
416
Apr ’23
clarification on precipitationItensity/precipitationChance
I've received a forecast with non-zero precipitationChance and zero precipitationIntensity. Is this expected? How should I interpret the data? { forecastStart: 2023-09-02T02:00:00Z, cloudCover: 0.55, conditionCode: PartlyCloudy, daylight: false, humidity: 0.92, precipitationAmount: 0, precipitationIntensity: 0, precipitationChance: 0.31, precipitationType: clear, pressure: 1017.56, pressureTrend: steady, snowfallIntensity: 0, snowfallAmount: 0, temperature: 12.56, temperatureApparent: 12.22, temperatureDewPoint: 11.26, uvIndex: 0, visibility: 23505.2, windDirection: 233, windGust: 6.17, windSpeed: 2.82 }
0
0
491
Aug ’23
WeatherKit moonPhase:full is skipped
HI there, when requesting the daily forecast via the WeatherKit REST API, I found out that under certain circumstances the moon phase full is skipped. Example from Japan (working): { forecastDaily: { name: DailyForecast, metadata: { attributionURL: https://developer.apple.com/weatherkit/data-source-attribution/, expireTime: 2024-10-21T15:16:10Z, latitude: 35.650, longitude: 139.840, readTime: 2024-10-21T14:16:10Z, reportedTime: 2024-10-21T12:00:37Z, units: m, version: 1, sourceType: modeled }, days: [ ..., { forecastStart: 2024-10-16T15:00:00Z, forecastEnd: 2024-10-17T15:00:00Z, conditionCode: MostlyCloudy, maxUvIndex: 4, moonPhase: waxingGibbous, moonrise: 2024-10-17T07:47:26Z, moonset: 2024-10-16T20:09:01Z, precipitationAmount: 0.09, precipitationChance: 0.43, precipitationType: rain, ... windSpeedMax: 16.03, }, { forecastStart: 2024-10-17T15:00:00Z, forecastEnd: 2024-10-18T15:00:00Z, conditionCode: Rain, maxUvIndex: 4, moonPhase: full, moonrise: 2024-10-18T08:20:34Z, moonset: 2024-10-17T21:24:49Z,
1
0
141
Oct ’24