mapwindow 6.0: an extensible architecture for cartographic symbology

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

Upload: sari

Post on 06-Jan-2016

40 views

Category:

Documents


3 download

DESCRIPTION

FOSS4G Conference October, 2009. MapWindow 6.0: An Extensible Architecture for Cartographic Symbology. Ted Dunsford. Ted Dunsford Graduate Research Assistant Idaho State University with Dr. Dan Ames, in collaboration with U.S. Environmental Protection Agency, - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology

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

SymbologySymbology

04/20/231 of 34

Ted Ted Dunsford Dunsford

FOSS4G ConferenceFOSS4G ConferenceOctober, 2009October, 2009

Page 2: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology

04/20/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

Overview

04/20/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

MapWindow 4 ActiveX Control

04/20/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

MapWindow 4 Application

04/20/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

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

Components

Component

Based

Architecture

Lets you…

7 of 34

Page 8: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology

Drag and Drop a New GIS!

04/20/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

Drag and Drop a Map

04/20/23 9 of 34

Page 10: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology

Drag’n Drop a Legend

04/20/23 10 of 34

Page 11: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology

Wire Controls Together

04/20/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

Even Plug-in Management!

04/20/23 12 of 34

Page 13: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology

Interfaces

13 of 34

ColorColor

WidthWidth

HeightHeight

Original Object

Page 14: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology

04/20/23 14 of 34

ColorColor

WidthWidth

HeightHeight

Unknown Object

???

Extensibility

Page 15: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology

04/20/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

04/20/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

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

Feature Symbology

04/20/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

Point Symbolizers

04/20/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

Symbolizers Stack Symbols

04/20/23 20 of 34

Page 21: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology

Built In Point Symbols

04/20/23 21 of 34

Page 22: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology

Simple Point Symbols

04/20/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

Character Point Symbols

04/20/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

Picture Point Symbols

04/20/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

Multiple Layers in Action

04/20/23 25 of 34

Page 26: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology

Point Categories

04/20/23 26 of 34

• Symbolizer• Selection Symbolizer

• Filter Expression

Page 27: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology

Filter Expressions

04/20/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

Multiple Categories

04/20/23 28 of 34

Page 29: MapWindow 6.0: An Extensible Architecture for Cartographic Symbology

Make Your Own ISymbol

04/20/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

UI for Custom Symbols

04/20/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

Save and Load Custom Symbols

04/20/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

XML File Saves Object Definition

04/20/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

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

Thanks!

34 of 34

Thanks to the

U.S. Environmental Protection Agency

AQUA TERRA Consultants

CUAHSI HIS

And

Dr. Daniel P. Ames