DarkSkyApi icon indicating copy to clipboard operation
DarkSkyApi copied to clipboard

Working with the result.

Open kruug opened this issue 10 years ago • 5 comments

How would one work with the result object to get data out?

kruug avatar May 27 '15 03:05 kruug

You need to add the ForecastIOPortable.Models namespace to your project in order to use the Forecast class.

trimzulu avatar Jun 18 '15 21:06 trimzulu

Right, I get that. I'm asking more about how to get the data out. Like, there's a screenshot that shows a partial glimpse at what's available, but nothing more than that.

kruug avatar Jun 18 '15 21:06 kruug

Sorry if this isn't helpful but unfortunately the author seems to offer little in the way of documentation.

The best I can say is in his readme he references translating the JSON fields documented on the forecast.io website to more .NET convention-friendly names. An example was precipIntensityMax VS MaxPrecipitationIntensity.

Forecast.io themselves do have very nice documentation that you can check here: https://developer.forecast.io/docs/v2

Again, I apologize if this isn't anything you don't already know.

trimzulu avatar Jun 18 '15 21:06 trimzulu

Yeah, the documentation is pretty bad (read: non-existent) right now - sorry! I'll get something more concrete up soon. For now, the forecast.io documentation is your best bet, since the library was designed to be a one-to-one mapping to the raw API results just with the fields renamed.

In summary, though: the main result object contains current weather conditions (Currently property, shown in the README), minute-by-minute conditions for the next hour (Minutely property), hour-by-hour for the next two days (Hourly property), and day-by-day for the next week (Daily property). The actual data points in Minutely, Hourly, and Daily are retrievable from an IList (Minutes, Hours, or Days, respectively).

You can also open up the source for the various classes in the Models namespace - there are comments on each property explaining what they are, and the DataMember attributes give the name of the JSON field they correspond to.

Hope this helps for now. I'll try get something up over the weekend.

jcheng31 avatar Jun 19 '15 00:06 jcheng31

link to current documentation https://developer.forecast.io/docs/v2

aaronhoffman avatar Nov 30 '15 22:11 aaronhoffman