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
  • Loading branch information
NathanW2 committed Jun 23, 2017
1 parent 81855a7 commit 62f4534
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/providers/mssql/qgsmssqlprovider.cpp
Expand Up @@ -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
Expand Down

5 comments on commit 62f4534

@nyalldawson
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@NathanW2
Copy link
Member Author

@NathanW2 NathanW2 commented on 62f4534 Jun 23, 2017 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nyalldawson
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't it already removed in 2.18?

@NathanW2
Copy link
Member Author

@NathanW2 NathanW2 commented on 62f4534 Jun 23, 2017 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NathanW2
Copy link
Member Author

@NathanW2 NathanW2 commented on 62f4534 Jun 23, 2017 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.