Fixups for overloaded << operator in spatialrefsys class

git-svn-id: http://svn.osgeo.org/qgis/trunk@3397 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
timlinux 2005-05-15 00:45:47 +00:00
parent 001049be3e
commit a77ee55d80
2 changed files with 44 additions and 10 deletions

View File

@ -165,10 +165,10 @@ void QgsCoordinateTransform::initialise()
std::cout << "vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv"<< std::endl;
std::cout << "The OGR Coordinate transformation for this layer was set to" << std::endl;
//std::cout << "INPUT: " << std::endl << mSourceSRS << std::endl;
// std::cout << "PROJ4: " << std::endl << mProj4SrcParms << std::endl;
//std::cout << "OUTPUT: " << std::endl << mDestSRS << std::endl;
// std::cout << "PROJ4: " << std::endl << mProj4DestParms << std::endl;
// note overloaded << operator on qgsspatialrefsys cant be used on pointers -
// so we dereference them like this (*mSourceSRS) (Thanks Lars for pointing that out)
std::cout << "INPUT: " << std::endl << (*mSourceSRS) << std::endl;
std::cout << "OUTPUT: " << std::endl << (*mDestSRS) << std::endl;
std::cout << "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" << std::endl;
}

View File

@ -222,12 +222,46 @@ class QgsSpatialRefSys
//! Output stream operator
inline std::ostream& operator << (std::ostream& os, const QgsSpatialRefSys &r)
{
return os << "\n"
<< "Description : " << r.description().latin1() << "\n"
<< "Projection : " << r.projectionAcronym().latin1() << "\n"
<< "Ellipsoid : " << r.ellipsoidAcronym().latin1() << "\n"
<< "Proj4String : " << r.proj4String().latin1() << "\n"
<< std::endl;
QString mySummary ("\nSpatial Reference System:");
mySummary += "\n\tDescription : ";
if (r.description())
{
mySummary += r.description().latin1();
}
else
{
mySummary += "Undefined" ;
}
mySummary += "\n\tProjection : " ;
if (r.projectionAcronym())
{
r.projectionAcronym().latin1();
}
else
{
mySummary += "Undefined" ;
}
mySummary += "\n\tEllipsoid : ";
if (r.ellipsoidAcronym())
{
mySummary += r.ellipsoidAcronym().latin1();
}
else
{
mySummary += "Undefined" ;
}
mySummary += "\n\tProj4String : " ;
if (r.proj4String())
{
mySummary += r.proj4String().latin1();
}
else
{
mySummary += "Undefined" ;
}
return os << mySummary << std::endl;
}