Skip to content
Permalink
Browse files

An invalid CRS should return unknown units for mapUnits

  • Loading branch information
nyalldawson committed Feb 28, 2017
1 parent fb53f54 commit 9dd71b8ffb7ef6fe21a241d2d4bbcc0112ce1234
@@ -1052,6 +1052,9 @@ bool QgsCoordinateReferenceSystem::isGeographic() const

QgsUnitTypes::DistanceUnit QgsCoordinateReferenceSystem::mapUnits() const
{
if ( !d->mIsValid )
return QgsUnitTypes::DistanceUnknownUnit;

return d->mMapUnits;
}

@@ -669,6 +669,9 @@ void TestQgsCoordinateReferenceSystem::mapUnits()
myCrs.createFromSrid( GEOSRID );
QVERIFY( myCrs.mapUnits() == QgsUnitTypes::DistanceDegrees );
debugPrint( myCrs );

// an invalid crs should return unknown unit
QCOMPARE( QgsCoordinateReferenceSystem().mapUnits(), QgsUnitTypes::DistanceUnknownUnit );
}
void TestQgsCoordinateReferenceSystem::setValidationHint()
{

0 comments on commit 9dd71b8

Please sign in to comment.
You can’t perform that action at this time.