The latest update to the AerisWeather Android SDK brings another addition to the supported AerisWeather API endpoints. In v2.6.0 we’ve added support for the Air Quality, Air Quality Forecast, and Tropical Cyclones Archive endpoints. In the next few paragraphs, we’ll discuss working with the Tropical Cyclones Archive data and step into a few code examples. The Air Quality endpoints will be covered in an upcoming article in the near future.
There is only a couple of months remaining in the Atlantic hurricane season, yet another storm reminds us that we’re not done with Tropical Cyclones yet. Hurricane Micheal asserted it’s presence this past weekend by plotting a potential course from the Gulf of Mexico through the Eastern part of the United States. Aside from Michael, Sergio and Leslie are still active, and for the Southern Hemisphere, the tropical season is just beginning. Yet, as the season continues on, previous storms have now become part of meteorological history. Just as important as tracking the current storms, there is also a need for information on past ones.
There are people who deal with storms long after the winds die down. These analysts focus on the storms of seasons past, trying to improve forecasting and warnings by analyzing historical data. For these folks, the busy time of year starts again now, and that’s one reason why the National Hurricane Center (NHC) and AerisWeather provide archived data. So with that in mind, let’s roll out the final chapter of the tropical cyclone story, and take a look at how the Android SDK supports the Tropical Cyclones Archive endpoint.
In our previous Android post, we reviewed the addition of the AerisWeather API Tropical Cyclone endpoint. Whereas that endpoint gives us data for the active storms, the Tropical Cyclones Archive endpoint focuses on storms in the past. Just as the endpoint we use for the active storms, the archive endpoint provides information based on data from the National Hurricane Center (NHC). Information from the Central Pacific Hurricane Center (CPHC), and the Joint Typhoon Warning Center (JTWC) are also included. Cyclone archive information is available from 1851 for the Atlantic basin and from the 1940s for the Pacific basin.
If you’ve already looked into the Tropical Cyclones endpoint, this will all seem very familiar. In fact, when querying tropical archive data from the AerisWeather API, we use the same response class that is used for handling query results for the active cyclones. One big difference with the archive response is the lack of data in the forecast section. Because, well, it’s an archive…
Here’s an example of generating a request for tropical cyclone archive data:
AerisRequest request = new AerisRequest(
new RadiusParameter(300, RadiusUnit.MILES));
JSONObject object = NetworkUtils.getJSONZipped(request, true);
TropicalCyclonesResponse response = new TropicalCyclonesResponse().fromTropicalJSON(object);
Once we have the response, we can parse out the data for the storms included:
AerisDataJSON data = response.getFirstResponse();
Profile profile = data.profile;
TropicalCycloneLifespan lifespan = data.profile.lifespan;
TropicalCycloneWindspeed windspeed = profile.windSpeed;
TropicalCyclonePressure pressure = profile.pressure;
TropicalCycloneTrack track = data.track;
TropicalCycloneLocation trackLocation = track.location;
TropicalCycloneDetails trackDetails = track.details;
TropicalCycloneDetailsMovement trackMovement = trackDetails.movement;
Not bad, right? With this data, we can analyze pressure trends, compare the movement to other meteorological factors, and plot out the tracks on our maps.
The examples above show us how to access detailed storm information from the Tropical Cyclones Archive endpoint. In addition, the AerisWeather Weather API also provides geojson data for mapping. Adding the archived cyclone data to your Android map is a simple one liner:
For more examples and code snippets, you can reference the previous post on using the SDK for active cyclones. Since the endpoints are so similar, most of it applies to both the active and archive endpoint support.
We hope you enjoy the new version and can’t wait to see what you make next!
The AerisWeather Android Team