Creating Maps with SAS/GRAPH - Drill Downs, Pop-Ups, and Animation.

Slides:



Advertisements
Similar presentations
Introduction to GRCP Boualem RABTA Center for World Food Studies (SOW-VU) Vrije Universiteit - Amsterdam.
Advertisements

Step-by-Step: Adjust a Chart Axis USE the Pricing Final presentation that is still open from the previous exercise. 1.Click the chart on slide 2 to select.
Using ODS Regions to Create Custom Reports Kate Morrow, M.S. Statistician Vermont Oxford Network, Burlington, VT.
Grey Level Enhancement Contrast stretching Linear mapping Non-linear mapping Efficient implementation of mapping algorithms Design of classes to support.
Demographics in Canada. Demographics – The study of population statistics Birth Rate – number of births per 1000 people in a population Death Rate – number.
International Dialogue Accommodating Special Needs.
Canada. Provinces/Territories Nova Scotia Nova Scotia Newfoundland and Labrador Newfoundland and Labrador P.E.I P.E.I New Brunswick New Brunswick Ontario.
1. Canadian Results PISA PISA 2012 by the numbers 3.
GIS Lecture 2 Map Design.
Thematic Mapping ArcView_module_3 May 12, 1:30 PM.
PowerPoint Lesson 3 Working with Visual Elements
Lesson 13 Another MACRO Example MAP Plotting. Macro Example Goal of Macro named Summary: For a given dataset give summary statistics using PROC CONTENTS,
British Columbia Immigration Source: Citizenship and Immigration Canada Facts and Figures Immigration Overview Annual Number of Immigrants to British.

The gchart Procedure The gchart Procedure is used to create bar charts of various types (it can also create pie charts. It’s most basic form would look.
Welcome to SAS…Session..!. What is SAS..! A Complete programming language with report formatting with statistical and mathematical capabilities.
SAS® Maps as Tools to Display and Clarify Healthcare Outcomes Barbara B. Okerson, HMC, Richmond, VA.
Dashboards With PROC GKPI September 25, 2009 Barry Hong
Preparing Data for Analysis and Analyzing Spatial Data/ Geoprocessing Class 11 GISG 110.
In this presentation we will elaborate more on the importance of Choropleth Maps, Group Layers, Scales, Attribute Classification, Definition Queries, Hyperlinks,
1 Chapter 5: Creating Summarized Output 5.1 Generating Summary Statistics 5.2 Creating a Summary Report with the Summary Tables Task 5.3 Creating and Applying.
Colors, Images, & Image Maps. Working with Color Colors are defined in terms of RGB Triplet –Red, Green, Blue –0 to 255 in intensity –(00, 00, 00) is.
1 Experimental Statistics - week 4 Chapter 8: 1-factor ANOVA models Using SAS.
 Confederation means a group of communities or colonies, who have signed or entered into an agreement to work together as one.
EDT Chapter 41 Review - Linetypes Sacramento City College EDT 310.
Lesson instructions Example. British Columbia Alberta.
VoiceXML Brandon Hannasch. Outline What is VoiceXML? Basic Tags Voice Recognition Audio Files Call Flow.
Basic Geographic Concepts GEOG 370 Instructor: Christine Erlien.
Authors : P K D. 1.Flag of Canada 2.Map of Canada 3.Introduction 4.Big Cities 5.Interesting Places.
Introduction to PROC GMap Presentation by Andrea Boan BMTRY 789.
Microsoft Publisher 2010 Chapter 4 Creating a Custom Publication from Scratch.
WORKBOOK FORMATTING Nolan Tomboulian Tomboulian.wikispaces.com HOW THINGS LOOK CELL COLORFONT COLOR CELL BORDERSFONT SIZE CELL SIZEFONT.
Microsoft Office Illustrated Introductory, Premium Edition A Presentation Modifying.
CONFEDERATION of Canada.
Geography of Canada Geographer’s Toolkit.
The Comparison of PARAMICS ( MODELLER ), GETRAM( TEDI ), CORSIM, and VISSIM Roundabout Construction Interchange Construction Workzone Construction Data.
GIS Lecture 2 Map Design.
Introduction to SAS/Graph 9.2 Ken Barz Colorado Prevention Center 22Oct2009 Ken Barz Colorado Prevention Center.
Advanced GIS Using ESRI ArcGIS 9.3 3D Analyst part 2.
Canada. New Brunswick Newfoundland Northwest Ter Nunavut Ontario Prince Edward Is. Quebec Saskatchewan Yukon Alberta British Columbia Manitoba Nova.
Canada in Maps Social Studies 10 Sutherland Secondary The Changing Face of Canada.
Median Age. Lutheran Membership Lutheran population by mother tongue.
Canada funnyv. What is Canada? Canada is a country in North America.
Canada. War  In the Canada there`s no war 10 provinces and 3 territories  Alberta  Manitoba  New-Brunswick  Newfoundland and Labrador  Nova Scotia.
Introduction to Processing. 2 What is processing? A simple programming environment that was created to make it easier to develop visually oriented applications.
Return to Outline Copyright © 2011 by Maribeth H. Price 3-1 Labeling and annotation.
Instructions Step 1: Try to identify each of Canada’s province and territory. Click on the province to discover the answer Next.
Effective SAS greplay’ing and how to avoid stretching By David Mottershead Senior Programmer, Quanticate.
Using the AccuGlobe Software with the IndianaMap Using the AccuGlobe Software.
PowerPoint Lesson 6 Working with Tables and Charts Microsoft Office 2010 Advanced Cable / Morrison 1.
Mapping Earth Chapter 1 Earth Science. Ch1 L.1 Maps How can a map help determine location? Why are there different map projections for representing Earth’s.
PROC GPLOT GPLOT is used to make two dimensional scatter-plots. General Syntax: proc gplot data=data-set options; plot y-variable*x-variable/options; run;
In the name of God Computer Graphics Bastanfard. Curve Function(2) Other method is approximate it using a poly-line. Just locate a set of points along.
Regions of Canada.
SAGExplore web server tutorial. The SAGExplore server has three different modules …
SAS/GRAPH The Basics. Today’s Topics GOPTIONS GPLOT GCHART GCONTOUR G3D.
7 sec. 3 Subregions of Canada. Atlantic Provinces Prince Edward Island, New Brunswick, Nova Scotia, Newfoundland Very small population, logging and fishing.
CMS SAS Users Group Conference Learn more about THE POWER TO KNOW ® October 17, 2011 PROC GMAP, HTML and You Thomas Kornfield, CMS.
Behind the Scenes with SAS®: Using Customer Graphics in SAS® Output Louise Hadden Abt Associates Inc.
Vector GIS. GIS 2 Graphic Features on the World Copyright – Kristen S. Kurland, Carnegie Mellon University.
BITMAPPED IMAGES & VECTOR DRAWN GRAPHICS
Unit One: Mapping Review
Binary Representation in Audio and Images
Key Terms Symbology Categorical attributes Style Layer file.
Introduction to PowerPoint
Canada.
Aboriginal Populations
In 2006, 80% of Canadians lived in urban centres
Slide Deck 10: Federal Elections
Presentation transcript:

Creating Maps with SAS/GRAPH - Drill Downs, Pop-Ups, and Animation

Creating Maps with SAS/GRAPH Today’s talk Basic capabilities of PROC GMAP Knowledge of SAS map data sets Colors and gray scales for choropleth maps Outline map Direct a graphics output to GIF and PDF files; New features: drill-downs, pop-ups, and animation.

Creating Maps with SAS/GRAPH QUICK LOOK AT BASICS STATIC DISPLAYS FOUR MAP TYPES CHOROPLETH PRISM BLOCK SURFACE DRILL-DOWNS POP-UPS ANIMATION

Creating Maps with SAS/GRAPH DATA SETS USED 1.CANADIAN POPULATION SOURCE: STATISTICS CANADA 2.Data sets that define the boundaries of areas that are mapped. SAS/GRAPH provides map data sets that allow one to create one or more maps of nearly every country in the world. All the maps are located in a MAPS subdirectory under the SAS root directory. Note, SAS/GRAPH maps must be installed to use the SAS-supplied maps.

Creating Maps with SAS/GRAPH EXAMPLE 1: CHOROPLETH MAP Creates two-dimensional maps in which values of the specified response variables are represented by varying patterns and colors.

Creating Maps with SAS/GRAPH EXAMPLE 1: CHOROPLETH MAP Production of a map with the GMAP procedure requires both a response and a map data set. SAS-SUPPLIED MAP OF CANADIAN PROVINCES (MAP) contains the information needed to draw map boundaries POPULATION DATA (RESPONSE) Contains the data that are to be displayed in a map. MATCH MAP AND RESPONSE DATA SETS COMMON VARIABLE SAME NAME, SAME TYPE SIMILAR TO DATA STEP MERGE

Creating Maps with SAS/GRAPH 2001 POPULATION DATA: produces a map of the distribution of population data canada_pop; Input province: $2. province_name & : $21. pop_2001: comma.; Label pop_2001 = 'POPULATION 2001‘ ; format pop: area: comma10.; datalines; 10 NEWFOUNDLAND 512, PRINCE EDWARD ISLAND 135, NOVA SCOTIA 908, NEW BRUNSWICK 729, QUEBEC 7,237, ONTARIO 11,410, MANITOBA 1,119, SASKATCHEWAN 978, ALBERTA 2,974, BRITISH COLUMBIA 3,907, YUKON 28, NORTHWEST TERRITORIES 64,105; run;

Creating Maps with SAS/GRAPH EXAMPLE 1: CHOROPLETH MAP goptions reset=all; title 'CANADIAN POPULATION BY PROVINCE, 2001'; footnote j=r 'EX01.SAS '; proc gmap data=canada_pop map=maps.canada2; id province; choro pop_2001; /*specifies the variable that are represented on the map */ run; quit; title; footnote;

Creating Maps with SAS/GRAPH

EXAMPLE 1: CHOROPLETH MAP goptions reset=all; title 'CANADIAN POPULATION BY PROVINCE, 2001'; footnote j=r 'EX01.SAS '; proc gmap data=canada_pop map=maps.canada2; id province; choro pop_2001 / levels=3; /*control the number of colors*/ run; quit; title; footnote;

Creating Maps with SAS/GRAPH

EXAMPLE 1: CHOROPLETH MAP goptions reset=all; title 'CANADIAN POPULATION BY PROVINCE, 2001'; footnote j=r 'EX01.SAS '; proc gmap data=canada_pop map=maps.canada2; id province; /*control the number of color: the number of response levels */ choro pop_2001 / discrete; *format pop_2001 popfmt.; run; quit; title; footnote;

Creating Maps with SAS/GRAPH

EXAMPLE 1: CHOROPLETH MAP USE FEW OPTIONS DEFAULT PATTERN SAS automatically determines the midpoints and assigns patterns to the map areas. LEVELS OPTION DISCRETE OPTION + USER-WRITTEN FORMAT LEGEND the CHORO statement produces a legend unless you use the NOLEGEND option or user-defined legend.

Creating Maps with SAS/GRAPH EXAMPLE 1: CHOROPLETH MAP NOTICE FONTS DEFAULT COLOR SELECTION POSITION AND LAYOUT OF LEGEND (Nunavut is not shown separated from the Northwest Territories since current SAS/GRAPH maps of Canada contain no boundary definitions for Nunavut.)

Creating Maps with SAS/GRAPH EXAMPLE 2 PRISM MAP (same data) Creates three-dimensional prism maps in which levels of magnitude of the specified response variables are represented by polyhedrons (raised polygons) of varying height, pattern, and color.

Creating Maps with SAS/GRAPH EXAMPLE 2 PRISM MAP (same data) goptions reset=all; title 'CANADIAN POPULATION BY PROVINCE, 2001'; footnote j=r 'EX02.SAS '; proc gmap data=canada_pop map=maps.canada2; id province; prism pop_2001; /*specifies the variable that are represented on the map */ run; quit; title; footnote;

Creating Maps with SAS/GRAPH

EXAMPLE 2 PRISM MAP (same data) goptions reset=all; title 'CANADIAN POPULATION BY PROVINCE, 2001'; footnote j=r 'EX02.SAS '; proc gmap data=canada_pop map=maps.canada2; id province; /* change the viewing angle of the map */ prism pop_2001 / zview=10.0 yview=-3.0 xview=-5.0; run; quit; title; footnote;

Creating Maps with SAS/GRAPH EXAMPLE 2 : PRISM MAP CHANGE VIEWING ANGLE The XVIEW, YVIEW, and ZVIEW specify the viewing position coordinates for the map. The XVIEW, YVIEW, and ZVIEW options on the RISM statement change the viewing position from the default value of a position above and to the south of the center of the map (values of.5, - 2.0, and 3.0 for the x, y, and z views respectively).

Creating Maps with SAS/GRAPH

EXAMPLE 2 PRISM MAP (same data) goptions reset=all; title 'CANADIAN POPULATION BY PROVINCE, 2001'; footnote j=r 'EX02.SAS '; proc gmap data=canada_pop map=maps.canada2; id province; /* change the viewing angle of the map and light source */ prism pop_2001 / zview=10.0 yview=-3.0 xview=-5.0 ylight=2; run; quit; title; footnote;

Creating Maps with SAS/GRAPH EXAMPLE 2 : PRISM MAP CHANGE LIGHT SOURCE XLIGHT, YLIGHT specify the coordinates of the imagined light source in the map coordinate system. The position of the light source controls the appearance of the edges of the map areas. The XLIGHT= and YLIGHT= options are used to shadow the side polygons of the prisms.

Creating Maps with SAS/GRAPH

EXAMPLE 2 : PRISM MAP NOTICE USING TWO FEATURES TO CONTRAST MAP AREAS - COLOR AND PRISM HEIGHT (GOOD IDEA?) MIGHT HAVE TO ADJUST VIEWING ANGLE TO MAKE ALL MAP AREAS VISIBLE

Creating Maps with SAS/GRAPH EXAMPLE 3: BLOCK MAP Creates three-dimensional block maps on which levels of magnitude of the specified response variables are represented by blocks of varying height, pattern, and color.

Creating Maps with SAS/GRAPH EXAMPLE 3 BLOCK MAP (same data) *** reset all graphics options to default values; options reset=all; *** create a block map with a title and a footnote; title 'CANADIAN POPULATION BY PROVINCE, 2001'; footnote j=r 'EX03.SAS '; proc gmap data=canada_pop map=maps.canada2; id province; block pop_2001 ; run; quit; title; footnote;

Creating Maps with SAS/GRAPH

EXAMPLE 3 BLOCK MAP (same data) *** reset all graphics options to default values; options reset=all; *** create a block map with a title and a footnote; title 'CANADIAN POPULATION BY PROVINCE, 2001'; footnote j=r 'EX03.SAS '; pattern1 v=s c=red r=12; pattern2 v=ms c=green; proc gmap data=canada_pop map=maps.canada2; id province; block pop_2001 / levels=12 shape=cylinder blocksize=5 xview=1.8 yview=-1.2 zview=1.0 nolegend coutline=black; run; quit; title; footnote;

Creating Maps with SAS/GRAPH

EXAMPLE 3: BLOCK MAP PATTERN statements create PATTERN definitions that define the color and type of area fill for patterns used in map areas in choropleth, block, and prism maps; blocks in block maps. COLOR=pattern-color VALUE=block/map-pattern block-pattern: EMPTY / SOLID map-pattern: MEMPTY / MSOLID REPEAT=number-of-times specifies the number of times that a PATTERN definition is applied before the next PATTERN definition is used. By default, REPEAT=1.

Creating Maps with SAS/GRAPH EXAMPLE 3: BLOCK MAP PATTERN statements Generating Pattern Sequences pattern1 v=s c=red r=12; pattern2 v=ms c=green; –specifying that all blocks are red (12 provinces) and that the map areas are green. Options used on the BLOCK statement –Twelve different levels are requested (one per province). –The shape and size of the blocks are changed. Just as was done with the PRISM map, the viewing angle is changed. –The block height, not color, displays population information. –The legend is suppressed (NOLEGEND). –By default, the map areas are outlined in their own color (in this example, green) so the COUTLINE option is used to specify a color for provincial boundaries.

Creating Maps with SAS/GRAPH EXAMPLE 3: BLOCK MAP NOTICE LEVELS OPTION + PATTERN STATEMENTS CHANGE VIEWING ANGLE CHANGE BLOCK SHAPE AND SIZE

Creating Maps with SAS/GRAPH EXAMPLE 4 SURFACE MAP Creates three-dimensional surface maps in which levels of magnitude of the specified response variables are represented by spikes of varying height.

Creating Maps with SAS/GRAPH EXAMPLE 4 SURFACE MAP *** reset all graphics options to default values; goptions reset=all; *** create a surface map with a title and footnote; title 'CANADIAN POPULATION BY PROVINCE, 2001'; footnote j=r 'EX04.SAS '; proc gmap data=canada_pop map=maps.canada2; id province; surface pop_2001; run; quit; title; footnote;

Creating Maps with SAS/GRAPH

EXAMPLE 4 SURFACE MAP *** reset all graphics options to default values; goptions reset=all; *** create a surface map with a title and footnote; title 'CANADIAN POPULATION BY PROVINCE, 2001'; footnote j=r 'EX04.SAS '; proc gmap data=canada_pop map=maps.canada2; id province; surface pop_2001 / rotate=80 tilt=45 nlines=100 constant=30 cbody=red; run; quit; title; footnote;

Creating Maps with SAS/GRAPH

EXAMPLE 4 SURFACE MAP Using a spike at the center of each map area displays map data. The height of the spike shows relative values of population. The map is intended to show a gradient in population rather than exact values. ROTATION, TILT options rotate the map about the z-axis and x-axis respectively (the default is 70 degrees for both options). NLINES option controls the number of lines used on the map surface (default 50, range ). CONSTANT controls the appearance of the spikes (both width and height). By default, constant=10...Values greater than 10 yield spikes that are wider at the base. Values less than 10 yield spikes that are narrower at the base... CBODY specifies the color that is used to draw the surface map.

Creating Maps with SAS/GRAPH EXAMPLE 4 SURFACE MAP NOTICE NO LEGEND EFFECT OF VARIOUS OPTIONS LIMITED USE OF COLOR (CBODY OPTION)

Creating Maps with SAS/GRAPH SAS-SUPPLIED MAP DATA SETS As stated earlier, SAS/GRAPH provides map data sets that allow one to create one or more maps of nearly every country in the world. At a minimum, a map data set contains three variables: X and Y (both numeric) that contain the coordinates of map areas (commonly, but not necessarily longitude and latitude); ID a variable that contains a value for the geographic area associated with each pair of X-Y variables.

Creating Maps with SAS/GRAPH SAS-SUPPLIED MAP DATA SETS Two other variables that may be present: SEGMENT is used by the GMAP procedure to draw map areas that may comprise more than one polygon. DENSITY can be used to reduce the number of X-Y coordinates used to draw map boundaries when less detailed maps are permissible.

Creating Maps with SAS/GRAPH SAS-SUPPLIED MAP DATA SETS SPECIAL DATA SET (METAMAPS) a data set with information about maps in the SAS library. *** display a list of maps in the MAPS library for Canada***; proc print data=maps.metamaps label; var country memname; where memtype eq 'DATA' and type eq 'GRAPH' and country = 'CANADA'; run;

Creating Maps with SAS/GRAPH SAS-SUPPLIED MAP DATA SETS SPECIAL DATA SET (METAMAPS) Library Name of Member Country Name CANADA CANADA CANADA CANADA2 CANADA CANADA3 CANADA CANADA4 CANADA CANCENS

Creating Maps with SAS/GRAPH SAS-SUPPLIED MAP DATA SETS Four map data sets for Canada: CANADA, CANADA2 draw maps of census districts within Canadian provinces. CANADA3, CANADA4 draw maps of Canadian provinces The data set CANCENS contains information about map areas: –province numbers and names –region numbers and names CREATE MAPS FROM SHAPEFILES (V9) version 9 has a new procedure, PROC MAPIMPORT, that allows one to convert shapefiles to map data sets.

Creating Maps with SAS/GRAPH PROJECTED AND UNPROJECTED MAP DATA SETS Contents of CANADA2 and CANADA4 Map Data Sets *******CANADA2 - 4,302 observations # Variable Type Len Label 1PROVINCE Char 2Province Abbreviation 2SEGMENTNum 5Province Segment Number 3 XNum 6X Coordinate 4 YNum 6Y Coordinate ******* CANADA4 - 31,311 observations # Variable Type Len Label 2 DENSITY Num 5 Density for Lower Resolution Maps 1 PROVINCE Char 2 Province Abbreviation 3 SEGMENT Num 5 Province Segment Number 4 X Num 6 Unprojected Longitude in Radians 5Y Num 6 Unprojected Latitude in Radians There are two differences: CANADA4 contains over seven times the number of X-Y coordinates as CANADA2; CANADA4 coordinates are unprojected.

Creating Maps with SAS/GRAPH

PROJECTED AND UNPROJECTED MAP DATA SETS There are several notable differences between the output of two maps: the map is backwards; the shape is distorted; there is much more detail in the map boundaries. Another SAS/GRAPH procedure must be used prior to PROC GMAP to project the unprojected map coordinates. *** project the CANADA4 map data set; proc gproject data=maps.canada4 out=c4_projected; id province; run;

Creating Maps with SAS/GRAPH PROJECTED AND UNPROJECTED MAP DATA SETS NOTICE VARIABLES (LABELS) NUMBER OF OBSERVATIONS

Creating Maps with SAS/GRAPH User-Defined COLORS AND GRAY SCALES IN CHOROPLETH MAPS PATTERN STATEMENT USER-DEFINED COLOR SCHEME *** choose a set of colors - sequentially increasing shades of blue; pattern1 v=ms c=cxeff3ff; pattern2 v=ms c=cxbdd7e7; pattern3 v=ms c=cx6baed6; pattern4 v=ms c=cx2171b5; LEGEND STATEMENT *** specify parameters for the legend; legend1origin=(75,60)pct across=1 mode=share label=(position=top j=c 'POPULATION PER' j=c 'SQUARE KILOMETER') shape=bar(3,4)pct cborder=blue;

Creating Maps with SAS/GRAPH

Create an Outline Map of British Columbia with Census Districts When a map showing only map boundaries (no data) is needed. USE MAP DATA SET AS RESPONSE DATA SET (ALL OPTION) USE UNPROJECTED MAP DATA SETS (Canada3) Only one observation need be used for the response data set.

Creating Maps with SAS/GRAPH Create an Outline Map of British Columbia with Census Districts *** reset all graphics options to default values; goptions reset=all; proc gproject data=maps.canada3 out=BC; where province eq '59'; id cdcode; run; pattern v=me; title 'BRITISH COLUMBIA REGIONS'; footnote j=r 'EX14.SAS '; proc gmap data=BC (obs=1) map=BC all; id cdcode; choro cdcode / nolegend; run; quit; title; footnote;

Creating Maps with SAS/GRAPH

ALTERNATIVE OUTPUT DESTINATIONS The file can easily be posted on the web or incorporated into other programs (e.g. PowerPoint). GIF (FILENAME STATEMENT) goptions reset=all device=gif /* select the GIF device driver*/ gsfname=mapout /* specify a FILEREF for the GIF file */ ftext='Arial/bo‘ /* select a font */ xpixels=800 /* map size */ ypixels=600 /* map size */; filename mapout ‘C:\My sas maps\map1.gif'; PDF (ODS) goptions reset=all ftext='Helvetica/bo‘ rotate=landscape; ods pdf file= ‘C:\my sas maps\map1.gif ' notoc; ods pdf close;

Creating Maps with SAS/GRAPH NEW FEATURES allow for the creation of maps with dynamic features: Drill Downs map areas can be hyperlinked to additional information; Pop-Ups additional information can be provided to map users when a mouse cursor passes over a map area; Animation a time dimension can be added using animation. (many gif files, layered into one file)