mirror of
https://github.com/qgis/QGIS.git
synced 2025-12-15 00:07:25 -05:00
Improved implementation
This commit is contained in:
parent
d416555079
commit
54956db92f
@ -128,7 +128,7 @@ class Dialog(QDialog, Ui_Dialog):
|
||||
else: matType = "Summary"
|
||||
if self.chkNearest.isChecked(): nearest = self.spnNearest.value()
|
||||
else: nearest = 0
|
||||
outName = ftools_utils.getShapefileName(outPath)
|
||||
outName = ftools_utils.getShapefileName(outPath,'.csv')
|
||||
self.outFile.clear()
|
||||
self.compute(point1, point2, field1, field2, outPath, matType, nearest, self.progressBar)
|
||||
self.progressBar.setValue(100)
|
||||
|
||||
@ -383,12 +383,10 @@ def getShapesByGeometryType( baseDir, inShapes, geomType ):
|
||||
|
||||
return outShapes
|
||||
|
||||
def getShapefileName( outPath ):
|
||||
def getShapefileName( outPath, extension='.shp' ):
|
||||
import os.path
|
||||
outName=os.path.basename(outPath)
|
||||
if outName.endswith('.shp'):
|
||||
outName=outName[:-4]
|
||||
if outName.endswith('.csv'):
|
||||
outName=outName[:-4]
|
||||
if outName.endswith(extension):
|
||||
outName=outName[:-len(extension)]
|
||||
return outName
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user