mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
Catch GEOS exceptions when reshape tool is used on non-closed-linestring
And use qWarning() instead of QgsDebugMsg() to make tracing GEOS errors easier because a stack trace is printed.
This commit is contained in:
parent
58c34ae361
commit
37f1a16ce9
@ -32,6 +32,8 @@ email : morb at ozemail dot com dot au
|
||||
#include "qgsmessagelog.h"
|
||||
#include "qgsgeometryvalidator.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
#ifndef Q_WS_WIN
|
||||
#include <netinet/in.h>
|
||||
#else
|
||||
@ -96,7 +98,7 @@ static void throwGEOSException( const char *fmt, ... )
|
||||
vsnprintf( buffer, sizeof buffer, fmt, ap );
|
||||
va_end( ap );
|
||||
|
||||
QgsDebugMsg( QString( "GEOS exception: %1" ).arg( buffer ) );
|
||||
qWarning() << QString( "GEOS exception: %1" ).arg( buffer );
|
||||
|
||||
throw GEOSException( QString::fromUtf8( buffer ) );
|
||||
}
|
||||
@ -4877,7 +4879,15 @@ GEOSGeometry* QgsGeometry::reshapePolygon( const GEOSGeometry* polygon, const GE
|
||||
|
||||
GEOSGeom_destroy_r( geosinit.ctxt, reshapeResult );
|
||||
|
||||
newRing = GEOSGeom_createLinearRing_r( geosinit.ctxt, newCoordSequence );
|
||||
try
|
||||
{
|
||||
newRing = GEOSGeom_createLinearRing_r( geosinit.ctxt, newCoordSequence );
|
||||
}
|
||||
catch ( GEOSException &e )
|
||||
{
|
||||
QgsMessageLog::logMessage( QObject::tr( "Exception: %1" ).arg( e.what() ), QObject::tr( "GEOS" ) );
|
||||
}
|
||||
|
||||
if ( !newRing )
|
||||
{
|
||||
delete [] innerRings;
|
||||
|
Loading…
x
Reference in New Issue
Block a user