Skip to content

Commit 68871e4

Browse files
author
g_j_m
committed
Remedy for ticket #262 - when a SRS is considered invalid by geos, don'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
1 parent b095c61 commit 68871e4

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/gui/qgscoordinatetransform.cpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,22 @@ QgsRect QgsCoordinateTransform::transformBoundingBox(const QgsRect rect, Transfo
388388

389389
void QgsCoordinateTransform::transformCoords( const int& numPoints, double *x, double *y, double *z,TransformDirection direction)
390390
{
391-
assert(mSourceSRS.isValid());
392-
assert(mDestSRS.isValid());
391+
// Refuse to transform the points if the srs's are invalid
392+
if (!mSourceSRS.isValid())
393+
{
394+
QgsLogger::critical( tr("The source spatial reference system (SRS) is not valid. ") +
395+
tr("The coordinates can not be reprojected. The SRS is: ") +
396+
mSourceSRS.proj4String() );
397+
return;
398+
}
399+
if (!mDestSRS.isValid())
400+
{
401+
QgsLogger::critical( tr("The destination spatial reference system (SRS) is not valid. ") +
402+
tr("The coordinates can not be reprojected. The SRS is: ") +
403+
mDestSRS.proj4String() );
404+
return;
405+
}
406+
393407
#ifdef QGISDEBUG
394408
//double xorg = x;
395409
//double yorg = y;

0 commit comments

Comments
 (0)