-
Notifications
You must be signed in to change notification settings - Fork 6
/
pointstopaths.py
69 lines (61 loc) · 2.73 KB
/
pointstopaths.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
"""
/***************************************************************************
PointsToPaths
A QGIS plugin
Converts points to lines with verticies grouped by a text or integer field
and ordered by an integer or date string field
-------------------
begin : 2011-08-02
copyright : (C) 2011 by Cyrus Hiatt
email : [email protected]
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
"""
from __future__ import absolute_import
# Import the PyQt and QGIS libraries
from builtins import object
# from PyQt4.QtCore import *
# from PyQt4.QtGui import *
from qgis.PyQt.QtGui import QIcon
from qgis.PyQt.QtWidgets import QAction
from qgis.core import *
# Initialize Qt resources from file resources.py
from . import resources
# Import the code for the dialog
from .pointstopathsdialog import PointsToPathsDialog
class PointsToPaths(object):
def __init__(self, iface):
# Save reference to the QGIS interface
self.iface = iface
def initGui(self):
# Create action that will start plugin configuration
self.action = QAction(QIcon(":/plugins/pointstopaths/icon.png"),
"Points to Paths", self.iface.mainWindow())
# connect the action to the run method
self.action.triggered.connect(self.run)
# Add toolbar button and menu item
self.iface.addToolBarIcon(self.action)
self.iface.addPluginToMenu("&Points to Paths", self.action)
def unload(self):
# Remove the plugin menu item and icon
self.iface.removePluginMenu("&Points to Paths", self.action)
self.iface.removeToolBarIcon(self.action)
# run method that performs all the real work
def run(self):
# create and show the dialog
dlg = PointsToPathsDialog()
# show the dialog
dlg.show()
result = dlg.exec_()
# See if OK was pressed
#if result == 1:
# do something useful (delete the line containing pass and
# substitute with your code
#pass