You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importnws.NWSClient;
importnws.models.gridpoint.Gridpoint;
importnws.models.gridpoint.GridpointProperties;
importnws.models.point.Point;
importnws.models.point.PointProperties;
publicclassNWSClientTesting {
publicstaticvoidmain(String[] args) {
NWSClientnwsClient = newNWSClient();
try {
Pointpoint = nwsClient.getPoint(38.8894, -77.0352);
PointPropertiespointProperties = point.properties;
Gridpointgridpoint = nwsClient.getGridpoint(pointProperties.gridId, pointProperties.gridX, pointProperties.gridY);
GridpointPropertiesgridpointProperties = gridpoint.properties;
System.out.printf("The wind speed for the first period at %,.4f,%,.4f is %s%n", 38.8894, -77.0352, gridpointProperties.periods[0].windSpeed);
} catch (Exceptione) {
System.out.printf("Something went wrong: %s%n", e.getMessage());
}
// Output: The wind speed for the first period at 38.8894,-77.0352 is 2 mph// At the time of running
}
}
About
A Java API wrapper for the National Weather Service web API.