Query Weather Data from the Weather Stations feature layer provided in order to display weather conditions on the map.
How to Setup (Weather Sample Level)
- Open the RealTimeWeather level.
- Click on the ArcGISMapActor in the Outliner panel.
- Set your API key under the Authentication section in the Details panel.
- Click Play and select a city from the list.
How to Setup (Sample Viewer)
- Click Play in Unreal Editor.
- Input your API key under the API Key Drop-down.
- Click the Sample Drop-Down and select Weather Query.
How it works (C++)
- Create a new C++ class and make an HTTP request to query a feature layer.
- Create a new Blueprint Actor class
- Create the event to place the data returned from the Weather Query.
- Create a function to spawn the weather actor according to the data received in the query.
- Attach the ArcGIS Location Component to the weather actor blueprint class.
- Add additional functionality to spawn/show different Niagra Particle Effects based on the current weather data returned from the Weather Query.
- Create a widget for the viewport so users can select a city from the list fed from the feature service.
Note: You can use UE_LOG
to print log messages in the Output Log window and see if you are gathering the data properly from the feature service.
How it works (Blueprints)
- Go to the Plugins window (Edit -> Plugins) within Unreal Engine and enable the
HTTPBlueprint
Plugin. - Create a new Blueprint Class and make an HTTP request to query a feature layer.
- Create a new Blueprint Actor class
- Create the event to place the data returned from the Weather Query.
- Create a function to spawn the Weather Actor according to the data received in the query.
- Attach the ArcGIS Location Component to the Weather Actor Blueprint Class.
- Add additional functionality to spawn/show different Niagra Particle Effects based on the current weather data returned from the Weather Query.
- Create a widget for the viewport so users can select a city from the list fed from the feature service.
Note: You can use UE_LOG
to print log messages in the Output Log window and see if you are gathering the data properly from the feature service.
About the data
Data for Current Weather in the United States is fetched from a Feature Layer hosted by Esri. Elevation data is loaded from the Terrain 3D elevation layer hosted by Esri.
Tags
Feature Layer, Data Collection