- Forward


Scientific Visualization and Animation: Examples from Geography


Prof. David Bernstein
James Madison University

Computer Science Department
bernstdh@jmu.edu

Print

From Longitude/Latitude to Cartesian Coordinates
Back SMYC Forward

Notation

longitude-latitude-to-cartesian
From Longitude/Latitude to Cartesian Coordinates (cont.)
Back SMYC Forward
  • Derivation of the Conversion:
    • \(\cos \phi = d / R \Rightarrow d = R \cos \phi\)
    • \(\cos \lambda = p_{z}/d \Rightarrow p_{z} = d \cos \lambda = R\cos \phi \cos \lambda\)
    • \(\sin \lambda = p_{x}/d \Rightarrow p_{x} = d \sin \lambda = R \cos \phi \sin \lambda\)
    • \(p_{y} = R \sin \phi\)
  • Note:
    • This is very similar to the conversion of spherical coordinates to Cartesian coordinates (but it uses the latitude not the colatitude)
From Longitude/Latitude to Cartesian Coordinates (cont.)
Back SMYC Forward
svaexamples/cartography/projections.c (Fragment: lonlat2xyz)
 
Visualizing a Globe
Back SMYC Forward
  • What We Need To Do:
    • Represent geographic features
    • Read country boundaries from a file
    • Create longitude/latitude lines
    • Draw geographic features
  • 3D Visualization:
    • We will use an orthographic visualization (i.e., we will essentially ignore \(z\) coordinates)
Visualizing a Globe (cont.)
Back SMYC Forward
Representing Geographic Features
svaexamples/cartography/feature.c
 
Visualizing a Globe (cont.)
Back SMYC Forward
  • File Format:
    • One record description of each file (number of polygons, number of countries)
    • One record description of each polygon (polygon number, country number,number of vertices,country name)
    • Each polygon has one record for each vertex (longitude, latitude)
  • An Important Observation:
    • Each country might consist of several polygons
Visualizing a Globe (cont.)
Back SMYC Forward
Reading Country Borders
svaexamples/cartography/initialization.c (Fragment: readPolygons)
 
Visualizing a Globe (cont.)
Back SMYC Forward
Longitude/Latitude Lines
svaexamples/cartography/initialization.c (Fragment: createGrid)
 
Visualizing a Globe (cont.)
Back SMYC Forward
Drawing the Features
svaexamples/cartography/globe.c (Fragment: display)
 
Visualizing a Globe (cont.)
Back SMYC Forward
Putting It All Together
svaexamples/cartography/globe.c (Fragment: main)
 
Classical Map Projections
Back SMYC Forward
  • Objective:
    • Project points on the surface of the Earth onto a map
  • Some Intuition:
    • Shine a light onto or through a transparent Earth ` and capture the shadows cast by the opaque features
    • The parameters are: the shape of the screen (called the projection surface), the position of the projection surface, and the location of the light source
Classical Map Projectins (cont.)
Back SMYC Forward

Projection Surfaces

projection-surfaces
Classical Map Projectins (cont.)
Back SMYC Forward

Light Sources

projections_light-sources
Desirable Properties of Map Projections
Back SMYC Forward
  • The Most Common:
    • Conformal (i.e., angles are preserved)
    • Equal Area (i.e., areas are in constant proportion)
    • Equidistant (i.e., distances are in constant proportion)
  • An Important Mathematical Result:
    • A single projection can not be both conformal and equal area
Equatorial Cylindrical Equal Area Projection
Back SMYC Forward
  • Parameters:
    • \(\lambda_{0}\) is the standard longitude (i.e., the horizontal center of the projection)
  • Projection:
    • \(x = R (\lambda - \lambda_{0}) \)
    • \(y = R \sin(\phi)\)
  • Inverse:
    • \(\lambda = \lambda_{0} + \frac{x}{R}\)
    • \(\phi = \sin^{-1}(y / R)\)
Equatorial Cylindrical Equal Area Projection (cont.)
Back SMYC Forward

The World

projection_equatorial-cylindrical-equalarea_world
Equatorial Cylindrical Equal Area Projection (cont.)
Back SMYC Forward
svaexamples/cartography/projections.c (Fragment: cylindricalEqualArea)
 
Visualizing a Map
Back SMYC Forward
  • What We Need To Do:
    • Everything for visualizing a globe
    • Perform the projection
  • An Important Observation:
    • Some projections will "tear" polygons
Visualizing a Map (cont.)
Back SMYC Forward
Drawing the Features
svaexamples/cartography/map.c (Fragment: display)
 
There's Always More to Learn
Back -