Version

Using Geographic Contour Line Series

Purpose

This topic provides information on how to use the GeographicContourLineSeries type of series in the UltraGeographicMap™ control.

Required background

The following table lists the topics required as a prerequisite to understanding this topic.

Topic Purpose

This topic provides information about layout of map elements in the UltraGeographicMap control.

This topic provides information on how triangulation of data points works as well as how it can improve performance of rendering data in the UltraGeographicMap control.

This topic provides information on how to bind shape files with geo-spatial data to the UltraGeographicMap control.

Geographic Contour Line Series

Overview

In the UltraGeographicMap control, the GeographicContourLineSeries is a visual map element that draws colored contour lines, in a geographic context, based on a triangulation of longitude and latitude data with a numeric value assigned to each point.

This type of geographic series is useful for rendering scattered data defined by geographic locations such as weather temperature, atmospheric pressure, precipitation, population distribution, topographic data, etc. The GeographicContourLineSeries works a lot like the GeographicScatterAreaSeries except that it represents data as contour lines, colored using a fill scale and the geographic scatter area series, represents data as a surface interpolated using a color scale.

Preview

The following is a preview of the control with GeographicContourLineSeries plotting precipitation over the United States. Darker blue contours indicate lower precipitation and the lighter red contours indicate higher precipitation.

GeographicMap Using Geographic Contour Line Series 1.png

Data Requirements

Similar to other types of geographic series in the UltraGeographicMap control, the GeographicContourLineSeries has the DataSource property for data binding. This property can be bound to an object that implements an IEnumerable interface.

In addition, each item in the items source must have three data columns, two that store geographic location (longitude and latitude coordinates) and one data column that stores a value associated with the geographic location. These data column, are identified by LongitudeMemberPath, LatitudeMemberPath, and ValueMemberPath properties of the geographic series.

The GeographicContourLineSeries automatically performs built-in data triangulation on items in the DataSource if no triangulation is set to the TrianglesSource property. However, computing triangulation can be a very time-consuming process, so the runtime performance will be better when specifying a TriangulationSource for this property, especially when a large number of data items are present.

Note
Note:

Refer to the Triangulating Geographic Data topic for more information about the process of creating, saving, and loading triangulation data.

Data Binding

The following table summarizes properties of GeographicContourLineSeries used for data binding.

Property Name Property Type Description

IEnumerable

Gets or sets the source of items to perform triangulation on if the TrianglesSource property provides no triangulation data.

IEnumerable

Gets or sets the source of triangulation data. Setting Triangles of the TriangulationSource object to this property improves both runtime performance and geographic series rendering.

string

The name of the property containing the Longitude for each item in the DataSource.

string

The name of the property containing the Latitude for each item in the DataSource.

string

The name of the property on each data item containing a numeric value which can be converted to a brush by a fill scale set to the FillScale property.

string

The name of the property of the TrianglesSource items which, for each triangle, contains the index of the first vertex point in the DataSource. It is not mandatory to set this property. It is taken by default unless custom triangulation logic is provided.

string

The name of the property of the TrianglesSource items which, for each triangle, contains the index of the first vertex point in the DataSource. It is not mandatory to set this property. It is taken by default unless custom triangulation logic is provided.

string

The name of the property of the TrianglesSource items which, for each triangle, contains the index of the first vertex point in the DataSource. It is not mandatory to set this property. It is taken by default unless custom triangulation logic is provided.

Contour Fill Scale

Use the FillScale property of the GeographicContourLineSeries to resolve fill brushes of the contour lines of the geographic series.

The provided ValueBrushScale class should satisfy most of your coloring needs, but the application for custom coloring logic can inherit the ValueBrushScale class.

The following table list properties of the CustomPaletteColorScale affecting the surface coloring of the GeographicContourLineSeries.

Property Name Property Type Description

Brushes

Infragistics.Win.DataVisualization.BrushCollection

Gets or sets the collection of brushes for filling contours of the GeographicContourLineSeries

double

The highest value to assign a brush in a fill scale.

double

The lowest value to assign a brush in a fill scale.

Example

The following code shows how to bind the GeographicContourLineSeries to triangulation data representing precipitation over the United States.

In Visual Basic:

Dim itfConverter = New ItfConverter()
itfConverter.Source = New Uri("precipitation_observed_20110831.itf", UriKind.RelativeOrAbsolute)
Dim fillScale = New ValueBrushScale()
fillScale.MinimumValue = 0.05
fillScale.MinimumValue = 1.75
fillScale.Brushes = New BrushCollection()
fillScale.Brushes.Add(New SolidColorBrush(Colors.DarkRed))
fillScale.Brushes.Add(New SolidColorBrush(Colors.Red))
fillScale.Brushes.Add(New SolidColorBrush(Colors.Orange))
fillScale.Brushes.Add(New SolidColorBrush(Colors.Yellow))
Dim geoSeries = New GeographicContourLineSeries()
geoSeries.FillScale = fillScale
geoSeries.LongitudeMemberPath = "Point.X"
geoSeries.LatitudeMemberPath = "Point.Y"
geoSeries.TriangleVertexMemberPath1 = "V1"
geoSeries.TriangleVertexMemberPath2 = "V2"
geoSeries.TriangleVertexMemberPath3 = "V3"
geoSeries.DataSource = itfConverter.TriangulationSource.Points
geoSeries.TrianglesSource = itfConverter.TriangulationSource.Triangles

In C#:

var itfConverter = new ItfConverter();
itfConverter.Source = new Uri("precipitation_observed_20110831.itf", UriKind.RelativeOrAbsolute);
var fillScale = new ValueBrushScale();
fillScale.MinimumValue = 0.05;
fillScale.MinimumValue = 1.75;
fillScale.Brushes = new BrushCollection();
fillScale.Brushes.Add(new SolidColorBrush(Colors.DarkRed));
fillScale.Brushes.Add(new SolidColorBrush(Colors.Red));
fillScale.Brushes.Add(new SolidColorBrush(Colors.Orange));
fillScale.Brushes.Add(new SolidColorBrush(Colors.Yellow));
var geoSeries = new GeographicContourLineSeries();
geoSeries.FillScale = fillScale;
geoSeries.LongitudeMemberPath = "Point.X";
geoSeries.LatitudeMemberPath = "Point.Y";
geoSeries.TriangleVertexMemberPath1 = "V1";
geoSeries.TriangleVertexMemberPath2 = "V2";
geoSeries.TriangleVertexMemberPath3 = "V3";
geoSeries.DataSource = itfConverter.TriangulationSource.Points;
geoSeries.TrianglesSource = itfConverter.TriangulationSource.Triangles;

Related Content

The following topics provide additional information related to this topic.

Topic Purpose

This topic provides information about layout of map elements in the UltraGeographicMap control.

This topic provides information on how triangulation of data points works as well as how it can improve performance of rendering data in the UltraGeographicMap control.

This topic provides information on how to bind shape files with geo-spatial data to the UltraGeographicMap control.

This topic provides information on how to use the GeographicScatterAreaSeries type of series in the UltraGeographicMap control.