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
- Host: GitHub
- URL: https://github.com/sharpmap/sharpmap.rendering.thematics.categorytheme
- Owner: SharpMap
- Created: 2014-04-18T20:14:20.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2017-03-21T13:58:04.000Z (over 9 years ago)
- Last Synced: 2024-04-23T20:24:05.553Z (over 2 years ago)
- Topics: gis, sharpmap, thematic-maps
- Language: C#
- Size: 11.7 KB
- Stars: 5
- Watchers: 5
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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() });
```