mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
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:
parent
a0cfea1785
commit
ceaf1dd5ff
@ -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:
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user