Skip to content
Permalink
Browse files
1 remaining test fails in CRS tests
  • Loading branch information
timlinux committed Apr 7, 2012
1 parent 26322b6 commit 1f43afd9ef6c0d194622a8a4d93cd7fa8d747a79
Showing with 14 additions and 1 deletion.
  1. +10 −0 src/core/qgscoordinatereferencesystem.cpp
  2. +4 −1 tests/src/core/testqgscoordinatereferencesystem.cpp
@@ -1014,6 +1014,16 @@ bool QgsCoordinateReferenceSystem::operator==( const QgsCoordinateReferenceSyste
{
QString myWkt = toWkt();
QString theirWkt = theSrs.toWkt();
// if there is a 0,0,0 based Bursa-Wolf conversion, we will test the
// wkt with the TOWGS84 string removed as OSRImportFromProj4
// (which is often used in the class to contruct an SRS)
// does not create the empty TOWGS84 string
// TODO check 3 parameter form too?
// see http://www.gdal.org/ogr/classOGRSpatialReference.html
// TODO this is probably an ugly hack, find a nicer approach TS
QString myToWGSString( ",TOWGS84[0,0,0,0,0,0,0]" );
myWkt.replace( myToWGSString, "" );
theirWkt.replace( myToWGSString, "" );
return mIsValidFlag && theSrs.mIsValidFlag && myWkt == theirWkt;
}

@@ -180,7 +180,10 @@ void TestQgsCoordinateReferenceSystem::equals()
QgsCoordinateReferenceSystem myCrs;
myCrs.createFromSrid( GEOSRID );
debugPrint( myCrs );
QVERIFY( myCrs.equals( GEOPROJ4 ) );
//Note: OSRImportFromProj4 (used internally by equals)
//drops the TOWGS from the WKT which causes this test to fail
QString myProj4( GEOPROJ4 );
QVERIFY( myCrs.equals( myProj4 ) );
}
void TestQgsCoordinateReferenceSystem::readXML()
{

0 comments on commit 1f43afd

Please sign in to comment.