Title: An Open-Source, Object-Oriented General Cartographic Transformation Program (GCTP)
1An Open-Source, Object-Oriented General
Cartographic Transformation Program (GCTP)
- Michael S. Williams, Michael P. Finn, and Robert
A. Buehler - United States Geological Survey
- National Geospatial Technical Operations Center
Presenting author Now with University of
Missouri Rolla, Department of Computer Science
2Outline
- Motivation
- Goals
- Background
- Design
- Class Structure
- Interface
- Adding New Projections
- Conclusions
- References
3Motivation
- Object-Oriented software development popularity
growing - Many existing libraries written in procedural
languages (C, for example) - Many current solutions involve using these
procedural libraries within object-oriented
frameworks (i.e. wrapping them) - Preferable to have a natively object-oriented
library to use
4Goals (Dos and Donts)
- Dont completely reinvent the wheel
- Dont just make a wrapper
- Do use existing algorithms
- Do make it simple to use
- Do make it easy to extend
5Background
- General Coordinate Transformation Package (GCTP)
- Originally written in Fortran
- Later converted to C
- Still very widely used
6Background
- Original GCTP interface very cumbersome.
7Background
- Original interface uses 19 parameters!
- Calling the gctp function results in much
redundant code execution. - How can we improve this?
8Design
9Design
- Simple Design
- Each supported projection contained in a single
class. - Each object inherits from the base class
Projection. - Projection class provides a common interface.
10Design
- Whats old and whats new
- Old
- Still supports the use of the 15 element
projection parameter array. - Core projection algorithms exactly the same.
- New
- Supports the use of get / set functions to view
and modify projection parameters. - No more 19 parameter function calls!!
11Design
Parameter Array
Variable Declarations
Output Units
Datum
Object Instantiation
Forward Transformation
Inverse Transformation
12Design
Setting Parameters
13Adding New Projections
- Basic Steps
- 1.) Derive a new class from Projection
- 2.) Implement the protected _init(), _forward(),
and _inverse() functions. - 3.) If the new projection uses specific entries
in the parameter array, implement the
_loadFromParams() function.
14Adding New Projections (example)
Constructors
Core Projection Function Declarations
15Adding New Projections (example)
Transformation results must be stored in
m_x_coord and m_y_coord, which are inherited from
the Projection base class.
16Adding New Projections (example)
First, a call must be made to the base class
parameter loading function
Here, the UTM specific parameters are pulled from
the parameter array.
Here, the UTM projection class member m_zone is
assigned a value based on the lat/lon values
pulled from the parameter array.
17Conclusions
- We have developed an object-oriented version of
an existing, widely used projection library. - We have made this library much easier to use than
the previous version. We have also made it easy
to extend. - Currently, the library is still in beta testing.
Further testing needs to be done to check
projection accuracy. - For further information (download available soon
for the latest version), please visit the
following website - http//carto-research.er.usgs.gov/
18An Open-Source, Object-Oriented GCTP
http//carto-research.er.usgs.gov/
- Michael S. Williams, Michael P. Finn, and Robert
A. Buehler - United States Geological Survey
- National Geospatial Technical Operations Center