Skip to content

Commit

Permalink
Debug output and adding mile as output unit for measuring
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6602 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
homann committed Feb 15, 2007
1 parent a0cfea1 commit ceaf1dd
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
32 changes: 27 additions & 5 deletions src/core/qgsdistancearea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion src/core/qgsspatialrefsys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit ceaf1dd

Please sign in to comment.