Skip to content

Commit

Permalink
[MSSQL] Don't MakeValid on geometries
Browse files Browse the repository at this point in the history
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 7d7be9b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/providers/mssql/qgsmssqlprovider.cpp
Expand Up @@ -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
Expand Down

0 comments on commit 7d7be9b

Please sign in to comment.