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
  • Loading branch information
NathanW2 committed Jun 23, 2017
1 parent 81855a7 commit 62f4534388a70cf03b6388a7af8ca175e019f236
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/providers/mssql/qgsmssqlprovider.cpp
@@ -883,10 +883,10 @@ bool QgsMssqlProvider::addFeatures( QgsFeatureList &flist, Flags flags )
if ( mGeometryColType == QLatin1String( "geometry" ) )
{
if ( mUseWkb )
values += QStringLiteral( "geometry::STGeomFromWKB(%1,%2).MakeValid()" ).arg(
values += QStringLiteral( "geometry::STGeomFromWKB(%1,%2)" ).arg(
QStringLiteral( "?" ), QString::number( mSRId ) );
else
values += QStringLiteral( "geometry::STGeomFromText(%1,%2).MakeValid()" ).arg(
values += QStringLiteral( "geometry::STGeomFromText(%1,%2)" ).arg(
QStringLiteral( "?" ), QString::number( mSRId ) );
}
else

5 comments on commit 62f4534

@nyalldawson

This comment has been minimized.

Copy link
Collaborator

@nyalldawson nyalldawson replied Jun 23, 2017

I probably should forward port the related changes i made in 2.18 branch....

@NathanW2

This comment has been minimized.

Copy link
Member Author

@NathanW2 NathanW2 replied Jun 23, 2017

@nyalldawson

This comment has been minimized.

Copy link
Collaborator

@nyalldawson nyalldawson replied Jun 23, 2017

isn't it already removed in 2.18?

@NathanW2

This comment has been minimized.

Copy link
Member Author

@NathanW2 NathanW2 replied Jun 23, 2017

@NathanW2

This comment has been minimized.

Copy link
Member Author

@NathanW2 NathanW2 replied Jun 23, 2017

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