@@ -153,7 +153,7 @@ def accept(self):
153
153
self .buttonOk .setEnabled ( True )
154
154
155
155
def compute ( self , bound , xOffset , yOffset , polygon ):
156
- crs = self .iface . mapCanvas (). mapRenderer (). destinationSrs ()
156
+ crs = ftools_utils . getMapLayerByName ( unicode ( self .inShape . currentText ())). crs ()
157
157
if not crs .isValid (): crs = None
158
158
if polygon :
159
159
fields = {0 :QgsField ("ID" , QVariant .Int ), 1 :QgsField ("XMIN" , QVariant .Double ), 2 :QgsField ("XMAX" , QVariant .Double ),
@@ -163,15 +163,13 @@ def compute( self, bound, xOffset, yOffset, polygon ):
163
163
if not QgsVectorFileWriter .deleteShapeFile (self .shapefileName ):
164
164
return
165
165
writer = QgsVectorFileWriter (self .shapefileName , self .encoding , fields , QGis .WKBPolygon , crs )
166
- #writer = QgsVectorFileWriter(outPath, "CP1250", fields, QGis.WKBPolygon, None)
167
166
else :
168
167
fields = {0 :QgsField ("ID" , QVariant .Int ), 1 :QgsField ("COORD" , QVariant .Double )}
169
168
check = QFile (self .shapefileName )
170
169
if check .exists ():
171
170
if not QgsVectorFileWriter .deleteShapeFile (self .shapefileName ):
172
171
return
173
172
writer = QgsVectorFileWriter (self .shapefileName , self .encoding , fields , QGis .WKBLineString , crs )
174
- #writer = QgsVectorFileWriter(unicode(outPath), "CP1250", fields, QGis.WKBLineString, None)
175
173
outFeat = QgsFeature ()
176
174
outGeom = QgsGeometry ()
177
175
idVar = 0
@@ -279,16 +277,16 @@ def getClosestPixel(self, startVal, targetVal, step, isMin ):
279
277
while foundVal is None :
280
278
if tmpVal <= targetVal :
281
279
if backOneStep :
282
- tmpVal -= step
280
+ tmpVal -= step
283
281
foundVal = tmpVal
284
282
tmpVal += step
285
283
else :
286
284
backOneStep = isMin
287
285
while foundVal is None :
288
286
if tmpVal >= targetVal :
289
287
if backOneStep :
290
- tmpVal -= step
288
+ tmpVal -= step
291
289
foundVal = tmpVal
292
290
tmpVal += step
293
- return foundVal
291
+ return foundVal
294
292
0 commit comments