2010-03-30 20:37:55 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
2009-01-20 22:54:27 +00:00
|
|
|
#-----------------------------------------------------------
|
2010-03-30 20:37:55 +00:00
|
|
|
#
|
2009-01-20 22:54:27 +00:00
|
|
|
# fTools
|
2011-03-07 23:29:15 +00:00
|
|
|
# Copyright (C) 2008-2011 Carson Farmer
|
2009-01-20 22:54:27 +00:00
|
|
|
# EMAIL: carson.farmer (at) gmail.com
|
|
|
|
# WEB : http://www.ftools.ca/fTools.html
|
|
|
|
#
|
|
|
|
# A collection of data management and analysis tools for vector data
|
|
|
|
#
|
|
|
|
#-----------------------------------------------------------
|
2010-03-30 20:37:55 +00:00
|
|
|
#
|
2009-01-20 22:54:27 +00:00
|
|
|
# licensed under the terms of GNU GPL 2
|
2010-03-30 20:37:55 +00:00
|
|
|
#
|
2009-01-20 22:54:27 +00:00
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
2010-03-30 20:37:55 +00:00
|
|
|
#
|
2009-01-20 22:54:27 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2010-03-30 20:37:55 +00:00
|
|
|
#
|
2009-01-20 22:54:27 +00:00
|
|
|
# You should have received a copy of the GNU General Public License along
|
|
|
|
# with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2010-03-30 20:37:55 +00:00
|
|
|
#
|
2009-01-20 22:54:27 +00:00
|
|
|
#---------------------------------------------------------------------
|
|
|
|
|
2009-02-01 15:44:02 +00:00
|
|
|
from PyQt4.QtCore import *
|
|
|
|
from PyQt4.QtGui import *
|
|
|
|
from qgis.core import *
|
2009-08-16 22:40:48 +00:00
|
|
|
import resources_rc
|
2009-01-20 22:54:27 +00:00
|
|
|
import os.path, sys
|
|
|
|
# Set up current path, so that we know where to look for mudules
|
2011-03-07 23:29:15 +00:00
|
|
|
currentPath = os.path.dirname(__file__)
|
|
|
|
sys.path.append(os.path.abspath(os.path.dirname(__file__) + '/tools'))
|
2009-01-20 22:54:27 +00:00
|
|
|
# Multi-function modules
|
|
|
|
import doGeometry, doGeoprocessing, doVisual
|
|
|
|
# Single function modules
|
|
|
|
# TODO: Eliminate the following modules in favour of above multi-function formats
|
2011-03-07 23:29:15 +00:00
|
|
|
import doIntersectLines, doSelectByLocation, doVectorSplit, doMeanCoords
|
|
|
|
import doPointDistance, doPointsInPolygon, doRandom, doRandPoints, doRegPoints
|
|
|
|
import doSpatialJoin, doSubsetSelect, doSumLines, doVectorGrid, doMergeShapes
|
2012-11-09 20:15:44 +02:00
|
|
|
import doValidate, doSimplify, doDefineProj, doSpatialIndex, doEliminate
|
2009-02-01 15:44:02 +00:00
|
|
|
|
2009-01-20 22:54:27 +00:00
|
|
|
class fToolsPlugin:
|
2011-03-07 23:29:15 +00:00
|
|
|
def __init__(self,iface):
|
2009-04-21 14:29:25 +00:00
|
|
|
self.iface = iface
|
|
|
|
try:
|
2011-03-07 23:29:15 +00:00
|
|
|
self.QgisVersion = unicode(QGis.QGIS_VERSION_INT)
|
2009-04-21 14:29:25 +00:00
|
|
|
except:
|
2011-03-07 23:29:15 +00:00
|
|
|
self.QgisVersion = unicode(QGis.qgisVersion)[0]
|
2010-03-30 20:37:55 +00:00
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def getThemeIcon(self, icon):
|
2009-04-21 14:29:25 +00:00
|
|
|
settings = QSettings()
|
2013-05-30 16:15:08 +04:00
|
|
|
pluginPath = os.path.dirname(__file__)
|
2013-06-09 18:29:50 +02:00
|
|
|
themePath = "icons" + QDir.separator() + settings.value("/Themes", "default") + QDir.separator() + icon
|
2013-05-30 16:15:08 +04:00
|
|
|
defaultPath = "icons" + QDir.separator() + "default" + QDir.separator() + icon
|
2011-03-07 23:29:15 +00:00
|
|
|
if QFile.exists(pluginPath + QDir.separator() + themePath):
|
|
|
|
return QIcon(":" + themePath)
|
|
|
|
elif QFile.exists(pluginPath + QDir.separator() + defaultPath):
|
|
|
|
return QIcon(":" + defaultPath)
|
2009-04-21 14:29:25 +00:00
|
|
|
else:
|
|
|
|
return QIcon()
|
2010-03-30 20:37:55 +00:00
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def updateThemeIcons(self, theme):
|
|
|
|
self.analysisMenu.setIcon(QIcon(self.getThemeIcon("analysis.png")))
|
|
|
|
self.distMatrix.setIcon(QIcon(self.getThemeIcon("matrix.png")))
|
|
|
|
self.sumLines.setIcon(QIcon(self.getThemeIcon("sum_lines.png")))
|
|
|
|
self.pointsPoly.setIcon(QIcon(self.getThemeIcon("sum_points.png")))
|
|
|
|
self.compStats.setIcon(QIcon(self.getThemeIcon("basic_statistics.png")))
|
|
|
|
self.listUnique.setIcon(QIcon(self.getThemeIcon("unique.png")))
|
|
|
|
self.nearestNeigh.setIcon(QIcon(self.getThemeIcon("neighbour.png")))
|
|
|
|
self.meanCoords.setIcon(QIcon(self.getThemeIcon("mean.png")))
|
|
|
|
self.intLines.setIcon(QIcon(self.getThemeIcon("intersections.png")))
|
|
|
|
|
|
|
|
self.researchMenu.setIcon(QIcon(self.getThemeIcon("sampling.png")))
|
|
|
|
self.randSel.setIcon(QIcon(self.getThemeIcon("random_selection.png")))
|
|
|
|
self.randSub.setIcon(QIcon(self.getThemeIcon("sub_selection.png")))
|
|
|
|
self.randPoints.setIcon(QIcon(self.getThemeIcon("random_points.png")))
|
|
|
|
self.regPoints.setIcon(QIcon(self.getThemeIcon("regular_points.png")))
|
|
|
|
self.vectGrid.setIcon(QIcon(self.getThemeIcon("vector_grid.png")))
|
|
|
|
self.selectLocation.setIcon(QIcon(self.getThemeIcon("select_location.png")))
|
|
|
|
self.layerExtent.setIcon(QIcon(self.getThemeIcon("layer_extent.png")))
|
|
|
|
|
|
|
|
self.geoMenu.setIcon(QIcon(self.getThemeIcon("geoprocessing.png")))
|
|
|
|
self.minConvex.setIcon(QIcon(self.getThemeIcon("convex_hull.png")))
|
|
|
|
self.dynaBuffer.setIcon(QIcon(self.getThemeIcon("buffer.png")))
|
|
|
|
self.intersect.setIcon(QIcon(self.getThemeIcon("intersect.png")))
|
|
|
|
self.union.setIcon(QIcon(self.getThemeIcon("union.png")))
|
|
|
|
self.symDifference.setIcon(QIcon(self.getThemeIcon("sym_difference.png")))
|
|
|
|
self.clip.setIcon(QIcon(self.getThemeIcon("clip.png")))
|
|
|
|
self.dissolve.setIcon(QIcon(self.getThemeIcon("dissolve.png")))
|
|
|
|
self.erase.setIcon(QIcon(self.getThemeIcon("difference.png")))
|
2012-11-09 20:15:44 +02:00
|
|
|
self.eliminate.setIcon(QIcon(self.getThemeIcon("eliminate.png")))
|
2011-03-07 23:29:15 +00:00
|
|
|
|
|
|
|
self.conversionMenu.setIcon(QIcon(self.getThemeIcon("geometry.png")))
|
|
|
|
self.compGeo.setIcon(QIcon(self.getThemeIcon("export_geometry.png")))
|
|
|
|
self.checkGeom.setIcon(QIcon(self.getThemeIcon("check_geometry.png")))
|
|
|
|
self.centroids.setIcon(QIcon(self.getThemeIcon("centroids.png")))
|
|
|
|
self.delaunay.setIcon(QIcon(self.getThemeIcon("delaunay.png")))
|
|
|
|
self.voronoi.setIcon(QIcon(self.getThemeIcon("voronoi.png")))
|
|
|
|
self.extNodes.setIcon(QIcon(self.getThemeIcon("extract_nodes.png")))
|
|
|
|
self.simplify.setIcon(QIcon(self.getThemeIcon("simplify.png")))
|
2011-11-12 12:50:51 +02:00
|
|
|
self.densify.setIcon(QIcon(self.getThemeIcon("densify.png")))
|
2011-03-07 23:29:15 +00:00
|
|
|
self.multiToSingle.setIcon(QIcon(self.getThemeIcon("multi_to_single.png")))
|
|
|
|
self.singleToMulti.setIcon(QIcon(self.getThemeIcon("single_to_multi.png")))
|
|
|
|
self.polysToLines.setIcon(QIcon(self.getThemeIcon("to_lines.png")))
|
|
|
|
self.linesToPolys.setIcon(QIcon(self.getThemeIcon("to_lines.png")))
|
|
|
|
|
|
|
|
self.dataManageMenu.setIcon(QIcon(self.getThemeIcon("management.png")))
|
|
|
|
self.define.setIcon(QIcon(self.getThemeIcon("define_projection.png")))
|
|
|
|
self.spatJoin.setIcon(QIcon(self.getThemeIcon("join_location.png")))
|
|
|
|
self.splitVect.setIcon(QIcon(self.getThemeIcon("split_layer.png")))
|
|
|
|
self.mergeShapes.setIcon(QIcon(self.getThemeIcon("merge_shapes.png")))
|
2011-11-12 12:42:30 +02:00
|
|
|
self.spatialIndex.setIcon(QIcon(self.getThemeIcon("spatial_index.png")))
|
2011-03-07 23:29:15 +00:00
|
|
|
|
|
|
|
def initGui(self):
|
|
|
|
if int(self.QgisVersion) < 1:
|
|
|
|
QMessageBox.warning(self.iface.getMainWindow(), "fTools",
|
2013-05-20 16:43:39 +02:00
|
|
|
QCoreApplication.translate("fTools", "QGIS version detected: ") +unicode(self.QgisVersion)+".xx\n"
|
2011-03-07 23:29:15 +00:00
|
|
|
+ QCoreApplication.translate("fTools", "This version of fTools requires at least QGIS version 1.0.0\nPlugin will not be enabled."))
|
2009-04-21 14:29:25 +00:00
|
|
|
return None
|
2011-03-07 23:29:15 +00:00
|
|
|
QObject.connect(self.iface, SIGNAL("currentThemeChanged (QString)"), self.updateThemeIcons)
|
|
|
|
|
|
|
|
self.analysisMenu = QMenu(QCoreApplication.translate("fTools", "&Analysis Tools"))
|
|
|
|
self.distMatrix = QAction(QCoreApplication.translate("fTools", "Distance matrix"),self.iface.mainWindow())
|
|
|
|
self.sumLines = QAction(QCoreApplication.translate("fTools", "Sum line lengths"), self.iface.mainWindow())
|
|
|
|
self.pointsPoly = QAction(QCoreApplication.translate("fTools", "Points in polygon"),self.iface.mainWindow())
|
|
|
|
self.compStats = QAction(QCoreApplication.translate("fTools", "Basic statistics"),self.iface.mainWindow())
|
|
|
|
self.listUnique = QAction(QCoreApplication.translate("fTools", "List unique values"),self.iface.mainWindow())
|
|
|
|
self.nearestNeigh = QAction(QCoreApplication.translate("fTools", "Nearest neighbour analysis"), self.iface.mainWindow())
|
|
|
|
self.meanCoords = QAction(QCoreApplication.translate("fTools", "Mean coordinate(s)"),self.iface.mainWindow())
|
|
|
|
self.intLines = QAction(QCoreApplication.translate("fTools", "Line intersections") ,self.iface.mainWindow())
|
|
|
|
self.analysisMenu.addActions([self.distMatrix, self.sumLines, self.pointsPoly,
|
2012-11-09 20:15:44 +02:00
|
|
|
self.listUnique, self.compStats, self.nearestNeigh, self.meanCoords, self.intLines])
|
2011-03-07 23:29:15 +00:00
|
|
|
|
|
|
|
self.researchMenu = QMenu(QCoreApplication.translate("fTools", "&Research Tools"))
|
|
|
|
self.randSel = QAction(QCoreApplication.translate("fTools", "Random selection"),self.iface.mainWindow())
|
|
|
|
self.randSub = QAction(QCoreApplication.translate("fTools", "Random selection within subsets"),self.iface.mainWindow())
|
|
|
|
self.randPoints = QAction(QCoreApplication.translate("fTools", "Random points"),self.iface.mainWindow())
|
|
|
|
self.regPoints = QAction(QCoreApplication.translate("fTools", "Regular points"), self.iface.mainWindow())
|
|
|
|
self.vectGrid = QAction(QCoreApplication.translate("fTools", "Vector grid"), self.iface.mainWindow())
|
|
|
|
self.selectLocation = QAction(QCoreApplication.translate("fTools", "Select by location"), self.iface.mainWindow())
|
|
|
|
self.layerExtent = QAction(QCoreApplication.translate("fTools", "Polygon from layer extent"), self.iface.mainWindow())
|
|
|
|
self.researchMenu.addActions([self.randSel, self.randSub, self.randPoints,
|
2012-11-09 20:15:44 +02:00
|
|
|
self.regPoints, self.vectGrid, self.selectLocation, self.layerExtent])
|
2011-03-07 23:29:15 +00:00
|
|
|
|
|
|
|
self.geoMenu = QMenu(QCoreApplication.translate("fTools", "&Geoprocessing Tools"))
|
|
|
|
self.minConvex = QAction(QCoreApplication.translate("fTools", "Convex hull(s)"),self.iface.mainWindow())
|
|
|
|
self.dynaBuffer = QAction(QCoreApplication.translate("fTools", "Buffer(s)"),self.iface.mainWindow())
|
|
|
|
self.intersect = QAction(QCoreApplication.translate("fTools", "Intersect"),self.iface.mainWindow())
|
|
|
|
self.union = QAction(QCoreApplication.translate("fTools", "Union"),self.iface.mainWindow())
|
|
|
|
self.symDifference = QAction(QCoreApplication.translate("fTools", "Symetrical difference"),self.iface.mainWindow())
|
|
|
|
self.clip = QAction(QCoreApplication.translate("fTools", "Clip"),self.iface.mainWindow())
|
|
|
|
self.dissolve = QAction(QCoreApplication.translate("fTools", "Dissolve"),self.iface.mainWindow())
|
|
|
|
self.erase = QAction(QCoreApplication.translate("fTools", "Difference"),self.iface.mainWindow())
|
2012-11-09 20:15:44 +02:00
|
|
|
self.eliminate = QAction( QCoreApplication.translate( "fTools", "Eliminate sliver polygons" ),self.iface.mainWindow() )
|
2011-03-07 23:29:15 +00:00
|
|
|
self.geoMenu.addActions([self.minConvex, self.dynaBuffer, self.intersect,
|
2012-11-09 20:15:44 +02:00
|
|
|
self.union, self.symDifference, self.clip, self.erase, self.dissolve,
|
|
|
|
self.eliminate])
|
2011-03-07 23:29:15 +00:00
|
|
|
|
|
|
|
self.conversionMenu = QMenu(QCoreApplication.translate("fTools", "G&eometry Tools"))
|
|
|
|
self.compGeo = QAction(QCoreApplication.translate("fTools", "Export/Add geometry columns"),self.iface.mainWindow())
|
|
|
|
self.checkGeom = QAction(QCoreApplication.translate("fTools", "Check geometry validity"),self.iface.mainWindow())
|
|
|
|
self.centroids = QAction(QCoreApplication.translate("fTools", "Polygon centroids"),self.iface.mainWindow())
|
|
|
|
self.delaunay = QAction(QCoreApplication.translate("fTools", "Delaunay triangulation"),self.iface.mainWindow())
|
|
|
|
self.voronoi = QAction(QCoreApplication.translate("fTools", "Voronoi Polygons"),self.iface.mainWindow())
|
|
|
|
self.extNodes = QAction(QCoreApplication.translate("fTools", "Extract nodes"),self.iface.mainWindow())
|
|
|
|
self.simplify = QAction(QCoreApplication.translate("fTools", "Simplify geometries"),self.iface.mainWindow())
|
2011-11-12 12:50:51 +02:00
|
|
|
self.densify = QAction(QCoreApplication.translate("fTools", "Densify geometries"),self.iface.mainWindow())
|
2011-03-07 23:29:15 +00:00
|
|
|
self.multiToSingle = QAction(QCoreApplication.translate("fTools", "Multipart to singleparts"),self.iface.mainWindow())
|
|
|
|
self.singleToMulti = QAction(QCoreApplication.translate("fTools", "Singleparts to multipart"),self.iface.mainWindow())
|
|
|
|
self.polysToLines = QAction(QCoreApplication.translate("fTools", "Polygons to lines"),self.iface.mainWindow())
|
|
|
|
self.linesToPolys = QAction(QCoreApplication.translate("fTools", "Lines to polygons"),self.iface.mainWindow())
|
|
|
|
self.conversionMenu.addActions([self.checkGeom, self.compGeo, self.centroids, self.delaunay, self.voronoi,
|
2012-11-09 20:15:44 +02:00
|
|
|
self.simplify, self.densify, self.multiToSingle, self.singleToMulti, self.polysToLines, self.linesToPolys,
|
|
|
|
self.extNodes])
|
2011-03-07 23:29:15 +00:00
|
|
|
|
|
|
|
self.dataManageMenu = QMenu(QCoreApplication.translate("fTools", "&Data Management Tools"))
|
|
|
|
self.define = QAction(QCoreApplication.translate("fTools", "Define current projection"), self.iface.mainWindow())
|
|
|
|
self.spatJoin = QAction(QCoreApplication.translate("fTools", "Join attributes by location"), self.iface.mainWindow())
|
|
|
|
self.splitVect = QAction(QCoreApplication.translate("fTools", "Split vector layer"), self.iface.mainWindow())
|
|
|
|
self.mergeShapes = QAction(QCoreApplication.translate("fTools", "Merge shapefiles to one"), self.iface.mainWindow())
|
2011-11-12 12:42:30 +02:00
|
|
|
self.spatialIndex = QAction(QCoreApplication.translate("fTools", "Create spatial index"), self.iface.mainWindow())
|
|
|
|
self.dataManageMenu.addActions([self.define, self.spatJoin, self.splitVect, self.mergeShapes, self.spatialIndex])
|
2012-11-09 20:15:44 +02:00
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
self.updateThemeIcons("theme")
|
|
|
|
|
2012-08-15 12:55:00 +03:00
|
|
|
self.menu = self.iface.vectorMenu()
|
|
|
|
self.menu.addMenu( self.analysisMenu )
|
|
|
|
self.menu.addMenu( self.researchMenu )
|
|
|
|
self.menu.addMenu( self.geoMenu )
|
|
|
|
self.menu.addMenu( self.conversionMenu )
|
|
|
|
self.menu.addMenu( self.dataManageMenu )
|
2011-03-07 23:29:15 +00:00
|
|
|
|
|
|
|
QObject.connect(self.distMatrix, SIGNAL("triggered()"), self.dodistMatrix)
|
|
|
|
QObject.connect(self.sumLines, SIGNAL("triggered()"), self.dosumLines)
|
|
|
|
QObject.connect(self.pointsPoly, SIGNAL("triggered()"), self.dopointsPoly)
|
|
|
|
QObject.connect(self.compStats, SIGNAL("triggered()"), self.docompStats)
|
|
|
|
QObject.connect(self.listUnique, SIGNAL("triggered()"), self.dolistUnique)
|
|
|
|
QObject.connect(self.nearestNeigh, SIGNAL("triggered()"), self.donearestNeigh)
|
|
|
|
QObject.connect(self.meanCoords, SIGNAL("triggered()"), self.domeanCoords)
|
|
|
|
QObject.connect(self.intLines, SIGNAL("triggered()"), self.dointLines)
|
|
|
|
|
|
|
|
QObject.connect(self.randSel, SIGNAL("triggered()"), self.dorandSel)
|
|
|
|
QObject.connect(self.randSub, SIGNAL("triggered()"), self.dorandSub)
|
|
|
|
QObject.connect(self.randPoints, SIGNAL("triggered()"), self.dorandPoints)
|
|
|
|
QObject.connect(self.regPoints, SIGNAL("triggered()"), self.doregPoints)
|
|
|
|
QObject.connect(self.vectGrid, SIGNAL("triggered()"), self.dovectGrid)
|
|
|
|
QObject.connect(self.selectLocation, SIGNAL("triggered()"), self.doselectLocation)
|
|
|
|
QObject.connect(self.layerExtent, SIGNAL("triggered()"), self.doextent)
|
|
|
|
|
|
|
|
QObject.connect(self.minConvex, SIGNAL("triggered()"), self.dominConvex)
|
|
|
|
QObject.connect(self.intersect, SIGNAL("triggered()"), self.dointersect)
|
|
|
|
QObject.connect(self.dissolve, SIGNAL("triggered()"), self.dodissolve)
|
|
|
|
QObject.connect(self.symDifference, SIGNAL("triggered()"), self.dosymdifference)
|
|
|
|
QObject.connect(self.erase, SIGNAL("triggered()"), self.doerase)
|
|
|
|
QObject.connect(self.union, SIGNAL("triggered()"), self.dounion)
|
|
|
|
QObject.connect(self.clip, SIGNAL("triggered()"), self.doclip)
|
|
|
|
QObject.connect(self.dynaBuffer, SIGNAL("triggered()"), self.dodynaBuffer)
|
2012-11-09 20:15:44 +02:00
|
|
|
QObject.connect(self.eliminate, SIGNAL("triggered()"), self.doEliminate)
|
2011-03-07 23:29:15 +00:00
|
|
|
|
|
|
|
QObject.connect(self.multiToSingle, SIGNAL("triggered()"), self.domultiToSingle)
|
|
|
|
QObject.connect(self.singleToMulti, SIGNAL("triggered()"), self.dosingleToMulti)
|
|
|
|
QObject.connect(self.checkGeom, SIGNAL("triggered()"), self.docheckGeom)
|
2011-11-12 12:50:51 +02:00
|
|
|
QObject.connect(self.simplify, SIGNAL("triggered()"), self.doSimplify)
|
|
|
|
QObject.connect(self.densify, SIGNAL("triggered()"), self.doDensify)
|
2011-03-07 23:29:15 +00:00
|
|
|
QObject.connect(self.centroids, SIGNAL("triggered()"), self.docentroids)
|
|
|
|
QObject.connect(self.delaunay, SIGNAL("triggered()"), self.dodelaunay)
|
|
|
|
QObject.connect(self.voronoi, SIGNAL("triggered()"), self.dovoronoi)
|
|
|
|
QObject.connect(self.polysToLines, SIGNAL("triggered()"), self.dopolysToLines)
|
|
|
|
QObject.connect(self.linesToPolys, SIGNAL("triggered()"), self.dolinesToPolys)
|
|
|
|
QObject.connect(self.compGeo, SIGNAL("triggered()"), self.docompGeo)
|
|
|
|
QObject.connect(self.extNodes, SIGNAL("triggered()"), self.doextNodes)
|
|
|
|
|
|
|
|
QObject.connect(self.define, SIGNAL("triggered()"), self.dodefine)
|
|
|
|
QObject.connect(self.spatJoin, SIGNAL("triggered()"), self.dospatJoin)
|
|
|
|
QObject.connect(self.splitVect, SIGNAL("triggered()"), self.dosplitVect)
|
|
|
|
QObject.connect(self.mergeShapes, SIGNAL("triggered()"), self.doMergeShapes)
|
2011-11-12 12:42:30 +02:00
|
|
|
QObject.connect(self.spatialIndex, SIGNAL("triggered()"), self.doSpatIndex)
|
2011-03-07 23:29:15 +00:00
|
|
|
|
|
|
|
def unload(self):
|
2012-08-15 12:55:00 +03:00
|
|
|
self.menu.removeAction( self.analysisMenu.menuAction() )
|
|
|
|
self.menu.removeAction( self.researchMenu.menuAction() )
|
|
|
|
self.menu.removeAction( self.geoMenu.menuAction() )
|
|
|
|
self.menu.removeAction( self.conversionMenu.menuAction() )
|
|
|
|
self.menu.removeAction( self.dataManageMenu.menuAction() )
|
2009-04-21 14:29:25 +00:00
|
|
|
|
2011-11-12 12:50:51 +02:00
|
|
|
def doSimplify(self):
|
|
|
|
d = doSimplify.Dialog(self.iface, 1)
|
|
|
|
d.show()
|
|
|
|
d.exec_()
|
|
|
|
|
|
|
|
def doDensify(self):
|
|
|
|
d = doSimplify.Dialog(self.iface, 2)
|
|
|
|
d.show()
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def dopolysToLines(self):
|
|
|
|
d = doGeometry.GeometryDialog(self.iface, 4)
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def dolinesToPolys(self):
|
|
|
|
d = doGeometry.GeometryDialog(self.iface, 11)
|
2011-02-28 22:35:47 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def docheckGeom(self):
|
2010-11-13 17:30:06 +00:00
|
|
|
d = doValidate.ValidateDialog(self.iface)
|
|
|
|
d.show()
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def domultiToSingle(self):
|
|
|
|
d = doGeometry.GeometryDialog(self.iface, 2)
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def dosingleToMulti(self):
|
|
|
|
d = doGeometry.GeometryDialog(self.iface, 1)
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def doselectLocation(self):
|
|
|
|
d = doSelectByLocation.Dialog(self.iface)
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def domeanCoords(self):
|
|
|
|
d = doMeanCoords.Dialog(self.iface, 1)
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def dominConvex(self):
|
|
|
|
d = doGeoprocessing.GeoprocessingDialog(self.iface, 2)
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def dodynaBuffer(self):
|
|
|
|
d = doGeoprocessing.GeoprocessingDialog(self.iface, 1)
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def dointersect(self):
|
|
|
|
d = doGeoprocessing.GeoprocessingDialog(self.iface, 5)
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def dodissolve(self):
|
|
|
|
d = doGeoprocessing.GeoprocessingDialog(self.iface, 4)
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def doerase(self):
|
|
|
|
d = doGeoprocessing.GeoprocessingDialog(self.iface, 3)
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def dosymdifference(self):
|
|
|
|
d = doGeoprocessing.GeoprocessingDialog(self.iface, 7)
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def dounion(self):
|
|
|
|
d = doGeoprocessing.GeoprocessingDialog(self.iface, 6)
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def doclip(self):
|
|
|
|
d = doGeoprocessing.GeoprocessingDialog(self.iface, 8)
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def donearestNeigh(self):
|
|
|
|
d = doVisual.VisualDialog(self.iface, 4)
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def dodistMatrix(self):
|
|
|
|
d = doPointDistance.Dialog(self.iface)
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def docentroids(self):
|
|
|
|
d = doGeometry.GeometryDialog(self.iface, 7)
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
2010-03-30 20:37:55 +00:00
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def dodelaunay(self):
|
|
|
|
d = doGeometry.GeometryDialog(self.iface, 8)
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
2011-11-12 12:42:30 +02:00
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def dovoronoi(self):
|
|
|
|
d = doGeometry.GeometryDialog(self.iface, 10)
|
2010-11-15 00:16:45 +00:00
|
|
|
d.exec_()
|
2010-03-30 20:37:55 +00:00
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def doextent(self):
|
|
|
|
d = doGeometry.GeometryDialog(self.iface, 9)
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
|
|
|
def dosumLines(self):
|
|
|
|
d = doSumLines.Dialog(self.iface)
|
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def dopointsPoly(self):
|
|
|
|
d = doPointsInPolygon.Dialog(self.iface)
|
2012-05-31 14:21:20 +03:00
|
|
|
d.show()
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def dorandSel(self):
|
|
|
|
d = doRandom.Dialog(self.iface)
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def dorandSub(self):
|
|
|
|
d = doSubsetSelect.Dialog(self.iface)
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def dorandPoints(self):
|
|
|
|
d = doRandPoints.Dialog(self.iface)
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def doregPoints(self):
|
|
|
|
d = doRegPoints.Dialog(self.iface)
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def dovectGrid(self):
|
|
|
|
d = doVectorGrid.Dialog(self.iface)
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def doextNodes(self):
|
|
|
|
d = doGeometry.GeometryDialog(self.iface, 3)
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def dointLines(self):
|
|
|
|
d = doIntersectLines.Dialog(self.iface)
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def dosplitVect(self):
|
|
|
|
d = doVectorSplit.Dialog(self.iface)
|
2011-12-05 16:35:04 +02:00
|
|
|
d.show()
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def docompGeo(self):
|
|
|
|
d = doGeometry.GeometryDialog(self.iface, 5)
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def dolistUnique(self):
|
|
|
|
d = doVisual.VisualDialog(self.iface, 2)
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def docompStats(self):
|
|
|
|
d = doVisual.VisualDialog(self.iface, 3)
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def dodefine(self):
|
|
|
|
d = doDefineProj.Dialog(self.iface)
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def dospatJoin(self):
|
|
|
|
d = doSpatialJoin.Dialog(self.iface)
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-03-07 23:29:15 +00:00
|
|
|
def doMergeShapes(self):
|
|
|
|
d = doMergeShapes.Dialog(self.iface)
|
2011-11-12 13:00:57 +02:00
|
|
|
d.show()
|
2009-04-21 14:29:25 +00:00
|
|
|
d.exec_()
|
|
|
|
|
2011-11-12 12:42:30 +02:00
|
|
|
def doSpatIndex(self):
|
|
|
|
d = doSpatialIndex.Dialog(self.iface)
|
|
|
|
d.show()
|
|
|
|
d.exec_()
|
2012-11-09 20:15:44 +02:00
|
|
|
|
|
|
|
def doEliminate(self):
|
|
|
|
d = doEliminate.Dialog(self.iface)
|
|
|
|
d.exec_()
|