An open API service indexing awesome lists of open source software.

https://github.com/sharpmap/sharpmap.rendering.thematics.categorytheme

A categorial theme for SharpMap
https://github.com/sharpmap/sharpmap.rendering.thematics.categorytheme

gis sharpmap thematic-maps

Last synced: about 1 year ago
JSON representation

A categorial theme for SharpMap

Awesome Lists containing this project

README

          

# SharpMap.Rendering.Thematics.CategoryTheme
A categorial theme for SharpMap

## Create a category theme using value ranges
```C#
// Create a category theme that can categorize double values
var ct = new CategoryTheme();
// Set the column name that holds the values to categorize
ct.ColumnName = "Value";
// Create a fallback style in case no category item matches
ct.Default = VectorStyle.CreateRandomStyle();

// Add category range items. This can be done unordered
ct.Add(new CategoryThemeRangeItem { LowerBound = 0d, UpperBound = 5d, Style = VectorStyle.CreateRandomStyle()});
ct.Add(new CategoryThemeRangeItem { LowerBound = 10d, UpperBound = 15d, Style = VectorStyle.CreateRandomStyle() });
ct.Add(new CategoryThemeRangeItem { LowerBound = 5d, UpperBound = 10d, Style = VectorStyle.CreateRandomStyle() });
ct.Add(new CategoryThemeRangeItem { LowerBound = 20d, UpperBound = 25d, Style = VectorStyle.CreateRandomStyle() });
```
## Create a category theme using specific values
```C#
// Create a category theme that can categorize string values
var ct = new CategoryTheme();
// Set the column name that holds the values to categorize
ct.ColumnName = "Value";
// Create a fallback style in case no category item matches
ct.Default = VectorStyle.CreateRandomStyle();

// Add category value items. These are not sorted automatically, you have to do that yourself.
ct.Add(new CategoryThemeValuesItem { Values = new List { "A", "B"} , Style = VectorStyle.CreateRandomStyle() });
ct.Add(new CategoryThemeValuesItem { Values = new List { "C", "D" }, Style = VectorStyle.CreateRandomStyle() });
ct.Add(new CategoryThemeValuesItem { Values = new List { "E", "F" }, Style = VectorStyle.CreateRandomStyle() });
ct.Add(new CategoryThemeValuesItem { Values = new List { "G", "H" }, Style = VectorStyle.CreateRandomStyle() });

```