Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

Eckert6Test.cc File Reference

#include <iostream>
#include <iomanip>
#include "../../common/constants.h"
#include "../eckert6/Eckert6Projection.h"

Go to the source code of this file.


Functions

int  main ()

Function Documentation

int main ( )
 

Definition at line 51 of file Eckert6Test.cc.

00052 {
00053    //from page 368 of Map projections a working Manual
00054    //set the initial sphere settings.  These parameters should
00055    //generate an easting value of: 0.1693623m and a Northing value
00056    //of: -0.9570223m
00057    //
00058    double a          = 1;
00059    double b          = 1;
00060    double origMer    = -90.0*RAD_PER_DEG; //90% W lon.
00061    double falseEast  = 0.0;
00062    double falseNorth = 0.0;
00063 
00064    //Construct an Ecert4 Projection class with the initial
00065    //ellipsoid settings.
00066    Eckert6Projection aProjection(a, b, origMer, falseEast, falseNorth);
00067 
00068    //convert to easting norhting
00069    dpt aPt = aProjection.toEastingNorthing(gpt(-50*RAD_PER_DEG,
00070                                                -75*RAD_PER_DEG, 0));
00071    
00072    cout << "If the projection worked: given a S. lat = 50% and"<<endl;
00073    cout << "a W. lon of = 75% the output should be: "<<endl;
00074    cout << "Easting: 0.1693623 meters and Northing: -0.9570223 meters "
00075         << endl << endl;
00076    cout << "Output:\n" << setiosflags(ios::fixed) << setprecision(15)
00077         << "Easting: " <<  aPt.x << " Northing: " << aPt.y<< endl;
00078 
00079    //now invert back to degrees  for lat lon
00080    gpt aGpt = aProjection.toLatLon(aPt);
00081    
00082    cout << "We should get the original degrees back out:" <<endl;
00083    cout << "lat: " << (aGpt.x*DEG_PER_RAD) << " lon:" << (aGpt.y*DEG_PER_RAD)
00084         << endl;
00085 }

Generated at Sun Jan 11 00:07:39 2004 for OSSIM - Open Source Image Map by doxygen1.2.6 written by , © 1997-2001