forked from borysiasty/pointsamplingtool
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpointSamplingTool.py
More file actions
53 lines (42 loc) · 1.93 KB
/
pointSamplingTool.py
File metadata and controls
53 lines (42 loc) · 1.93 KB
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
# -*- coding: utf-8 -*-
# ***************************************************************************
# Point Sampling Tool
#
# A QGIS plugin for collecting polygon attributes and raster values
# from multiple layers at specified sampling points
#
# Copyright (C) 2008 Borys Jurgiel
# based on Carson Farmer's PointsInPoly plugin, Copyright (C) 2008 Carson Farmer
#
# ***************************************************************************
# * *
# * 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 PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
import resources
import doPointSamplingTool
class pointSamplingTool:
def __init__(self, iface):
self.iface = iface
def initGui(self):
# create action
self.action = QAction(QIcon(":/plugins/pointSamplingTool/pointSamplingToolIcon.png"), "Point sampling tool", self.iface.mainWindow())
self.action.setWhatsThis("Collects polygon attributes and raster values from multiple layers at specified sampling points")
self.action.triggered.connect(self.run)
# add toolbar button and menu item
self.iface.addToolBarIcon(self.action)
self.iface.addPluginToMenu("&Analyses", self.action)
def unload(self):
# remove the plugin menu item and icon
self.iface.removePluginMenu("&Analyses",self.action)
self.iface.removeToolBarIcon(self.action)
def run(self):
# create and show a configuration dialog or something similar
dialoga = doPointSamplingTool.Dialog(self.iface)
dialoga.exec_()