mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
Fix rendering polys/lines with reprojection errors under proj 6
This commit is contained in:
parent
a5e72c2c33
commit
cf91c09c3c
@ -346,15 +346,15 @@ void QgsCoordinateTransform::transformPolygon( QPolygonF &poly, TransformDirecti
|
||||
polyData++;
|
||||
}
|
||||
|
||||
QString err;
|
||||
try
|
||||
{
|
||||
transformCoords( nVertices, x.data(), y.data(), z.data(), direction );
|
||||
}
|
||||
catch ( const QgsCsException & )
|
||||
catch ( const QgsCsException &e )
|
||||
{
|
||||
// rethrow the exception
|
||||
QgsDebugMsg( QStringLiteral( "rethrowing exception" ) );
|
||||
throw;
|
||||
// record the exception, but don't rethrow it until we've recorded the coordinates we *could* transform
|
||||
err = e.what();
|
||||
}
|
||||
|
||||
QPointF *destPoint = poly.data();
|
||||
@ -366,6 +366,10 @@ void QgsCoordinateTransform::transformPolygon( QPolygonF &poly, TransformDirecti
|
||||
destPoint->ry() = *srcY++;
|
||||
destPoint++;
|
||||
}
|
||||
|
||||
// rethrow the exception
|
||||
if ( !err.isEmpty() )
|
||||
throw QgsCsException( err );
|
||||
}
|
||||
|
||||
void QgsCoordinateTransform::transformInPlace(
|
||||
|
@ -124,7 +124,14 @@ QPolygonF QgsSymbol::_getLineString( QgsRenderContext &context, const QgsCurve &
|
||||
//transform the QPolygonF to screen coordinates
|
||||
if ( ct.isValid() )
|
||||
{
|
||||
ct.transformPolygon( pts );
|
||||
try
|
||||
{
|
||||
ct.transformPolygon( pts );
|
||||
}
|
||||
catch ( QgsCsException & )
|
||||
{
|
||||
// we don't abort the rendering here, instead we remove any invalid points and just plot those which ARE valid
|
||||
}
|
||||
}
|
||||
|
||||
// remove non-finite points, e.g. infinite or NaN points caused by reprojecting errors
|
||||
@ -176,7 +183,14 @@ QPolygonF QgsSymbol::_getPolygonRing( QgsRenderContext &context, const QgsCurve
|
||||
//transform the QPolygonF to screen coordinates
|
||||
if ( ct.isValid() )
|
||||
{
|
||||
ct.transformPolygon( poly );
|
||||
try
|
||||
{
|
||||
ct.transformPolygon( poly );
|
||||
}
|
||||
catch ( QgsCsException & )
|
||||
{
|
||||
// we don't abort the rendering here, instead we remove any invalid points and just plot those which ARE valid
|
||||
}
|
||||
}
|
||||
|
||||
// remove non-finite points, e.g. infinite or NaN points caused by reprojecting errors
|
||||
|
Loading…
x
Reference in New Issue
Block a user