Skip to content

Commit

Permalink
[MSSQL] Better fix to removing MZ. Thanks to Nyall ;)
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanW2 committed Jun 23, 2017
1 parent c793a92 commit b698612
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/providers/mssql/qgsmssqlprovider.cpp
Expand Up @@ -999,8 +999,7 @@ bool QgsMssqlProvider::addFeatures( QgsFeatureList &flist, Flags flags )
// Z and M on the end of a WKT string isn't valid for
// SQL Server so we have to remove it first.
wkt = geom.exportToWkt();
wkt = wkt.replace( "Z", "" );
wkt = wkt.replace( "M", "" );
wkt.replace(QRegExp("[mzMZ]+\\s*\\("), "(");
}
query.addBindValue( wkt );
}
Expand Down Expand Up @@ -1336,9 +1335,7 @@ bool QgsMssqlProvider::changeGeometryValues( const QgsGeometryMap &geometry_map
QString wkt = it->exportToWkt();
// Z and M on the end of a WKT string isn't valid for
// SQL Server so we have to remove it first.
wkt = wkt.replace( "Z", "" );
wkt = wkt.replace( "M", "" );
QgsDebugMsg( wkt );
wkt.replace(QRegExp("[mzMZ]+\\s*\\("), "(");
query.addBindValue( wkt );
}

Expand Down

0 comments on commit b698612

Please sign in to comment.