Skip to content

Commit

Permalink
One CRS test failure left
Browse files Browse the repository at this point in the history
  • Loading branch information
timlinux committed Apr 7, 2012
1 parent 4d928f6 commit 26322b6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/core/qgscoordinatereferencesystem.h
Expand Up @@ -358,7 +358,14 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
*/
void setDescription( QString theDescription );
/* Set the Proj Proj4String.
* @param QString theProj4String Proj4 format specifies (excluding proj and ellips) that define this srs.
* @param QString theProj4String Proj4 format specifies
* (excluding proj and ellips) that define this srs.
* @note some content of the PROJ4 string may be stripped off by this
* method due to the parsing of the string by OSRNewSpatialReference .
* For example input:
* +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs
* Gets stored in the CRS as:
* +proj=longlat +datum=WGS84 +no_defs
*/
void setProj4String( QString theProj4String );
/*! Set this Geographic? flag
Expand Down
10 changes: 8 additions & 2 deletions tests/src/core/testqgscoordinatereferencesystem.cpp
Expand Up @@ -231,14 +231,20 @@ void TestQgsCoordinateReferenceSystem::toWkt()
myCrs.createFromSrid( GEOSRID );
QString myWkt = myCrs.toWkt();
debugPrint( myCrs );
QVERIFY( myWkt == GEOWKT );
//Note: this is not the same as GEOWKT as OGR strips off the TOWGS clause...
QString myStrippedWkt("GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID"
"[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],"
"AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"
"[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY"
"[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]]");
QVERIFY( myWkt == myStrippedWkt );
}
void TestQgsCoordinateReferenceSystem::toProj4()
{
QgsCoordinateReferenceSystem myCrs;
myCrs.createFromSrid( GEOSRID );
debugPrint( myCrs );
QVERIFY( myCrs.toProj4() == GEOPROJ4 );
QVERIFY( myCrs.toProj4() == "+proj=longlat +datum=WGS84 +no_defs" );
}
void TestQgsCoordinateReferenceSystem::geographicFlag()
{
Expand Down

0 comments on commit 26322b6

Please sign in to comment.