Skip to content

Commit 5fef039

Browse files
committed
Case insensitive geos error evaluation
1 parent c6195fe commit 5fef039

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/core/qgsgeometryvalidator.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -235,22 +235,22 @@ void QgsGeometryValidator::run()
235235
if ( translatedErrors.empty() )
236236
{
237237
// Copied from https://git.osgeo.org/gitea/geos/geos/src/branch/master/src/operation/valid/TopologyValidationError.cpp
238-
translatedErrors.insert( QStringLiteral( "Topology Validation Error" ), QObject::tr( "Topology validation error", "GEOS Error" ) );
239-
translatedErrors.insert( QStringLiteral( "Repeated Point" ), QObject::tr( "Repeated point", "GEOS Error" ) );
240-
translatedErrors.insert( QStringLiteral( "Hole lies outside shell" ), QObject::tr( "Hole lies outside shell", "GEOS Error" ) );
241-
translatedErrors.insert( QStringLiteral( "Holes are nested" ), QObject::tr( "Holes are nested", "GEOS Error" ) );
242-
translatedErrors.insert( QStringLiteral( "Interior is disconnected" ), QObject::tr( "Interior is disconnected", "GEOS Error" ) );
243-
translatedErrors.insert( QStringLiteral( "Self-intersection" ), QObject::tr( "Self-intersection", "GEOS Error" ) );
244-
translatedErrors.insert( QStringLiteral( "Ring Self-intersection" ), QObject::tr( "Ring self-intersection", "GEOS Error" ) );
245-
translatedErrors.insert( QStringLiteral( "Nested shells" ), QObject::tr( "Nested shells", "GEOS Error" ) );
246-
translatedErrors.insert( QStringLiteral( "Duplicate Rings" ), QObject::tr( "Duplicate rings", "GEOS Error" ) );
247-
translatedErrors.insert( QStringLiteral( "Too few points in geometry component" ), QObject::tr( "Too few points in geometry component", "GEOS Error" ) );
248-
translatedErrors.insert( QStringLiteral( "Invalid Coordinate" ), QObject::tr( "Invalid coordinate", "GEOS Error" ) );
249-
translatedErrors.insert( QStringLiteral( "Ring is not closed" ), QObject::tr( "Ring is not closed", "GEOS Error" ) );
238+
translatedErrors.insert( QStringLiteral( "topology validation error" ), QObject::tr( "Topology validation error", "GEOS Error" ) );
239+
translatedErrors.insert( QStringLiteral( "repeated point" ), QObject::tr( "Repeated point", "GEOS Error" ) );
240+
translatedErrors.insert( QStringLiteral( "hole lies outside shell" ), QObject::tr( "Hole lies outside shell", "GEOS Error" ) );
241+
translatedErrors.insert( QStringLiteral( "holes are nested" ), QObject::tr( "Holes are nested", "GEOS Error" ) );
242+
translatedErrors.insert( QStringLiteral( "interior is disconnected" ), QObject::tr( "Interior is disconnected", "GEOS Error" ) );
243+
translatedErrors.insert( QStringLiteral( "self-intersection" ), QObject::tr( "Self-intersection", "GEOS Error" ) );
244+
translatedErrors.insert( QStringLiteral( "ring self-intersection" ), QObject::tr( "Ring self-intersection", "GEOS Error" ) );
245+
translatedErrors.insert( QStringLiteral( "nested shells" ), QObject::tr( "Nested shells", "GEOS Error" ) );
246+
translatedErrors.insert( QStringLiteral( "duplicate rings" ), QObject::tr( "Duplicate rings", "GEOS Error" ) );
247+
translatedErrors.insert( QStringLiteral( "too few points in geometry component" ), QObject::tr( "Too few points in geometry component", "GEOS Error" ) );
248+
translatedErrors.insert( QStringLiteral( "invalid coordinate" ), QObject::tr( "Invalid coordinate", "GEOS Error" ) );
249+
translatedErrors.insert( QStringLiteral( "ring is not closed" ), QObject::tr( "Ring is not closed", "GEOS Error" ) );
250250
}
251251

252252
const QString errorMsg( r );
253-
const QString translatedErrorMsg = translatedErrors.value( errorMsg, errorMsg );
253+
const QString translatedErrorMsg = translatedErrors.value( errorMsg.toLower(), errorMsg );
254254

255255
if ( g1 )
256256
{

0 commit comments

Comments
 (0)