File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -114,8 +114,8 @@ double QgsScaleCalculator::calculateGeographicDistance(QgsRect &mapExtent)
114
114
double a = pow (cos (lat * rads), 2 );
115
115
double c = 2.0 * atan2 (sqrt (a), sqrt (1.0 -a));
116
116
const static double ra = 6378000 ; // [m]
117
- const static double rb = 6357000 ; // [m]
118
- // The eccentricity. This comes from sqrt(1.0 - rb*rb/(ra*ra));
117
+ // The eccentricity. This comes from sqrt(1.0 - rb*rb/(ra*ra)) with rb set
118
+ // to 6357000 m.
119
119
const static double e = 0.0810820288 ;
120
120
double radius = ra * (1.0 - e*e) /
121
121
pow (1.0 - e*e*sin (lat*rads)*sin (lat*rads), 1.5 );
Original file line number Diff line number Diff line change @@ -290,10 +290,10 @@ bool QgsSpatialRefSys::createFromWkt(QString theWkt)
290
290
// that we can try to fill in the remaining class members...
291
291
// create from Proj wil set the isValidFalg
292
292
createFromProj4 (QString (proj4src));
293
+ CPLFree (proj4src);
294
+
293
295
return mIsValidFlag ;
294
296
// setMapunits will be called by createfromproj above
295
-
296
- CPLFree (proj4src);
297
297
}
298
298
299
299
bool QgsSpatialRefSys::createFromEpsg (long theEpsg)
@@ -518,7 +518,7 @@ bool QgsSpatialRefSys::createFromProj4 (const QString theProj4String)
518
518
}
519
519
// if (!myRecord.empty())
520
520
// What if descriptions aren't unique?
521
- if (NULL )
521
+ if (false )
522
522
{
523
523
mySrsId=myRecord[" srs_id" ].toLong ();
524
524
QgsDebugMsg (" QgsSpatialRefSys::createFromProj4 Projection Description match search for srsid returned srsid: " \
@@ -1016,6 +1016,12 @@ bool QgsSpatialRefSys::equals(QString theProj4CharArray)
1016
1016
OGRErr myInputResult1 = myOgrSpatialRef1.importFromProj4 ( myCharArrayPointer1 );
1017
1017
OGRErr myInputResult2 = myOgrSpatialRef2.importFromProj4 ( theProj4CharArray.latin1 () );
1018
1018
1019
+ // Could do some error reporting here...
1020
+ if (myInputResult1 != OGRERR_NONE)
1021
+ {}
1022
+ if (myInputResult2 != OGRERR_NONE)
1023
+ {}
1024
+
1019
1025
if (myOgrSpatialRef1.IsGeographic () && myOgrSpatialRef2.IsGeographic ())
1020
1026
{
1021
1027
// qWarning("QgsSpatialRefSys::operator== srs1 and srs2 are geographic ");
You can’t perform that action at this time.
0 commit comments