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++;
|
polyData++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString err;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
transformCoords( nVertices, x.data(), y.data(), z.data(), direction );
|
transformCoords( nVertices, x.data(), y.data(), z.data(), direction );
|
||||||
}
|
}
|
||||||
catch ( const QgsCsException & )
|
catch ( const QgsCsException &e )
|
||||||
{
|
{
|
||||||
// rethrow the exception
|
// record the exception, but don't rethrow it until we've recorded the coordinates we *could* transform
|
||||||
QgsDebugMsg( QStringLiteral( "rethrowing exception" ) );
|
err = e.what();
|
||||||
throw;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QPointF *destPoint = poly.data();
|
QPointF *destPoint = poly.data();
|
||||||
@ -366,6 +366,10 @@ void QgsCoordinateTransform::transformPolygon( QPolygonF &poly, TransformDirecti
|
|||||||
destPoint->ry() = *srcY++;
|
destPoint->ry() = *srcY++;
|
||||||
destPoint++;
|
destPoint++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// rethrow the exception
|
||||||
|
if ( !err.isEmpty() )
|
||||||
|
throw QgsCsException( err );
|
||||||
}
|
}
|
||||||
|
|
||||||
void QgsCoordinateTransform::transformInPlace(
|
void QgsCoordinateTransform::transformInPlace(
|
||||||
|
@ -124,7 +124,14 @@ QPolygonF QgsSymbol::_getLineString( QgsRenderContext &context, const QgsCurve &
|
|||||||
//transform the QPolygonF to screen coordinates
|
//transform the QPolygonF to screen coordinates
|
||||||
if ( ct.isValid() )
|
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
|
// 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
|
//transform the QPolygonF to screen coordinates
|
||||||
if ( ct.isValid() )
|
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
|
// remove non-finite points, e.g. infinite or NaN points caused by reprojecting errors
|
||||||
|
Loading…
x
Reference in New Issue
Block a user