Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[FEATURE] Eliminate tool for fTools, contributed by Bernhard Strobl
  • Loading branch information
alexbruy committed Nov 9, 2012
1 parent 6d5bbed commit a2d4347
Show file tree
Hide file tree
Showing 7 changed files with 428 additions and 54 deletions.
21 changes: 15 additions & 6 deletions python/plugins/fTools/fTools.py
Expand Up @@ -43,7 +43,7 @@
import doIntersectLines, doSelectByLocation, doVectorSplit, doMeanCoords
import doPointDistance, doPointsInPolygon, doRandom, doRandPoints, doRegPoints
import doSpatialJoin, doSubsetSelect, doSumLines, doVectorGrid, doMergeShapes
import doValidate, doSimplify, doDefineProj, doSpatialIndex
import doValidate, doSimplify, doDefineProj, doSpatialIndex, doEliminate

class fToolsPlugin:
def __init__(self,iface):
Expand Down Expand Up @@ -94,6 +94,7 @@ def updateThemeIcons(self, theme):
self.clip.setIcon(QIcon(self.getThemeIcon("clip.png")))
self.dissolve.setIcon(QIcon(self.getThemeIcon("dissolve.png")))
self.erase.setIcon(QIcon(self.getThemeIcon("difference.png")))
self.eliminate.setIcon(QIcon(self.getThemeIcon("eliminate.png")))

self.conversionMenu.setIcon(QIcon(self.getThemeIcon("geometry.png")))
self.compGeo.setIcon(QIcon(self.getThemeIcon("export_geometry.png")))
Expand Down Expand Up @@ -134,7 +135,7 @@ def initGui(self):
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,
self.listUnique, self.compStats, self.nearestNeigh, self.meanCoords, self.intLines])
self.listUnique, self.compStats, self.nearestNeigh, self.meanCoords, self.intLines])

self.researchMenu = QMenu(QCoreApplication.translate("fTools", "&Research Tools"))
self.randSel = QAction(QCoreApplication.translate("fTools", "Random selection"),self.iface.mainWindow())
Expand All @@ -145,7 +146,7 @@ def initGui(self):
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,
self.regPoints, self.vectGrid, self.selectLocation, self.layerExtent])
self.regPoints, self.vectGrid, self.selectLocation, self.layerExtent])

self.geoMenu = QMenu(QCoreApplication.translate("fTools", "&Geoprocessing Tools"))
self.minConvex = QAction(QCoreApplication.translate("fTools", "Convex hull(s)"),self.iface.mainWindow())
Expand All @@ -156,8 +157,10 @@ def initGui(self):
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())
self.eliminate = QAction( QCoreApplication.translate( "fTools", "Eliminate sliver polygons" ),self.iface.mainWindow() )
self.geoMenu.addActions([self.minConvex, self.dynaBuffer, self.intersect,
self.union, self.symDifference, self.clip, self.erase, self.dissolve])
self.union, self.symDifference, self.clip, self.erase, self.dissolve,
self.eliminate])

self.conversionMenu = QMenu(QCoreApplication.translate("fTools", "G&eometry Tools"))
self.compGeo = QAction(QCoreApplication.translate("fTools", "Export/Add geometry columns"),self.iface.mainWindow())
Expand All @@ -173,8 +176,8 @@ def initGui(self):
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,
self.simplify, self.densify, self.multiToSingle, self.singleToMulti, self.polysToLines, self.linesToPolys,
self.extNodes])
self.simplify, self.densify, self.multiToSingle, self.singleToMulti, self.polysToLines, self.linesToPolys,
self.extNodes])

self.dataManageMenu = QMenu(QCoreApplication.translate("fTools", "&Data Management Tools"))
self.define = QAction(QCoreApplication.translate("fTools", "Define current projection"), self.iface.mainWindow())
Expand All @@ -183,6 +186,7 @@ def initGui(self):
self.mergeShapes = QAction(QCoreApplication.translate("fTools", "Merge shapefiles to one"), self.iface.mainWindow())
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])

self.updateThemeIcons("theme")

self.tmpAct = QAction( self.iface.mainWindow() )
Expand Down Expand Up @@ -220,6 +224,7 @@ def initGui(self):
QObject.connect(self.union, SIGNAL("triggered()"), self.dounion)
QObject.connect(self.clip, SIGNAL("triggered()"), self.doclip)
QObject.connect(self.dynaBuffer, SIGNAL("triggered()"), self.dodynaBuffer)
QObject.connect(self.eliminate, SIGNAL("triggered()"), self.doEliminate)

QObject.connect(self.multiToSingle, SIGNAL("triggered()"), self.domultiToSingle)
QObject.connect(self.singleToMulti, SIGNAL("triggered()"), self.dosingleToMulti)
Expand Down Expand Up @@ -416,3 +421,7 @@ def doSpatIndex(self):
d = doSpatialIndex.Dialog(self.iface)
d.show()
d.exec_()

def doEliminate(self):
d = doEliminate.Dialog(self.iface)
d.exec_()
48 changes: 1 addition & 47 deletions python/plugins/fTools/icons/default/CMakeLists.txt
@@ -1,51 +1,5 @@
#TODO: Need to configure cmake to run pyrcc4 and pyuic4 as required when the resource
# file or the ui change
SET(ICON_FILES
analysis.png
geometry.png
sampling.png
basic_statistics.png
geoprocessing.png
select_location.png
buffer.png
help.png
simplify.png
centroids.png
intersections.png
single_to_multi.png
check_geometry.png
intersect.png
split_layer.png
clip.png
join_attributes.png
sub_selection.png
convex_hull.png
join_location.png
sum_lines.png
define_projection.png
management.png
sum_points.png
difference.png
matrix.png
sym_difference.png
dissolve.png
mean.png
to_lines.png
export_geometry.png
multi_to_single.png
union.png
export_projection.png
neighbour.png
unique.png
extract_nodes.png
random_points.png
vector_grid.png
random_selection.png
ftools_logo.png
regular_points.png
delaunay.png
layer_extent.png
merge_shapes.png
)
FILE(GLOB ICON_FILES *.png)

PLUGIN_INSTALL(fTools icons/default ${ICON_FILES})
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added python/plugins/fTools/icons/gis/eliminate.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion python/plugins/fTools/resources.qrc
Expand Up @@ -45,6 +45,7 @@
<file>icons/default/neighbour.png</file>
<file>icons/default/delaunay.png</file>
<file>icons/default/layer_extent.png</file>
<file>icons/default/eliminate.png</file>
<file>icons/gis/single_to_multi.png</file>
<file>icons/gis/simplify.png</file>
<file>icons/gis/difference.png</file>
Expand Down Expand Up @@ -91,6 +92,7 @@
<file>icons/gis/layer_extent.png</file>
<file>icons/gis/voronoi.png</file>
<file>icons/gis/merge_shapes.png</file>
<file>icons/default/voronoi.png</file>
<file>icons/gis/voronoi.png</file>
<file>icons/gis/eliminate.png</file>
</qresource>
</RCC>

0 comments on commit a2d4347

Please sign in to comment.