Debug output and adding mile as output unit for measuring

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6602 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
homann 2007-02-15 21:37:27 +00:00
parent a0cfea1785
commit ceaf1dd5ff
2 changed files with 30 additions and 6 deletions

View File

@ -643,7 +643,13 @@ QString QgsDistanceArea::textUnit(double value, int decimals, QGis::units u, boo
}
else
{
if (fabs(value) > 1000.0)
if (fabs(value) == 0.0)
{
// Special case for pretty printing.
unitLabel=QObject::tr(" m");
}
else if (fabs(value) > 1000.0)
{
unitLabel=QObject::tr(" km");
value = value/1000;
@ -667,14 +673,30 @@ QString QgsDistanceArea::textUnit(double value, int decimals, QGis::units u, boo
case QGis::FEET:
if (isArea)
{
unitLabel = QObject::tr(" sq ft");
if (fabs(value) > (528.0*528.0))
{
unitLabel = QObject::tr(" sq mile");
value = value / (5280.0*5280.0);
}
else
{
unitLabel = QObject::tr(" sq ft");
}
}
else
{
if (fabs(value) == 1.0)
unitLabel=QObject::tr(" foot");
if (fabs(value) > 528.0)
{
unitLabel = QObject::tr(" mile");
value = value / 5280.0;
}
else
unitLabel=QObject::tr(" feet");
{
if (fabs(value) == 1.0)
unitLabel=QObject::tr(" foot");
else
unitLabel=QObject::tr(" feet");
}
}
break;
case QGis::DEGREES:

View File

@ -452,7 +452,9 @@ bool QgsSpatialRefSys::isValid() const
}
else
{
QgsDebugMsg("The OGRe says it's an invalid SRS with proj4 string: " + mProj4String);
QgsDebugMsg("The OGRe says it's an invalid SRS (OGRErr = "
+ QString::number(myResult)
+ ") with proj4 string: " + mProj4String);
return false;
}
}