W2654 Data Visualization

From Coder Merlin
Revision as of 22:51, 1 April 2019 by Chukwuemeka-tinashe (talk | contribs) (Created page with "DRAFT ICON This tutorial will provide an introduction to Data Visualization. == Prerequisites == * 2651 CSV File Processing == Rese...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder

DRAFT ICON

This tutorial will provide an introduction to Data Visualization.

Prerequisites[edit]

Research[edit]

Experiment[edit]

First Steps[edit]

Create a new Igis shell project within your "project" directory.

cd ~/projects
git clone https://github.com/TangoGolfDigital/IgisShell project-2652

Enter into the Sources directory of the new project.

cd project-2652/Sources/IgisShell/

Copy your main.swift file and your Example-metars.csv file from project-2651.

cp ../../../project-2651/main.swift Metar.swift
cp ../../../project-2651/Example-metars.csv .
  • Remove any code from global scope in the Meter.swift file
  • Compile the project to ensure that it builds properly

Exercises[edit]

  1. In main.swift, choose a collection data type and read the data from the Example-metars.csv file into that type using your Metar class as the element type. Note that you must read the entire file, even if there are mistakes or omissions in that file. In such a case, you may skip only the errant line after printing a warning message to the console which must include the errant line number.
  2. Find a map of the United States suitable for use as the background of a weather map.
  3. Select a few metars from each state (except in the northeast where you may select only one per state). Using Igis, with the map as a full-screen background, plot the temperature (in celsius) of the station at the correct location on the map.

Hints:

  • This code snippet may be helpful Code_Snippet:_Read_File
  • This date formatter may be helpful ISO 8601 Date Formatter (Swift Documentation)
  • While reading the file, you may find it helpful to print debugging output, including the line number and contents of that line, prior to processing the line. This will help you to more quickly identify errors.


Key Concepts[edit]