Skip to content
Permalink
Browse files

[MSSQL] Better fix to removing MZ. Thanks to Nyall ;)

  • Loading branch information
NathanW2 committed Jun 23, 2017
1 parent 53305a8 commit dfd0d1f4273848dec0d2d76d05f24f6df97ee6c8
Showing with 2 additions and 5 deletions.
  1. +2 −5 src/providers/mssql/qgsmssqlprovider.cpp
@@ -989,8 +989,7 @@ bool QgsMssqlProvider::addFeatures( QgsFeatureList & flist )
// 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 );
}
@@ -1317,9 +1316,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 );
}

0 comments on commit dfd0d1f

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