RSS Weather 3D Layer


PurposeThis sample is a comprehensive real life scenario for creating a new layer in order to consume a web service and display the information in a 3D environment using direct OpenGL plug-in.

In this sample you'll find implementation of simple editing capabilities, selection by attribute and by location, persistence, and identify.

The issues covered by this sample are:
1. Implementation of a GlobeCustomLayer through inheritance of a BaseClass.
2. Consuming web services (Yahoo RSS service).
3. Executing a lengthy ArcObjects task on a background thread.
4. Sharing resources between multiple threads.
5. Updating UI components from a background thread in order to keep responsiveness.
6. Creation of OpenGL display lists.
7. Mapping a bitmap into OpenGL texture and binding the texture to a geometry.
8. Technique to filter items which are outside the viewport
9. Technique to billboard items.
10. OpenGL selection buffer (in order to perform select by area).
11. Implementation of identification.
12. Implementing commands and tools to interact with a custom layer
13. Implementing a toolbar for GlobeControl and ArcGlobe

Development licensing Deployment licensing
Engine Developer Kit Engine: 3D Analyst
ArcView: 3D Analyst ArcView: 3D Analyst
ArcEditor: 3D Analyst ArcEditor: 3D Analyst
ArcInfo: 3D Analyst ArcInfo: 3D Analyst

Additional Requirements
  • This sample uses two datasets found under the Data directory: US_ZipCodes.shp and ZipCode_Boundaries_US_Major_Cities.shp.
  • This sample can only be done in C# (and not in VB.NET). This is because "unsafe" isn't supported in VB.NET, and it is needed here because pointers need to be used with this 3rd party library.

How to use

See Using the samples for help on compiling, setting up the debugger, and running the sample (either an exe or dll).

  1. Open the solution using Visual Studio 2005
  2. Build the solution
  3. Open a GlobeControl application or ArcGlobe
  4. From the toolbars list, select 'Weather' toolbar in order to add it to the application.
  5. Click the 'Load Layer' command in order to connect to Yahoo weather service.

RSSWeatherLayer3DClass.cs Implementation file of the custom layer
GlobeWeatherIdentifyObject.cs Implementation file of IIdentifyObject required in order to support standard identification
IDentifyDlg.cs The identify dialog used by the Identify object
AddWeatherLayerCmd.cs The command which connects and disconnects the layer from RSS web service.
RefreshLayerCmd.cs Command which spawns the update thread of the layer.
AddWeatherItemCmd.cs Command which allows to add new weather items by zip code.
ZipCodeDlg.cs Zip Code input dialog
AddWeatherItemTool.cs Allows adding a new weather item by clicking a location on the Globe.
SelectByCityNameCmd.cs Allows selection of weather items by selection from a list according to cityName.
WeatherItemSelectionDlg.cs Selection dialog for SelectByCityName command.
SelectItemsTool.cs Selection tool which allows select-by-location
WeatherLayerToolbar.cs The toolbar which hosts the layer's commands and tools.
GlobeCustomLayerBase.cs Abstract base class implementing essential interfaces required to implement an ArcGIS layer for ArcGlobe and GlobeControl
Download the C# files

Download the files for all languages

See Also:

How To get and install an OpenGL wrapper for .NET
How To draw a geographical object on the globe using direct OpenGL plugin
Implementing custom layers with dynamic feed
Using direct OpenGL in order to digitize on the globe surface
Writing Multithreaded ArcObjects Code