Index: src/core/qgsvectorfilewriter.cpp =================================================================== --- src/core/qgsvectorfilewriter.cpp (Revision 12258) +++ src/core/qgsvectorfilewriter.cpp (Arbeitskopie) @@ -98,6 +98,27 @@ QString layerName = shapefileName.left( shapefileName.indexOf( ".shp" ) ); OGRwkbGeometryType wkbType = static_cast( geometryType ); mLayer = OGR_DS_CreateLayer( mDS, QFile::encodeName( layerName ).data(), ogrRef, wkbType, NULL ); + + + //if it is a shapefile, ogr gives a wrong (esri style like) prj file back, which is missing the towgs84 parameter + //so we just overwrite it with a correct one + if(driverName == "ESRI Shapefile"){ + QRegExp regExp( ".shp$" ); + QString prjName = shapefileName; + 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 << srs->toWkt().toLocal8Bit().data() << endl; + prjFile.close(); + } + } if ( srs ) {