From: <js...@us...> - 2007-12-28 20:04:38
|
Revision: 4795 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4795&view=rev Author: jswhit Date: 2007-12-28 12:04:31 -0800 (Fri, 28 Dec 2007) Log Message: ----------- revert the update to proj 4.6.0 Modified Paths: -------------- trunk/toolkits/basemap/src/PJ_gn_sinu.c trunk/toolkits/basemap/src/PJ_krovak.c trunk/toolkits/basemap/src/PJ_laea.c trunk/toolkits/basemap/src/PJ_wag3.c trunk/toolkits/basemap/src/emess.c trunk/toolkits/basemap/src/geocent.c trunk/toolkits/basemap/src/geocent.h trunk/toolkits/basemap/src/geod.c trunk/toolkits/basemap/src/nad_init.c trunk/toolkits/basemap/src/pj_datum_set.c trunk/toolkits/basemap/src/pj_factors.c trunk/toolkits/basemap/src/pj_gridinfo.c trunk/toolkits/basemap/src/pj_gridlist.c trunk/toolkits/basemap/src/pj_init.c trunk/toolkits/basemap/src/pj_latlong.c trunk/toolkits/basemap/src/pj_list.h trunk/toolkits/basemap/src/pj_open_lib.c trunk/toolkits/basemap/src/pj_release.c trunk/toolkits/basemap/src/pj_transform.c trunk/toolkits/basemap/src/pj_utils.c trunk/toolkits/basemap/src/proj_api.h trunk/toolkits/basemap/src/projects.h trunk/toolkits/basemap/src/rtodms.c Modified: trunk/toolkits/basemap/src/PJ_gn_sinu.c =================================================================== --- trunk/toolkits/basemap/src/PJ_gn_sinu.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/PJ_gn_sinu.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -75,6 +75,7 @@ if (!(P->en = pj_enfn(P->es))) E_ERROR_0; if (P->es) { + P->en = pj_enfn(P->es); P->inv = e_inverse; P->fwd = e_forward; } else { Modified: trunk/toolkits/basemap/src/PJ_krovak.c =================================================================== --- trunk/toolkits/basemap/src/PJ_krovak.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/PJ_krovak.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: PJ_krovak.c,v 1.9 2007/03/07 17:32:32 fwarmerdam Exp $ + * $Id: PJ_krovak.c,v 1.6 2006/09/14 13:10:50 fwarmerdam Exp $ * * Project: PROJ.4 * Purpose: Implementation of the krovak (Krovak) projection. @@ -30,15 +30,6 @@ ****************************************************************************** * * $Log: PJ_krovak.c,v $ - * Revision 1.9 2007/03/07 17:32:32 fwarmerdam - * remove orphan semicolon. - * - * Revision 1.8 2007/03/07 17:28:08 fwarmerdam - * Make it reasonably clear that this is ellipsoidal in the code. - * - * Revision 1.7 2007/03/07 17:25:34 fwarmerdam - * report krovak as ellipsoidal, not spherical - * * Revision 1.6 2006/09/14 13:10:50 fwarmerdam * Add +czech flag to control reversal of signs (bug 1133,147) * @@ -64,9 +55,9 @@ #include <string.h> #include <stdio.h> -PJ_CVSID("$Id: PJ_krovak.c,v 1.9 2007/03/07 17:32:32 fwarmerdam Exp $"); +PJ_CVSID("$Id: PJ_krovak.c,v 1.6 2006/09/14 13:10:50 fwarmerdam Exp $"); -PROJ_HEAD(krovak, "Krovak") "\n\tPCyl., Ellps."; +PROJ_HEAD(krovak, "Krovak") "\n\tPCyl., Sph."; /** NOTES: According to EPSG the full Krovak projection method should have @@ -93,7 +84,7 @@ -FORWARD(e_forward); /* ellipsoid */ +FORWARD(s_forward); /* spheroid */ /* calculate xy from lat/lon */ char errmess[255]; @@ -162,7 +153,7 @@ -INVERSE(e_inverse); /* ellipsoid */ +INVERSE(s_inverse); /* spheroid */ /* calculate lat/lon from xy */ /* Constants, identisch wie in der Umkehrfunktion */ @@ -267,14 +258,15 @@ /* as input and output, instead of lat/long relative to Ferro */ if (!pj_param(P->params, "tlon_0").i) P->lam0 = 0.7417649320975901 - 0.308341501185665; +; /* if scale not set default to 0.9999 */ if (!pj_param(P->params, "tk").i) P->k0 = 0.9999; /* always the same */ - P->inv = e_inverse; - P->fwd = e_forward; + P->inv = s_inverse; + P->fwd = s_forward; ENDENTRY(P) Modified: trunk/toolkits/basemap/src/PJ_laea.c =================================================================== --- trunk/toolkits/basemap/src/PJ_laea.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/PJ_laea.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -179,14 +179,8 @@ 0. : atan2(xy.x, xy.y); return (lp); } -FREEUP; - if (P) { - if (P->apa) - pj_dalloc(P->apa); - pj_dalloc(P); - } -} -ENTRY1(laea,apa) +FREEUP; if (P) pj_dalloc(P); } +ENTRY0(laea) double t; if (fabs((t = fabs(P->phi0)) - HALFPI) < EPS10) Modified: trunk/toolkits/basemap/src/PJ_wag3.c =================================================================== --- trunk/toolkits/basemap/src/PJ_wag3.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/PJ_wag3.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -5,7 +5,7 @@ double C_x; #define PJ_LIB__ # include <projects.h> -PROJ_HEAD(wag3, "Wagner III") "\n\tPCyl., Sph.\n\tlat_ts="; +PROJ_HEAD(wag3, "Wagner III") "\n\tPCyl., Sph."; #define TWOTHIRD 0.6666666666666666666667 FORWARD(s_forward); /* spheroid */ xy.x = P->C_x * lp.lam * cos(TWOTHIRD * lp.phi); Modified: trunk/toolkits/basemap/src/emess.c =================================================================== --- trunk/toolkits/basemap/src/emess.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/emess.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -3,15 +3,6 @@ static const char SCCSID[]="@(#)emess.c 4.6 94/05/24 GIE REL"; #endif -#ifdef _MSC_VER -# ifndef _CRT_SECURE_NO_DEPRECATE -# define _CRT_SECURE_NO_DEPRECATE -# endif -# ifndef _CRT_NONSTDC_NO_DEPRECATE -# define _CRT_NONSTDC_NO_DEPRECATE -# endif -#endif - #include <stdio.h> #include <stdlib.h> #include <stdarg.h> Modified: trunk/toolkits/basemap/src/geocent.c =================================================================== --- trunk/toolkits/basemap/src/geocent.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/geocent.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -65,9 +65,6 @@ * 25-02-97 Original Code * * $Log: geocent.c,v $ - * Revision 1.7 2007/09/11 20:19:36 fwarmerdam - * avoid use of static variables to make reentrant - * * Revision 1.6 2006/01/12 22:29:01 fwarmerdam * make geocent.c globals static to avoid conflicts * @@ -112,11 +109,29 @@ /***************************************************************************/ /* + * GLOBAL DECLARATIONS + */ +/* Ellipsoid parameters, default to WGS 84 */ +static double Geocent_a = 6378137.0; /* Semi-major axis of ellipsoid in meters */ +static double Geocent_b = 6356752.3142; /* Semi-minor axis of ellipsoid */ + +static double Geocent_a2 = 40680631590769.0; /* Square of semi-major axis */ +static double Geocent_b2 = 40408299984087.05; /* Square of semi-minor axis */ +static double Geocent_e2 = 0.0066943799901413800; /* Eccentricity squared */ +static double Geocent_ep2 = 0.00673949675658690300; /* 2nd eccentricity squared */ +/* + * These state variables are for optimization purposes. The only function + * that should modify them is Set_Geocentric_Parameters. + */ + + +/***************************************************************************/ +/* * FUNCTIONS */ -long pj_Set_Geocentric_Parameters (GeocentricInfo *gi, double a, double b) +long pj_Set_Geocentric_Parameters (double a, double b) { /* BEGIN Set_Geocentric_Parameters */ /* @@ -126,30 +141,29 @@ * a : Semi-major axis, in meters. (input) * b : Semi-minor axis, in meters. (input) */ - long Error_Code = GEOCENT_NO_ERROR; + long Error_Code = GEOCENT_NO_ERROR; - if (a <= 0.0) - Error_Code |= GEOCENT_A_ERROR; - if (b <= 0.0) - Error_Code |= GEOCENT_B_ERROR; - if (a < b) - Error_Code |= GEOCENT_A_LESS_B_ERROR; - if (!Error_Code) - { - gi->Geocent_a = a; - gi->Geocent_b = b; - gi->Geocent_a2 = a * a; - gi->Geocent_b2 = b * b; - gi->Geocent_e2 = (gi->Geocent_a2 - gi->Geocent_b2) / gi->Geocent_a2; - gi->Geocent_ep2 = (gi->Geocent_a2 - gi->Geocent_b2) / gi->Geocent_b2; - } - return (Error_Code); + if (a <= 0.0) + Error_Code |= GEOCENT_A_ERROR; + if (b <= 0.0) + Error_Code |= GEOCENT_B_ERROR; + if (a < b) + Error_Code |= GEOCENT_A_LESS_B_ERROR; + if (!Error_Code) + { + Geocent_a = a; + Geocent_b = b; + Geocent_a2 = a * a; + Geocent_b2 = b * b; + Geocent_e2 = (Geocent_a2 - Geocent_b2) / Geocent_a2; + Geocent_ep2 = (Geocent_a2 - Geocent_b2) / Geocent_b2; + } + return (Error_Code); } /* END OF Set_Geocentric_Parameters */ -void pj_Get_Geocentric_Parameters (GeocentricInfo *gi, - double *a, - double *b) +void pj_Get_Geocentric_Parameters (double *a, + double *b) { /* BEGIN Get_Geocentric_Parameters */ /* * The function Get_Geocentric_Parameters returns the ellipsoid parameters @@ -159,18 +173,17 @@ * b : Semi-minor axis, in meters. (output) */ - *a = gi->Geocent_a; - *b = gi->Geocent_b; + *a = Geocent_a; + *b = Geocent_b; } /* END OF Get_Geocentric_Parameters */ -long pj_Convert_Geodetic_To_Geocentric (GeocentricInfo *gi, - double Latitude, - double Longitude, - double Height, - double *X, - double *Y, - double *Z) +long pj_Convert_Geodetic_To_Geocentric (double Latitude, + double Longitude, + double Height, + double *X, + double *Y, + double *Z) { /* BEGIN Convert_Geodetic_To_Geocentric */ /* * The function Convert_Geodetic_To_Geocentric converts geodetic coordinates @@ -212,10 +225,10 @@ Sin_Lat = sin(Latitude); Cos_Lat = cos(Latitude); Sin2_Lat = Sin_Lat * Sin_Lat; - Rn = gi->Geocent_a / (sqrt(1.0e0 - gi->Geocent_e2 * Sin2_Lat)); + Rn = Geocent_a / (sqrt(1.0e0 - Geocent_e2 * Sin2_Lat)); *X = (Rn + Height) * Cos_Lat * cos(Longitude); *Y = (Rn + Height) * Cos_Lat * sin(Longitude); - *Z = ((Rn * (1 - gi->Geocent_e2)) + Height) * Sin_Lat; + *Z = ((Rn * (1 - Geocent_e2)) + Height) * Sin_Lat; } return (Error_Code); @@ -236,13 +249,12 @@ #define USE_ITERATIVE_METHOD -void pj_Convert_Geocentric_To_Geodetic (GeocentricInfo *gi, - double X, - double Y, - double Z, - double *Latitude, - double *Longitude, - double *Height) +void pj_Convert_Geocentric_To_Geodetic (double X, + double Y, + double Z, + double *Latitude, + double *Longitude, + double *Height) { /* BEGIN Convert_Geocentric_To_Geodetic */ #if !defined(USE_ITERATIVE_METHOD) /* @@ -309,12 +321,12 @@ Sin_B0 = T0 / S0; Cos_B0 = W / S0; Sin3_B0 = Sin_B0 * Sin_B0 * Sin_B0; - T1 = Z + gi->Geocent_b * gi->Geocent_ep2 * Sin3_B0; - Sum = W - gi->Geocent_a * gi->Geocent_e2 * Cos_B0 * Cos_B0 * Cos_B0; + T1 = Z + Geocent_b * Geocent_ep2 * Sin3_B0; + Sum = W - Geocent_a * Geocent_e2 * Cos_B0 * Cos_B0 * Cos_B0; S1 = sqrt(T1*T1 + Sum * Sum); Sin_p1 = T1 / S1; Cos_p1 = Sum / S1; - Rn = gi->Geocent_a / sqrt(1.0 - gi->Geocent_e2 * Sin_p1 * Sin_p1); + Rn = Geocent_a / sqrt(1.0 - Geocent_e2 * Sin_p1 * Sin_p1); if (Cos_p1 >= COS_67P5) { *Height = W / Cos_p1 - Rn; @@ -325,7 +337,7 @@ } else { - *Height = Z / Sin_p1 + Rn * (gi->Geocent_e2 - 1.0); + *Height = Z / Sin_p1 + Rn * (Geocent_e2 - 1.0); } if (At_Pole == FALSE) { @@ -389,7 +401,7 @@ RR = sqrt(X*X+Y*Y+Z*Z); /* special cases for latitude and longitude */ - if (P/gi->Geocent_a < genau) { + if (P/Geocent_a < genau) { /* special case, if P=0. (X=0., Y=0.) */ At_Pole = TRUE; @@ -397,9 +409,9 @@ /* if (X,Y,Z)=(0.,0.,0.) then Height becomes semi-minor axis * of ellipsoid (=center of mass), Latitude becomes PI/2 */ - if (RR/gi->Geocent_a < genau) { + if (RR/Geocent_a < genau) { *Latitude = PI_OVER_2; - *Height = -gi->Geocent_b; + *Height = -Geocent_b; return ; } @@ -421,8 +433,8 @@ */ CT = Z/RR; ST = P/RR; - RX = 1.0/sqrt(1.0-gi->Geocent_e2*(2.0-gi->Geocent_e2)*ST*ST); - CPHI0 = ST*(1.0-gi->Geocent_e2)*RX; + RX = 1.0/sqrt(1.0-Geocent_e2*(2.0-Geocent_e2)*ST*ST); + CPHI0 = ST*(1.0-Geocent_e2)*RX; SPHI0 = CT*RX; iter = 0; @@ -431,12 +443,12 @@ do { iter++; - RN = gi->Geocent_a/sqrt(1.0-gi->Geocent_e2*SPHI0*SPHI0); + RN = Geocent_a/sqrt(1.0-Geocent_e2*SPHI0*SPHI0); /* ellipsoidal (geodetic) height */ - *Height = P*CPHI0+Z*SPHI0-RN*(1.0-gi->Geocent_e2*SPHI0*SPHI0); + *Height = P*CPHI0+Z*SPHI0-RN*(1.0-Geocent_e2*SPHI0*SPHI0); - RK = gi->Geocent_e2*RN/(RN+*Height); + RK = Geocent_e2*RN/(RN+*Height); RX = 1.0/sqrt(1.0-RK*(2.0-RK)*ST*ST); CPHI = ST*(1.0-RK)*RX; SPHI = CT*RX; Modified: trunk/toolkits/basemap/src/geocent.h =================================================================== --- trunk/toolkits/basemap/src/geocent.h 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/geocent.h 2007-12-28 20:04:31 UTC (rev 4795) @@ -92,21 +92,9 @@ extern "C" { #endif -typedef struct -{ - double Geocent_a; /* Semi-major axis of ellipsoid in meters */ - double Geocent_b; /* Semi-minor axis of ellipsoid */ - double Geocent_a2; /* Square of semi-major axis */ - double Geocent_b2; /* Square of semi-minor axis */ - double Geocent_e2; /* Eccentricity squared */ - double Geocent_ep2; /* 2nd eccentricity squared */ -} GeocentricInfo; -void pj_Init_Geocentric( GeocentricInfo *gi ); -long pj_Set_Geocentric_Parameters( GeocentricInfo *gi, - double a, - double b); - + long pj_Set_Geocentric_Parameters (double a, + double b); /* * The function Set_Geocentric_Parameters receives the ellipsoid parameters * as inputs and sets the corresponding state variables. @@ -116,10 +104,8 @@ */ -void pj_Get_Geocentric_Parameters ( GeocentricInfo *gi, - double *a, - double *b); - + void pj_Get_Geocentric_Parameters (double *a, + double *b); /* * The function Get_Geocentric_Parameters returns the ellipsoid parameters * to be used in geocentric coordinate conversions. @@ -129,13 +115,12 @@ */ -long pj_Convert_Geodetic_To_Geocentric ( GeocentricInfo *gi, - double Latitude, - double Longitude, - double Height, - double *X, - double *Y, - double *Z); + long pj_Convert_Geodetic_To_Geocentric (double Latitude, + double Longitude, + double Height, + double *X, + double *Y, + double *Z); /* * The function Convert_Geodetic_To_Geocentric converts geodetic coordinates * (latitude, longitude, and height) to geocentric coordinates (X, Y, Z), @@ -151,13 +136,12 @@ */ -void pj_Convert_Geocentric_To_Geodetic (GeocentricInfo *gi, - double X, - double Y, - double Z, - double *Latitude, - double *Longitude, - double *Height); + void pj_Convert_Geocentric_To_Geodetic (double X, + double Y, + double Z, + double *Latitude, + double *Longitude, + double *Height); /* * The function Convert_Geocentric_To_Geodetic converts geocentric * coordinates (X, Y, Z) to geodetic coordinates (latitude, longitude, Modified: trunk/toolkits/basemap/src/geod.c =================================================================== --- trunk/toolkits/basemap/src/geod.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/geod.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -2,11 +2,11 @@ static const char SCCSID[]="@(#)geod.c 4.8 95/09/23 GIE REL"; #endif /* <<<< Geodesic filter program >>>> */ +# include <ctype.h> +# include <stdio.h> # include "projects.h" # include "geodesic.h" # include "emess.h" -# include <ctype.h> -# include <stdio.h> # include <string.h> # define MAXLINE 200 Modified: trunk/toolkits/basemap/src/nad_init.c =================================================================== --- trunk/toolkits/basemap/src/nad_init.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/nad_init.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: nad_init.c,v 1.10 2007/09/11 20:16:33 fwarmerdam Exp $ + * $Id: nad_init.c,v 1.8 2003/03/17 18:56:01 warmerda Exp $ * * Project: PROJ.4 * Purpose: Load datum shift files into memory. @@ -28,12 +28,6 @@ ****************************************************************************** * * $Log: nad_init.c,v $ - * Revision 1.10 2007/09/11 20:16:33 fwarmerdam - * Improve error recovery if ctable datum shift files fails to load. - * - * Revision 1.9 2006/11/17 22:16:30 mloskot - * Uploaded PROJ.4 port for Windows CE. - * * Revision 1.8 2003/03/17 18:56:01 warmerda * implement delayed loading of ctable format files * @@ -59,18 +53,9 @@ #include <projects.h> #include <stdio.h> #include <errno.h> +#include <assert.h> #include <string.h> -#ifdef _WIN32_WCE -/* assert.h includes all Windows API headers and causes 'LP' name clash. - * Here assert we disable assert() for Windows CE. - * TODO - mloskot: re-implement porting friendly assert - */ -# define assert(exp) ((void)0) -#else -# include <assert.h> -#endif /* _WIN32_WCE */ - /************************************************************************/ /* nad_ctable_load() */ /* */ @@ -90,15 +75,6 @@ if( ct->cvs == NULL || fread(ct->cvs, sizeof(FLP), a_size, fid) != a_size ) { - pj_dalloc( ct->cvs ); - ct->cvs = NULL; - - if( getenv("PROJ_DEBUG") != NULL ) - { - fprintf( stderr, - "ctable loading failed on fread() - binary incompatible?\n" ); - } - pj_errno = -38; return 0; } Modified: trunk/toolkits/basemap/src/pj_datum_set.c =================================================================== --- trunk/toolkits/basemap/src/pj_datum_set.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/pj_datum_set.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: pj_datum_set.c,v 1.4 2007/11/29 21:06:50 fwarmerdam Exp $ + * $Id: pj_datum_set.c,v 1.2 2001/04/04 21:13:21 warmerda Exp $ * * Project: PROJ.4 * Purpose: Apply datum definition to PJ structure from initialization string. @@ -28,12 +28,6 @@ ****************************************************************************** * * $Log: pj_datum_set.c,v $ - * Revision 1.4 2007/11/29 21:06:50 fwarmerdam - * make sure we only look for 7 parameters - * - * Revision 1.3 2007/01/31 06:41:01 fwarmerdam - * dont parse more datum parameters than we have room for in datum_params[] - * * Revision 1.2 2001/04/04 21:13:21 warmerda * do arcsecond/radian and ppm datum parm transformation in pj_set_datum() * @@ -119,7 +113,7 @@ /* parse out the parameters */ s = towgs84; - for( s = towgs84; *s != '\0' && parm_count < 7; ) + for( s = towgs84; *s != '\0'; ) { projdef->datum_params[parm_count++] = atof(s); while( *s != '\0' && *s != ',' ) Modified: trunk/toolkits/basemap/src/pj_factors.c =================================================================== --- trunk/toolkits/basemap/src/pj_factors.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/pj_factors.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -20,16 +20,15 @@ return 1; } else { /* proceed */ errno = pj_errno = 0; - if (h < EPS) - h = DEFAULT_H; - if (fabs(lp.phi) > (HALFPI - h)) - /* adjust to value around pi/2 where derived still exists*/ - lp.phi = lp.phi < 0. ? (-HALFPI+h) : (HALFPI-h); + if (fabs(t) <= EPS) /* adjust to pi/2 */ + lp.phi = lp.phi < 0. ? -HALFPI : HALFPI; else if (P->geoc) lp.phi = atan(P->rone_es * tan(lp.phi)); lp.lam -= P->lam0; /* compute del lp.lam */ if (!P->over) lp.lam = adjlon(lp.lam); /* adjust del longitude */ + if (h <= 0.) + h = DEFAULT_H; if (P->spc) /* get what projection analytic values */ P->spc(lp, P, fac); if (((fac->code & (IS_ANAL_XL_YL+IS_ANAL_XP_YP)) != Modified: trunk/toolkits/basemap/src/pj_gridinfo.c =================================================================== --- trunk/toolkits/basemap/src/pj_gridinfo.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/pj_gridinfo.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: pj_gridinfo.c,v 1.8 2006/11/17 22:16:30 mloskot Exp $ + * $Id: pj_gridinfo.c,v 1.7 2005/07/07 00:16:03 fwarmerdam Exp $ * * Project: PROJ.4 * Purpose: Functions for handling individual PJ_GRIDINFO's. Includes @@ -29,9 +29,6 @@ ****************************************************************************** * * $Log: pj_gridinfo.c,v $ - * Revision 1.8 2006/11/17 22:16:30 mloskot - * Uploaded PROJ.4 port for Windows CE. - * * Revision 1.7 2005/07/07 00:16:03 fwarmerdam * Fixed debug fprintf syntax per: * http://bugzilla.remotesensing.org/show_bug.cgi?id=886 @@ -62,17 +59,8 @@ #include <string.h> #include <math.h> #include <errno.h> +#include <assert.h> -#ifdef _WIN32_WCE -/* assert.h includes all Windows API headers and causes 'LP' name clash. - * Here assert we disable assert() for Windows CE. - * TODO - mloskot: re-implement porting friendly assert - */ -# define assert(exp) ((void)0) -#else -# include <assert.h> -#endif /* _WIN32_WCE */ - /************************************************************************/ /* swap_words() */ /* */ Modified: trunk/toolkits/basemap/src/pj_gridlist.c =================================================================== --- trunk/toolkits/basemap/src/pj_gridlist.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/pj_gridlist.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: pj_gridlist.c,v 1.5 2006/11/17 22:16:30 mloskot Exp $ + * $Id: pj_gridlist.c,v 1.4 2005/11/01 05:56:13 fwarmerdam Exp $ * * Project: PROJ.4 * Purpose: Code to manage the list of currently loaded (cached) PJ_GRIDINFOs @@ -29,9 +29,6 @@ ****************************************************************************** * * $Log: pj_gridlist.c,v $ - * Revision 1.5 2006/11/17 22:16:30 mloskot - * Uploaded PROJ.4 port for Windows CE. - * * Revision 1.4 2005/11/01 05:56:13 fwarmerdam * improved error handling if gridcount is zero * @@ -51,17 +48,8 @@ #include <projects.h> #include <string.h> #include <math.h> +#include <assert.h> -#ifdef _WIN32_WCE -/* assert.h includes all Windows API headers and causes 'LP' name clash. - * Here assert we disable assert() for Windows CE. - * TODO - mloskot: re-implement porting friendly assert - */ -# define assert(exp) ((void)0) -#else -# include <assert.h> -#endif /* _WIN32_WCE */ - static PJ_GRIDINFO *grid_list = NULL; /* used only by pj_load_nadgrids() and pj_deallocate_grids() */ Modified: trunk/toolkits/basemap/src/pj_init.c =================================================================== --- trunk/toolkits/basemap/src/pj_init.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/pj_init.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: pj_init.c,v 1.19 2007/11/26 00:21:59 fwarmerdam Exp $ + * $Id: pj_init.c,v 1.18 2006/10/12 21:04:39 fwarmerdam Exp $ * * Project: PROJ.4 * Purpose: Initialize projection object from string definition. Includes @@ -30,15 +30,6 @@ ****************************************************************************** * * $Log: pj_init.c,v $ - * Revision 1.19 2007/11/26 00:21:59 fwarmerdam - * Modified PJ structure to hold a_orig, es_orig, ellipsoid definition before - * adjustment for spherical projections. - * Modified pj_datum_transform() to use the original ellipsoid parameters, - * not the ones adjusted for spherical projections. - * Modified pj_datum_transform() to not attempt any datum shift via - * geocentric coordinates if the source *or* destination are raw ellipsoids - * (ie. PJD_UNKNOWN). All per PROJ bug #1602, GDAL bug #2025. - * * Revision 1.18 2006/10/12 21:04:39 fwarmerdam * Added experimental +lon_wrap argument to set a "center point" for * longitude wrapping of longitude values coming out of pj_transform(). @@ -82,7 +73,7 @@ #include <string.h> #include <errno.h> -PJ_CVSID("$Id: pj_init.c,v 1.19 2007/11/26 00:21:59 fwarmerdam Exp $"); +PJ_CVSID("$Id: pj_init.c,v 1.18 2006/10/12 21:04:39 fwarmerdam Exp $"); extern FILE *pj_open_lib(char *, char *); @@ -291,9 +282,6 @@ /* set ellipsoid/sphere parameters */ if (pj_ell_set(start, &PIN->a, &PIN->es)) goto bum_call; - PIN->a_orig = PIN->a; - PIN->es_orig = PIN->es; - PIN->e = sqrt(PIN->es); PIN->ra = 1. / PIN->a; PIN->one_es = 1. - PIN->es; Modified: trunk/toolkits/basemap/src/pj_latlong.c =================================================================== --- trunk/toolkits/basemap/src/pj_latlong.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/pj_latlong.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: pj_latlong.c,v 1.3 2007/11/30 20:02:31 fwarmerdam Exp $ + * $Id: pj_latlong.c,v 1.2 2000/07/07 06:04:23 warmerda Exp $ * * Project: PROJ.4 * Purpose: Stub projection implementation for lat/long coordinates. We @@ -30,9 +30,6 @@ ****************************************************************************** * * $Log: pj_latlong.c,v $ - * Revision 1.3 2007/11/30 20:02:31 fwarmerdam - * add latlon and lonlat aliases - * * Revision 1.2 2000/07/07 06:04:23 warmerda * added longlat alias * @@ -44,10 +41,8 @@ /* very loosely based upon DMA code by Bradford W. Drew */ #define PJ_LIB__ #include <projects.h> -PROJ_HEAD(lonlat, "Lat/long (Geodetic)") "\n\t"; -PROJ_HEAD(latlon, "Lat/long (Geodetic alias)") "\n\t"; -PROJ_HEAD(latlong, "Lat/long (Geodetic alias)") "\n\t"; -PROJ_HEAD(longlat, "Lat/long (Geodetic alias)") "\n\t"; +PROJ_HEAD(latlong, "Lat/long (Geodetic)") "\n\t"; +PROJ_HEAD(longlat, "Lat/long (Geodetic)") "\n\t"; FORWARD(forward); @@ -76,17 +71,3 @@ P->y0 = 0.0; P->inv = inverse; P->fwd = forward; ENDENTRY(P) - -ENTRY0(latlon) - P->is_latlong = 1; - P->x0 = 0.0; - P->y0 = 0.0; - P->inv = inverse; P->fwd = forward; -ENDENTRY(P) - -ENTRY0(lonlat) - P->is_latlong = 1; - P->x0 = 0.0; - P->y0 = 0.0; - P->inv = inverse; P->fwd = forward; -ENDENTRY(P) Modified: trunk/toolkits/basemap/src/pj_list.h =================================================================== --- trunk/toolkits/basemap/src/pj_list.h 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/pj_list.h 2007-12-28 20:04:31 UTC (rev 4795) @@ -55,10 +55,8 @@ PROJ_HEAD(lagrng, "Lagrange") PROJ_HEAD(larr, "Larrivee") PROJ_HEAD(lask, "Laskowski") -PROJ_HEAD(lonlat, "Lat/long (Geodetic)") -PROJ_HEAD(latlon, "Lat/long (Geodetic alias)") -PROJ_HEAD(latlong, "Lat/long (Geodetic alias)") -PROJ_HEAD(longlat, "Lat/long (Geodetic alias)") +PROJ_HEAD(latlong, "Lat/long (Geodetic)") +PROJ_HEAD(longlat, "Lat/long (Geodetic)") PROJ_HEAD(lcc, "Lambert Conformal Conic") PROJ_HEAD(lcca, "Lambert Conformal Conic Alternative") PROJ_HEAD(leac, "Lambert Equal Area Conic") @@ -73,6 +71,7 @@ PROJ_HEAD(merc, "Mercator") PROJ_HEAD(mil_os, "Miller Oblated Stereographic") PROJ_HEAD(mill, "Miller Cylindrical") +PROJ_HEAD(mpoly, "Modified Polyconic") PROJ_HEAD(moll, "Mollweide") PROJ_HEAD(murd1, "Murdoch I") PROJ_HEAD(murd2, "Murdoch II") Modified: trunk/toolkits/basemap/src/pj_open_lib.c =================================================================== --- trunk/toolkits/basemap/src/pj_open_lib.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/pj_open_lib.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: pj_open_lib.c,v 1.9 2007/07/06 14:58:03 fwarmerdam Exp $ + * $Id: pj_open_lib.c,v 1.6 2004/09/16 15:14:01 fwarmerdam Exp $ * * Project: PROJ.4 * Purpose: Implementation of pj_open_lib(), and pj_set_finder(). These @@ -31,15 +31,6 @@ ****************************************************************************** * * $Log: pj_open_lib.c,v $ - * Revision 1.9 2007/07/06 14:58:03 fwarmerdam - * improve searchpath clearning with pj_set_searchpath() - * - * Revision 1.8 2007/03/11 17:03:18 fwarmerdam - * support drive letter prefixes on win32 and related fixes (bug 1499) - * - * Revision 1.7 2006/11/17 22:16:30 mloskot - * Uploaded PROJ.4 port for Windows CE. - * * Revision 1.6 2004/09/16 15:14:01 fwarmerdam * * src/pj_open_lib.c: added pj_set_searchpath() provided by Eric Miller. * @@ -54,7 +45,7 @@ #include <string.h> #include <errno.h> -PJ_CVSID("$Id: pj_open_lib.c,v 1.9 2007/07/06 14:58:03 fwarmerdam Exp $"); +PJ_CVSID("$Id: pj_open_lib.c,v 1.6 2004/09/16 15:14:01 fwarmerdam Exp $"); static const char *(*pj_finder)(const char *) = NULL; static int path_count = 0; @@ -80,8 +71,7 @@ /* pj_set_searchpath() */ /* */ /* Path control for callers that can't practically provide */ -/* pj_set_finder() style callbacks. Call with (0,NULL) as args */ -/* to clear the searchpath set. */ +/* pj_set_finder() style callbacks. */ /************************************************************************/ void pj_set_searchpath ( int count, const char **path ) @@ -99,16 +89,13 @@ search_path = NULL; } - if( count > 0 ) + search_path = pj_malloc(sizeof *search_path * count); + for (i = 0; i < count; i++) { - search_path = pj_malloc(sizeof *search_path * count); - for (i = 0; i < count; i++) - { - search_path[i] = pj_malloc(strlen(path[i]) + 1); - strcpy(search_path[i], path[i]); - } + search_path[i] = pj_malloc(strlen(path[i]) + 1); + strcpy(search_path[i], path[i]); } - + path_count = count; } @@ -123,16 +110,9 @@ FILE *fid; int n = 0; int i; -#ifdef WIN32 - static const char dir_chars[] = "/\\"; -#else - static const char dir_chars[] = "/"; -#endif -#ifndef _WIN32_WCE - /* check if ~/name */ - if (*name == '~' && strchr(dir_chars,name[1]) ) + if (*name == '~' && name[1] == DIR_CHAR) if (sysname = getenv("HOME")) { (void)strcpy(fname, sysname); fname[n = strlen(fname)] = DIR_CHAR; @@ -143,10 +123,8 @@ return NULL; /* or fixed path: /name, ./name or ../name */ - else if (strchr(dir_chars,*name) - || (*name == '.' && strchr(dir_chars,name[1])) - || (!strncmp(name, "..", 2) && strchr(dir_chars,name[2])) - || (name[1] == ':' && strchr(dir_chars,name[2])) ) + else if (*name == DIR_CHAR || (*name == '.' && name[1] == DIR_CHAR) || + (!strncmp(name, "..", 2) && name[2] == DIR_CHAR) ) sysname = name; /* or try to use application provided file finder */ @@ -185,7 +163,4 @@ fid == NULL ? "failed" : "succeeded" ); return(fid); -#else - return NULL; -#endif /* _WIN32_WCE */ } Modified: trunk/toolkits/basemap/src/pj_release.c =================================================================== --- trunk/toolkits/basemap/src/pj_release.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/pj_release.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -2,7 +2,7 @@ #include <projects.h> -char const pj_release[]="Rel. 4.6.0, 21 Dec 2007"; +char const pj_release[]="Rel. 4.5.0, 22 Oct 2006"; const char *pj_get_release() Modified: trunk/toolkits/basemap/src/pj_transform.c =================================================================== --- trunk/toolkits/basemap/src/pj_transform.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/pj_transform.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: pj_transform.c,v 1.24 2007/12/03 15:48:20 fwarmerdam Exp $ + * $Id: pj_transform.c,v 1.20 2006/10/12 21:04:39 fwarmerdam Exp $ * * Project: PROJ.4 * Purpose: Perform overall coordinate system to coordinate system @@ -30,24 +30,6 @@ ****************************************************************************** * * $Log: pj_transform.c,v $ - * Revision 1.24 2007/12/03 15:48:20 fwarmerdam - * Improve WGS84 ES precision to avoid unnecesary transformation (#1531) - * - * Revision 1.23 2007/11/26 00:21:59 fwarmerdam - * Modified PJ structure to hold a_orig, es_orig, ellipsoid definition before - * adjustment for spherical projections. - * Modified pj_datum_transform() to use the original ellipsoid parameters, - * not the ones adjusted for spherical projections. - * Modified pj_datum_transform() to not attempt any datum shift via - * geocentric coordinates if the source *or* destination are raw ellipsoids - * (ie. PJD_UNKNOWN). All per PROJ bug #1602, GDAL bug #2025. - * - * Revision 1.22 2007/09/11 20:32:25 fwarmerdam - * mark the transient error array const - * - * Revision 1.21 2007/09/11 20:19:36 fwarmerdam - * avoid use of static variables to make reentrant - * * Revision 1.20 2006/10/12 21:04:39 fwarmerdam * Added experimental +lon_wrap argument to set a "center point" for * longitude wrapping of longitude values coming out of pj_transform(). @@ -128,14 +110,14 @@ #include <math.h> #include "geocent.h" -PJ_CVSID("$Id: pj_transform.c,v 1.24 2007/12/03 15:48:20 fwarmerdam Exp $"); +PJ_CVSID("$Id: pj_transform.c,v 1.20 2006/10/12 21:04:39 fwarmerdam Exp $"); #ifndef SRS_WGS84_SEMIMAJOR #define SRS_WGS84_SEMIMAJOR 6378137.0 #endif #ifndef SRS_WGS84_ESQUARED -#define SRS_WGS84_ESQUARED 0.0066943799901413165 +#define SRS_WGS84_ESQUARED 0.006694379990 #endif #define Dx_BF (defn->datum_params[0]) @@ -157,7 +139,7 @@ ** list or something, but while experimenting with it this should be fine. */ -static const int transient_error[45] = { +static int transient_error[45] = { /* 0 1 2 3 4 5 6 7 8 9 */ /* 0 to 9 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 10 to 19 */ 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, @@ -209,7 +191,7 @@ } } - if( pj_geocentric_to_geodetic( srcdefn->a_orig, srcdefn->es_orig, + if( pj_geocentric_to_geodetic( srcdefn->a, srcdefn->es, point_count, point_offset, x, y, z ) != 0) return pj_errno; @@ -306,7 +288,7 @@ return PJD_ERR_GEOCENTRIC; } - pj_geodetic_to_geocentric( dstdefn->a_orig, dstdefn->es_orig, + pj_geodetic_to_geocentric( dstdefn->a, dstdefn->es, point_count, point_offset, x, y, z ); if( dstdefn->fr_meter != 1.0 ) @@ -390,7 +372,6 @@ { double b; int i; - GeocentricInfo gi; pj_errno = 0; @@ -399,7 +380,7 @@ else b = a * sqrt(1-es); - if( pj_Set_Geocentric_Parameters( &gi, a, b ) != 0 ) + if( pj_Set_Geocentric_Parameters( a, b ) != 0 ) { pj_errno = PJD_ERR_GEOCENTRIC; return pj_errno; @@ -412,7 +393,7 @@ if( x[io] == HUGE_VAL ) continue; - if( pj_Convert_Geodetic_To_Geocentric( &gi, y[io], x[io], z[io], + if( pj_Convert_Geodetic_To_Geocentric( y[io], x[io], z[io], x+io, y+io, z+io ) != 0 ) { pj_errno = -14; @@ -435,14 +416,13 @@ { double b; int i; - GeocentricInfo gi; if( es == 0.0 ) b = a; else b = a * sqrt(1-es); - if( pj_Set_Geocentric_Parameters( &gi, a, b ) != 0 ) + if( pj_Set_Geocentric_Parameters( a, b ) != 0 ) { pj_errno = PJD_ERR_GEOCENTRIC; return pj_errno; @@ -455,8 +435,8 @@ if( x[io] == HUGE_VAL ) continue; - pj_Convert_Geocentric_To_Geodetic( &gi, x[io], y[io], z[io], - y+io, x+io, z+io ); + pj_Convert_Geocentric_To_Geodetic( x[io], y[io], z[io], + y+io, x+io, z+io ); } return 0; @@ -476,8 +456,8 @@ { return 0; } - else if( srcdefn->a_orig != dstdefn->a_orig - || ABS(srcdefn->es_orig - dstdefn->es_orig) > 0.000000000050 ) + else if( srcdefn->a != dstdefn->a + || ABS(srcdefn->es - dstdefn->es) > 0.000000000050 ) { /* the tolerence for es is to ensure that GRS80 and WGS84 are considered identical */ @@ -610,10 +590,6 @@ /************************************************************************/ /* pj_datum_transform() */ -/* */ -/* The input should be long/lat/z coordinates in radians in the */ -/* source datum, and the output should be long/lat/z */ -/* coordinates in radians in the destination datum. */ /************************************************************************/ int pj_datum_transform( PJ *srcdefn, PJ *dstdefn, @@ -627,26 +603,16 @@ pj_errno = 0; /* -------------------------------------------------------------------- */ -/* We cannot do any meaningful datum transformation if either */ -/* the source or destination are of an unknown datum type */ -/* (ie. only a +ellps declaration, no +datum). This is new */ -/* behavior for PROJ 4.6.0. */ -/* -------------------------------------------------------------------- */ - if( srcdefn->datum_type == PJD_UNKNOWN - || dstdefn->datum_type == PJD_UNKNOWN ) - return 0; - -/* -------------------------------------------------------------------- */ /* Short cut if the datums are identical. */ /* -------------------------------------------------------------------- */ if( pj_compare_datums( srcdefn, dstdefn ) ) return 0; - src_a = srcdefn->a_orig; - src_es = srcdefn->es_orig; + src_a = srcdefn->a; + src_es = srcdefn->es; - dst_a = dstdefn->a_orig; - dst_es = dstdefn->es_orig; + dst_a = dstdefn->a; + dst_es = dstdefn->es; /* -------------------------------------------------------------------- */ /* Create a temporary Z array if one is not provided. */ Modified: trunk/toolkits/basemap/src/pj_utils.c =================================================================== --- trunk/toolkits/basemap/src/pj_utils.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/pj_utils.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: pj_utils.c,v 1.5 2007/03/12 14:05:35 fwarmerdam Exp $ + * $Id: pj_utils.c,v 1.4 2005/07/06 14:04:09 fwarmerdam Exp $ * * Project: PROJ.4 * Purpose: Some utility functions we don't want to bother putting in @@ -29,9 +29,6 @@ ****************************************************************************** * * $Log: pj_utils.c,v $ - * Revision 1.5 2007/03/12 14:05:35 fwarmerdam - * Removed duplicate towgs84 definition code. - * * Revision 1.4 2005/07/06 14:04:09 fwarmerdam * Improved precision of es encoding for pj_latlong_from_proj() per: * http://bugzilla.remotesensing.org/show_bug.cgi?id=881 @@ -138,6 +135,10 @@ sprintf( defn+strlen(defn), " +towgs84=%s", pj_param(pj_in->params,"stowgs84").s ); + if( pj_param(pj_in->params, "ttowgs84").i ) + sprintf( defn+strlen(defn), " +towgs84=%s", + pj_param(pj_in->params,"stowgs84").s ); + if( pj_param(pj_in->params, "tnadgrids").i ) sprintf( defn+strlen(defn), " +nadgrids=%s", pj_param(pj_in->params,"snadgrids").s ); Modified: trunk/toolkits/basemap/src/proj_api.h =================================================================== --- trunk/toolkits/basemap/src/proj_api.h 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/proj_api.h 2007-12-28 20:04:31 UTC (rev 4795) @@ -28,12 +28,6 @@ ****************************************************************************** * * $Log: proj_api.h,v $ - * Revision 1.16 2007/11/29 21:07:49 fwarmerdam - * prepare for 4.6.0 release - * - * Revision 1.15 2007/08/20 13:40:06 fwarmerdam - * avoid warnings in c++ for some prototypes - * * Revision 1.14 2006/04/20 04:19:59 fwarmerdam * updated version * @@ -92,7 +86,7 @@ #endif /* Try to update this every version! */ -#define PJ_VERSION 460 +#define PJ_VERSION 450 extern char const pj_release[]; /* global release id string */ @@ -132,7 +126,7 @@ int pj_apply_gridshift( const char *, int, long point_count, int point_offset, double *x, double *y, double *z ); -void pj_deallocate_grids(void); +void pj_deallocate_grids(); int pj_is_latlong(projPJ); int pj_is_geocent(projPJ); void pj_pr_list(projPJ); @@ -146,8 +140,8 @@ void *pj_malloc(size_t); void pj_dalloc(void *); char *pj_strerrno(int); -int *pj_get_errno_ref(void); -const char *pj_get_release(void); +int *pj_get_errno_ref(); +const char *pj_get_release(); #ifdef __cplusplus } Modified: trunk/toolkits/basemap/src/projects.h =================================================================== --- trunk/toolkits/basemap/src/projects.h 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/projects.h 2007-12-28 20:04:31 UTC (rev 4795) @@ -28,21 +28,6 @@ ****************************************************************************** * * $Log: projects.h,v $ - * Revision 1.27 2007/11/26 00:21:59 fwarmerdam - * Modified PJ structure to hold a_orig, es_orig, ellipsoid definition before - * adjustment for spherical projections. - * Modified pj_datum_transform() to use the original ellipsoid parameters, - * not the ones adjusted for spherical projections. - * Modified pj_datum_transform() to not attempt any datum shift via - * geocentric coordinates if the source *or* destination are raw ellipsoids - * (ie. PJD_UNKNOWN). All per PROJ bug #1602, GDAL bug #2025. - * - * Revision 1.26 2007/03/11 17:03:18 fwarmerdam - * support drive letter prefixes on win32 and related fixes (bug 1499) - * - * Revision 1.25 2006/11/17 22:16:30 mloskot - * Uploaded PROJ.4 port for Windows CE. - * * Revision 1.24 2006/10/18 04:34:03 fwarmerdam * added mlist functions from libproj4 * @@ -164,15 +149,6 @@ extern double hypot(double, double); #endif -#ifdef _WIN32_WCE -# include <wce_stdlib.h> -# include <wce_stdio.h> -# define rewind wceex_rewind -# define getenv wceex_getenv -# define strdup _strdup -# define hypot _hypot -#endif - /* some useful constants */ #define HALFPI 1.5707963267948966 #define FORTPI 0.78539816339744833 @@ -188,17 +164,8 @@ #define ID_TAG_MAX 50 #endif -/* Use WIN32 as a standard windows 32 bit declaration */ -#if defined(_WIN32) && !defined(WIN32) && !defined(_WIN32_WCE) -# define WIN32 -#endif - -#if defined(_WINDOWS) && !defined(WIN32) && !defined(_WIN32_WCE) -# define WIN32 -#endif - /* directory delimiter for DOS support */ -#ifdef WIN32 +#ifdef DOS #define DIR_CHAR '\\' #else #define DIR_CHAR '/' @@ -298,10 +265,8 @@ int is_geocent; /* proj=geocent ... not really a projection at all */ double a, /* major axis or radius if es==0 */ - a_orig, /* major axis before any +proj related adjustment */ - es, /* e ^ 2 */ - es_orig, /* es before any +proj related adjustment */ e, /* eccentricity */ + es, /* e ^ 2 */ ra, /* 1/A */ one_es, /* 1 - e^2 */ rone_es, /* 1/one_es */ @@ -309,7 +274,7 @@ x0, y0, /* easting and northing */ k0, /* general scaling factor */ to_meter, fr_meter; /* cartesian scaling */ - + int datum_type; /* PJD_UNKNOWN/3PARAM/7PARAM/GRIDSHIFT/WGS84 */ double datum_params[7]; double from_greenwich; /* prime meridian offset (in radians) */ Modified: trunk/toolkits/basemap/src/rtodms.c =================================================================== --- trunk/toolkits/basemap/src/rtodms.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/rtodms.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -53,9 +53,7 @@ sec = fmod(r / RES, 60.); r = floor(r / RES60); min = fmod(r, 60.); - r = floor(r / 60.); - deg = r; - + deg = r / 60.; if (dolong) (void)sprintf(ss,format,deg,min,sec,sign); else if (sec) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |