Index: src/providers/ogr/qgsogrprovider.cpp =================================================================== --- src/providers/ogr/qgsogrprovider.cpp (Revision 12258) +++ src/providers/ogr/qgsogrprovider.cpp (Arbeitskopie) @@ -1519,7 +1519,27 @@ { return false; } - + + //Ogr provides prj-files without the towgs84 parameter. So we just overwrite the prj file with a correct one + //just like we do in qgsvectorfilewriter + if(format == "ESRI Shapefile"){ + QRegExp regExp( ".shp$" ); + QString prjName = uri; + prjName.replace( regExp, QString( "" ) ); + prjName.append( QString( ".prj" ) ); + QFile prjFile( prjName ); + + if ( !prjFile.open( QIODevice::WriteOnly ) ) + { + QgsDebugMsg( "Couldn't open file " + prjName ); + } + else{ + QTextStream prjStream( & prjFile ); + prjStream << mySpatialRefSys.toWkt() << endl; + prjFile.close(); + } + } + //create the attribute fields QTextCodec* codec = QTextCodec::codecForName( encoding.toLocal8Bit().data() );