1 / 18

An Open-Source, Object-Oriented General Cartographic Transformation Program (GCTP)

An 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

aspasia
Download Presentation

An Open-Source, Object-Oriented General Cartographic Transformation Program (GCTP)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. An 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

  2. Outline • Motivation • Goals • Background • Design • Class Structure • Interface • Adding New Projections • Conclusions • References

  3. Motivation • 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

  4. Goals (Do’s and Don’ts) • Don’t completely reinvent the wheel • Don’t just make a wrapper • Do use existing algorithms • Do make it simple to use • Do make it easy to extend

  5. Background • General Coordinate Transformation Package (GCTP) • Originally written in Fortran • Later converted to C • Still very widely used

  6. Background • Original GCTP interface very cumbersome.

  7. Background • Original interface uses 19 parameters! • Calling the gctp function results in much redundant code execution. • How can we improve this?

  8. Design

  9. Design • Simple Design • Each supported projection contained in a single class. • Each object inherits from the base class “Projection”. • Projection class provides a common interface.

  10. Design • What’s old and what’s 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!!

  11. Design Parameter Array Variable Declarations Output Units Datum Object Instantiation Forward Transformation Inverse Transformation

  12. Design Setting Parameters

  13. Adding 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.

  14. Adding New Projections (example) Constructors Core Projection Function Declarations

  15. Adding New Projections (example) Transformation results must be stored in m_x_coord and m_y_coord, which are inherited from the “Projection” base class.

  16. Adding 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.

  17. Conclusions • 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/

  18. http://carto-research.er.usgs.gov/ An Open-Source, Object-Oriented GCTP Michael S. Williams, Michael P. Finn, and Robert A. Buehler United States Geological Survey National Geospatial Technical Operations Center

More Related