doDefineProj.py.diff
python/plugins/fTools/tools/doDefineProj.py (working copy) | ||
---|---|---|
34 | 34 |
def updateProj1(self, layerName): |
35 | 35 |
tempLayer = self.getVectorLayerByName(layerName) |
36 | 36 |
crs = tempLayer.dataProvider().crs().toProj4() |
37 |
self.inRef.insert(unicode(crs))
|
|
37 |
self.inRef.insert(unicode(crs)) |
|
38 | 38 | |
39 | 39 |
def updateProj2(self, layerName): |
40 | 40 |
tempLayer = self.getVectorLayerByName(layerName) |
41 | 41 |
crs = tempLayer.dataProvider().crs().toProj4() |
42 |
self.outRef.insert(unicode(crs))
|
|
42 |
self.outRef.insert(unicode(crs)) |
|
43 | 43 | |
44 | 44 |
def accept(self): |
45 | 45 |
if self.inShape.currentText() == "": |
... | ... | |
81 | 81 |
self.progressBar.setValue(60) |
82 | 82 |
outputWkt = srsDefine.toWkt() |
83 | 83 |
self.progressBar.setValue(65) |
84 |
outputPrj = open(inPath + ".prj", "w") |
|
84 |
outputFile = QFile( inPath + ".prj" ) |
|
85 |
outputFile.open( QIODevice.WriteOnly | QIODevice.Text ) |
|
86 |
outputPrj = QTextStream( outputFile ) |
|
85 | 87 |
self.progressBar.setValue(70) |
86 |
outputPrj.write(outputWkt)
|
|
88 |
outputPrj << outputWkt
|
|
87 | 89 |
self.progressBar.setValue(75) |
88 |
outputPrj.close() |
|
90 |
outputPrj.flush() |
|
91 |
outputFile.close() |
|
89 | 92 |
mLayer = self.getMapLayerByName(inName) |
90 | 93 |
self.progressBar.setValue(90) |
91 | 94 |
if not mLayer.isValid(): |