Skip to content

Commit

Permalink
Remedy for ticket #262 - when a SRS is considered invalid by geos, do…
Browse files Browse the repository at this point in the history
…n't call assert(), but rather just refuse to transform the point.

The real issue is why are some of the projections in qgis's database considered invalid by geos?


git-svn-id: http://svn.osgeo.org/qgis/trunk@6076 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Nov 11, 2006
1 parent b095c61 commit 68871e4
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/gui/qgscoordinatetransform.cpp
Expand Up @@ -388,8 +388,22 @@ QgsRect QgsCoordinateTransform::transformBoundingBox(const QgsRect rect, Transfo

void QgsCoordinateTransform::transformCoords( const int& numPoints, double *x, double *y, double *z,TransformDirection direction)
{
assert(mSourceSRS.isValid());
assert(mDestSRS.isValid());
// Refuse to transform the points if the srs's are invalid
if (!mSourceSRS.isValid())
{
QgsLogger::critical( tr("The source spatial reference system (SRS) is not valid. ") +
tr("The coordinates can not be reprojected. The SRS is: ") +
mSourceSRS.proj4String() );
return;
}
if (!mDestSRS.isValid())
{
QgsLogger::critical( tr("The destination spatial reference system (SRS) is not valid. ") +
tr("The coordinates can not be reprojected. The SRS is: ") +
mDestSRS.proj4String() );
return;
}

#ifdef QGISDEBUG
//double xorg = x;
//double yorg = y;
Expand Down

0 comments on commit 68871e4

Please sign in to comment.