Maps > Map Projections > Projecting Data: An Example > The Main Function
 
The Main Function
The main function in our example program initializes a Mercator projection and calls a function to perform forward and inverse projections.
Initializing a Projection
In our example, we create an instance of the class IlvMercatorProjection. This type of projection is often used in navigational applications.
All the projections in the library inherit from the abstract class IlvProjection and benefit from the same API. For this reason, we can call the function showProjection (written in the sample below) which takes any projection as an argument, provided that the projection inherits from the class IlvProjection. The showProjection function can be called for all the library functions.
IlvMercatorProjection projection;
showProjection (projection);
The signature of the showProjection function is:
void showProjection (const IlvProjection& projection);

Version 6.3
Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.