Top Banner
MapWindow 6.0: An Extensible MapWindow 6.0: An Extensible Architecture for Architecture for Cartographic Symbology Cartographic Symbology 06/15/22 1 of 34 Ted Ted Dunsford Dunsford FOSS4G Conference FOSS4G Conference October, 2009 October, 2009
34

MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

Jan 17, 2016

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

MapWindow 6.0: An Extensible MapWindow 6.0: An Extensible Architecture for Cartographic Architecture for Cartographic

SymbologySymbology

04/21/231 of 34

Ted Ted Dunsford Dunsford

FOSS4G ConferenceFOSS4G ConferenceOctober, 2009October, 2009

Page 2: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

04/21/23 2 of 34

Ted DunsfordGraduate Research Assistant Idaho State University

with Dr. Dan Ames,

in collaboration withU.S. Environmental Protection Agency, AQUA TERRA Consultants, and CUAHSI

Page 3: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

Overview

04/21/23 3 of 34

• MapWindow 6.0 & Component Architecture

• Extensibility & Interfaces

• Extensible Symbology Architecture

Page 4: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

MapWindow 4 ActiveX Control

04/21/23 4 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.

Page 5: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

MapWindow 4 Application

04/21/23 5 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

Page 6: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

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

Page 7: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

Components

Component

Based

Architecture

Lets you…

7 of 34

Page 8: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

Drag and Drop a New GIS!

04/21/23 8 of 34

•Tool Strip•Pre-Loaded Buttons

•Status Strip•Handles Progress Messages

Page 9: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

Drag and Drop a Map

04/21/23 9 of 34

Page 10: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

Drag’n Drop a Legend

04/21/23 10 of 34

Page 11: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

Wire Controls Together

04/21/23 11 of 34

• Properties Right on the Controls allow them to link together.

Page 12: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

Even Plug-in Management!

04/21/23 12 of 34

Page 13: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

Interfaces

13 of 34

ColorColor

WidthWidth

HeightHeight

Original Object

Page 14: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

04/21/23 14 of 34

ColorColor

WidthWidth

HeightHeight

Unknown Object

???

Extensibility

Page 15: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

04/21/23 15 of 34

MapWindow Defines Interfaces

ColorColor

WidthWidth

HeightHeight

MapWindow

Plug-in Plug-in

Plug-ins provide new code that satisfies standardized interfaces.

Page 16: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

04/21/23 16 of 34

Interfaces Define the Plug-in

MapWindow Interfaces

MapWindow Application

MapWindow searches for classes that implement specific interfaces by using System.Reflection

www.ioffer.com

Page 17: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

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

Page 18: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

Feature Symbology

04/21/23 18 of 34

Feature LayerFeature Layer

FeatureSetFeatureSet

Feature SchemeFeature Scheme

Symbology

Feature Category Collection

Feature Category Collection

Categories

Symbolizer (default)

Feature Category 0Feature Category 0

Feature Category 1Feature Category 1

[0]

[1]

SymbolizerSymbolizer

SymbolizerSymbolizer

Page 19: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

Point Symbolizers

04/21/23 19 of 34

Point Category Point Category Point SymbolizerPoint Symbolizer

Filter Expression

Filter Expression List<ISymbol>List<ISymbol>

Symbols

Character SymbolCharacter Symbol[1]

[0] Your SymbolYour Symbol

GetColor()

Page 20: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

Symbolizers Stack Symbols

04/21/23 20 of 34

Page 21: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

Built In Point Symbols

04/21/23 21 of 34

Page 22: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

Simple Point Symbols

04/21/23 22 of 34

• Simple Symbols:• Color• Shape

• Symbols• Size• Offset• Angle

• Outline Symbols• Outline Color• Outline Width• Use Outline

Page 23: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

Character Point Symbols

04/21/23 23 of 34

• Character Symbols:• Character• FontFamilyName• Color• Style

• Symbols• Size• Offset• Angle

* True Type fonts are scalable vectors, and many are symbolic.

Page 24: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

Picture Point Symbols

04/21/23 24 of 34

• Picture Symbols:• Image• ImageFilename• Opacity

• Symbols• Size• Offset• Angle

• Outline Symbols• Outline Color• Outline Width• Use Outline

Page 25: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

Multiple Layers in Action

04/21/23 25 of 34

Page 26: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

Point Categories

04/21/23 26 of 34

• Symbolizer• Selection Symbolizer

• Filter Expression

Page 27: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

Filter Expressions

04/21/23 27 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";

Page 28: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

Multiple Categories

04/21/23 28 of 34

Page 29: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

Make Your Own ISymbol

04/21/23 29 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);}

Page 30: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

UI for Custom Symbols

04/21/23 30 of 34

• Property Grid• Built in to .Net• Customizable Editors• Adapts to Any Object

• Reflection• Use System.Reflection• More Design Control• Much more effort

Page 31: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

Save and Load Custom Symbols

04/21/23 31 of 34

using MapWindow.Serialization;

[Serialize("PointShapes")]public PointShapes PointShape{ get { return _pointShape; } set { _pointShape = value; } }

1. Add Reference

2. Add an Attribute Tag

Page 32: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

XML File Saves Object Definition

04/21/23 32 of 34

<item key="16" value="MapWindow.Drawing.SimpleSymbol, MapWindow, Version=6.0.0.0, Culture=neutral, PublicKeyToken=ca60e6823c3a6ee5" />

• Object Types Cached At The Top

• Types are re-used<item type="16"> <member name="XmlColor" type="17" value="#227A9A" /> <member name="Opacity" type="18" value="1" /> <member name="PointShapes" type="19" value="Star" />

Page 33: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

Upcomming Goals

• File-based Vector Formats

• OGR Feature Providers

• Large scale raster & image handling

33 of 34

Page 34: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology 12/6/2015 1 of 34 Ted Dunsford FOSS4G Conference October, 2009.

Thanks!

34 of 34

Thanks to the

U.S. Environmental Protection Agency

AQUA TERRA Consultants

CUAHSI HIS

And

Dr. Daniel P. Ames