Skip to content
Permalink
Browse files

[MSSQL] Don't MakeValid on geometries

MakeValid can make geometry data we can't read back (e.g
GEOMETRYCOLLECTION) which is worse then
just a user error in the first place.  QGIS has the tools to deal with
this so let it came back to the user to fix

Backport of 541d44e717
  • Loading branch information
NathanW2 committed Jun 23, 2017
1 parent 7548cf0 commit 7d7be9bbb717586a78c14ed700429873aeff465d
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/providers/mssql/qgsmssqlprovider.cpp
@@ -879,10 +879,10 @@ bool QgsMssqlProvider::addFeatures( QgsFeatureList & flist )
if ( mGeometryColType == "geometry" )
{
if ( mUseWkb )
values += QString( "geometry::STGeomFromWKB(%1,%2).MakeValid()" ).arg(
values += QString( "geometry::STGeomFromWKB(%1,%2)" ).arg(
QString( "?" ), QString::number( mSRId ) );
else
values += QString( "geometry::STGeomFromText(%1,%2).MakeValid()" ).arg(
values += QString( "geometry::STGeomFromText(%1,%2)" ).arg(
QString( "?" ), QString::number( mSRId ) );
}
else

0 comments on commit 7d7be9b

Please sign in to comment.
You can’t perform that action at this time.