[OSRS-PROJ] Proj.4 vs Geotrans

Paul Selormey paul at toolscenter.org
Sat Mar 29 23:29:36 EST 2003


Hello Gerald,
I found your comments on the codes very interesting.
I am particularly interested in the first one...

> 1) it looks like it was written by a COBOL instructor. VERY
> verbose and full of VERY long identifiers.

I do not know if there is any rule on identifiers but using readable
identifiers is quite useful in open sources, especially where documentation
is minimum.
On the other hand, the single and double letter identifiers in the Proj.4
makes it very cryptic.

I do not think many will have problem with method names like

  void Get_Mercator_Parameters(double *a,
                               double *b,
                               double *Origin_Latitude,
                               double *Central_Meridian,
                               double *False_Easting,
                               double *False_Northing,
                               double *Scale_Factor);

as found in the GeoTrans codes.

> For the Mercator projection Geotrans took 373 lines while
> PJ_merc.c takes 80.

My copies of both libraries read GeoTrans: 380 vrs Proj4: 148, with
more than half of the 380 lines being COMMENTS which is hardly found
in the Proj4 files.
Typically, you find the comment for the above method as:

/*
 * The function Get_Mercator_Parameters returns the current ellipsoid
 * parameters, Mercator projection parameters, and scale factor.
 *
 *    a                 : Semi-major axis of ellipsoid, in meters   (output)
 *    b                 : Semi-minor axis of ellipsoid, in meters   (output)
 *    Origin_Latitude   : Latitude in radians at which the          (output)
 *                          point scale factor is 1.0
 *    Central_Meridian  : Longitude in radians at the center of     (output)
 *                          the projection
 *    False_Easting     : A coordinate value in meters assigned to the
 *                          central meridian of the projection.     (output)
 *    False_Northing    : A coordinate value in meters assigned to the
 *                          origin latitude of the projection       (output)
 *    Scale_Factor      : Multiplier which reduces distances in the
 *                          projection to the actual distance on the
 *                          ellipsoid                               (output)
 */

I do not know why someone will not prefer this to the macros stuff in the
Proj4.

Best regards,
Paul.


----------------------------------------
PROJ.4 Discussion List
See http://www.remotesensing.org/proj for subscription, unsubscription
and other information.



More information about the Proj mailing list