fix_wrong_prj_files.diff
src/providers/ogr/qgsogrprovider.cpp (Arbeitskopie) | ||
---|---|---|
1519 | 1519 |
{ |
1520 | 1520 |
return false; |
1521 | 1521 |
} |
1522 | ||
1522 |
|
|
1523 |
//Ogr provides prj-files without the towgs84 parameter. So we just overwrite the prj file with a correct one |
|
1524 |
//just like we do in qgsvectorfilewriter |
|
1525 |
if(format == "ESRI Shapefile"){ |
|
1526 |
QRegExp regExp( ".shp$" ); |
|
1527 |
QString prjName = uri; |
|
1528 |
prjName.replace( regExp, QString( "" ) ); |
|
1529 |
prjName.append( QString( ".prj" ) ); |
|
1530 |
QFile prjFile( prjName ); |
|
1531 |
|
|
1532 |
if ( !prjFile.open( QIODevice::WriteOnly ) ) |
|
1533 |
{ |
|
1534 |
QgsDebugMsg( "Couldn't open file " + prjName ); |
|
1535 |
} |
|
1536 |
else{ |
|
1537 |
QTextStream prjStream( & prjFile ); |
|
1538 |
prjStream << mySpatialRefSys.toWkt() << endl; |
|
1539 |
prjFile.close(); |
|
1540 |
} |
|
1541 |
} |
|
1542 |
|
|
1523 | 1543 |
//create the attribute fields |
1524 | 1544 | |
1525 | 1545 |
QTextCodec* codec = QTextCodec::codecForName( encoding.toLocal8Bit().data() ); |