MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/ of 34 Ted Dunsford FOSS4G Conference October, 2009
12/6/ of 34 Ted Dunsford Graduate Research Assistant Idaho State University with Dr. Dan Ames, in collaboration with U.S. Environmental Protection Agency, AQUA TERRA Consultants, and CUAHSI
Overview 12/6/ of 34 MapWindow 6.0 & Component Architecture Extensibility & Interfaces Extensible Symbology Architecture
MapWindow 4 ActiveX Control 12/6/ of 34 The Map Window 4 project is a windows project that started with the idea of an ActiveX control. Very easy to use. Drag and drop files to open them. Built in zooming an panning. Works with a large number of languages.
MapWindow 4 Application 12/6/ of 34 Strictly 2D Requires ActiveX Supports one plug-in interface that controls the entire application. Fast C++ drawing but limited symbology Slow data manipulation
The Curent Project: MapWindow 4.x –Our Legacy Open Source project wrapping an ActiveX control MapWindow 5.x – Our Dot Net Web Mapping Tools 6 of 34 Community Code No ActiveX control dependencies Modular Extendable Versatile
Components Component Based Architecture Lets you… 7 of 34
Drag and Drop a New GIS! 12/6/ of 34 Tool Strip Pre-Loaded Buttons Status Strip Handles Progress Messages
Drag and Drop a Map 12/6/ of 34
Drag’n Drop a Legend 12/6/ of 34
Wire Controls Together 12/6/ of 34 Properties Right on the Controls allow them to link together.
Even Plug-in Management! 12/6/ of 34
Interfaces 13 of 34 Color Width Height Interface Original Object
12/6/ of 34 Color Width Height Interface Unknown Object ??? Extensibility
12/6/ of 34 MapWindow Defines Interfaces Color Width Height Interface MapWindow Plug-in Plug-ins provide new code that satisfies standardized interfaces.
12/6/ of 34 Interfaces Define the Plug-in MapWindow Interfaces MapWindow Application MapWindow searches for classes that implement specific interfaces by using System.Reflection
Managers Wrangle Plugins Plugins do the work: –Loading data –Performing a process –Handle events Managers decide which provider gets used. 17 of 34 deutsch.istockphoto.com
Feature Symbology 12/6/ of 34 Feature Layer FeatureSet Feature Scheme Symbology Feature Category Collection Categories Symbolizer (default) Feature Category 0 Feature Category 1 [0] [1] Symbolizer
Point Symbolizers 12/6/ of 34 Point Category Point Symbolizer Filter Expression List Symbols Character Symbol [1] [0] Your Symbol GetColor()
Symbolizers Stack Symbols 12/6/ of 34
Built In Point Symbols 12/6/ of 34
Simple Point Symbols 12/6/ of 34 Simple Symbols: Color Shape Symbols Size Offset Angle Outline Symbols Outline Color Outline Width Use Outline
Character Point Symbols 12/6/ of 34 Character Symbols: Character FontFamilyName Color Style Symbols Size Offset Angle * True Type fonts are scalable vectors, and many are symbolic.
Picture Point Symbols 12/6/ of 34 Picture Symbols: Image ImageFilename Opacity Symbols Size Offset Angle Outline Symbols Outline Color Outline Width Use Outline
Multiple Layers in Action 12/6/ of 34
Point Categories 12/6/ of 34 Symbolizer Selection Symbolizer Filter Expression
Filter Expressions 12/6/ of 34 PointCategory smallSize = new PointCategory(Color.Blue, PointShapes.Rectangle, 4); smallSize.FilterExpression = "[Area] <.01"; smallSize.LegendText = "Small Cities"; PointCategory largeSize = new PointCategory(Color.Yellow, PointShapes.Star, 16); largeSize.FilterExpression = "[Area] >=.01"; largeSize.LegendText = "Large Cities";
Multiple Categories 12/6/ of 34
Make Your Own ISymbol 12/6/ of 34 Step 1: Implement ISymbol public class Symbol : ISymbol Step 2: Draw public void Draw(Graphics g, double scale) { Rectangle bounds = new Rectangle(-5, -5, 10, 10); g.DrawEllipse(Pens.Black, bounds); }
UI for Custom Symbols 12/6/ of 34 Property Grid Built in to.Net Customizable Editors Adapts to Any Object Reflection Use System.Reflection More Design Control Much more effort
Save and Load Custom Symbols 12/6/ of 34 using MapWindow.Serialization; [Serialize("PointShapes")] public PointShapes PointShape { get { return _pointShape; } set { _pointShape = value; } } 1.Add Reference 2.Add an Attribute Tag
XML File Saves Object Definition 12/6/ of 34 Object Types Cached At The Top Types are re-used
Upcomming Goals File-based Vector Formats OGR Feature Providers Large scale raster & image handling 33 of 34
Thanks! 34 of 34 Thanks to the U.S. Environmental Protection Agency AQUA TERRA Consultants CUAHSI HIS And Dr. Daniel P. Ames