Skip to content
Permalink
Browse files
Remedy for ticket #262 - when a SRS is considered invalid by geos, do…
…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/qgis@6076 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Nov 11, 2006
1 parent 2a1692b commit 8c28c1ca528327c9c5dfe38d1a1eefd1872706f0
Showing with 16 additions and 2 deletions.
  1. +16 −2 src/gui/qgscoordinatetransform.cpp
@@ -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;

0 comments on commit 8c28c1c

Please sign in to comment.