Ejemplo n.º 1
0
    def __init__(self, path, iface):
        """
        Take in a file to work on, Initialize and work upon

        :param path: Path to file
        :type path: str

        :param iface: QGIS iface
        :type iface: iface
        """
        self.iface = iface
        self.path = path
        self.com = Communicate(self.iface)
        try:
            self.csvFile = open(path, 'rb')
        except IOError:
            self.com.error(Bold="IOerror",
                           String="Could not load given File",
                           level=2)
        except BaseException:
            self.com.error(
                Bold="Unknown Error",
                String="An Unknown Error occured (See log for details",
                level=2)
            self.com.log(
                "IOPARSE Encountered an Unknown error attempting to initialize self.csvFile",
                level=2)
        self.Values = 0
        self.ValueList = []

        self.LayerList = []
Ejemplo n.º 2
0
    def __init__(self, iface):
        """Constructor.

        :param iface: An interface instance that will be passed to this class
            which provides the hook by which you can manipulate the QGIS
            application at run time.
        :type iface: QgisInterface
        """
        # type: object
        # Save reference to the QGIS interface
        self.output_set = None
        self.iface = iface
        # initialize plugin directory
        self.plugin_dir = os.path.dirname(__file__)
        self.com = Communicate(self.iface)
        # initialize locale
        locale = QSettings().value('locale/userLocale')[0:2]
        locale_path = os.path.join(self.plugin_dir, 'i18n',
                                   'mainPlug_{}.qm'.format(locale))

        if os.path.exists(locale_path):
            self.translator = QTranslator()
            self.translator.load(locale_path)

            if qVersion() > '4.3.3':
                QCoreApplication.installTranslator(self.translator)

        # Declare instance attributes
        self.actions = []
        self.menu = self.tr(u'&EggAGGIS')
        self.toolbar = self.iface.addToolBar(u'mainPlug')
        self.toolbar.setObjectName(u'mainPlug')

        # Do some C like shenanigans
        self.DialogStore = [None] * 15
Ejemplo n.º 3
0
 def __init__(self, pointLayer, iface):
     # processing.initialize()
     self.iface = iface
     self.com = Communicate(self.iface)
     self.pLayer = pointLayer
     self.PredictionLayer = ""
     self.VarianceLayer = ""
Ejemplo n.º 4
0
 def __init__(self, iface):
     """
     The work horse of the NDVI calculations, named rasterManip due to it's older functions
     :param iface: The iface passed in from mainPlug
     """
     self.iface = iface
     self.com = Communicate(self.iface)
Ejemplo n.º 5
0
 def __init__(self):
     """
     Initialize the File Import Class
     """
     self.com = Communicate()
     self.filePath = ''
     self.fileInfo = None
     self.baseName = None
     self.rLayer = None
Ejemplo n.º 6
0
 def __init__(self):
     """
     Export a file as an ASCII tif
     """
     self.com = Communicate()
     self.filePath = ''
     self.ExportX = 0
     self.ExportY = 0
     self.XLLCorner = 0
     self.YLLCorner = 0
     self.cellSize = 0
     self.NoDataValue = -9999
     self.DataSet = None
Ejemplo n.º 7
0
    def __init__(self, pointLayer, iface):
        """
        Setup the Interpolate Function

        :param pointLayer: The Layer to process
        :type pointLayer: QgsVectorLayer

        :param iface: QGIS iface
        :type iface: iface
        """
        # processing.initialize()
        self.iface = iface
        self.com = Communicate(self.iface)
        self.pLayer = pointLayer
        self.PredictionLayer = ""
        self.VarianceLayer = ""
Ejemplo n.º 8
0
    def __init__(self, path, iface):
        self.iface = iface
        self.path = path
        self.com = Communicate(self.iface)
        try:
            self.csvFile = open(path, 'rb')
        except IOError:
            self.com.error(
                Bold="IOerror", String="Could not load given File", level=2)
        except:
            self.com.error(
                Bold="Unknown Error", String="An Unknown Error occured (See log for details", level=2)
            self.com.log(
                "IOPARSE Encountered an Unknown error attempting to initialize self.csvFile", level=2)
        self.Values = 0
        self.ValueList = []

        self.LayerList = []
Ejemplo n.º 9
0
    def __init__(self, iface, rLayer):
        """
        Process one Raster, returning the Dataset
        THIS IS DEPRECATED
        :param iface: QGIS Iface
        :param rLayer: rLayer object to Process
        """
        Thread.__init__(self)

        self.iface = iface
        self.rLayer = rLayer
        self.com = Communicate(self.iface)
        self.FinishedDataset = []
        self.FinishOrder = []
        self.DataStore = []

        self.rLayerX = rLayer.width()
        self.rLayerY = rLayer.height()
        self.ThreadArray = []
Ejemplo n.º 10
0
    def __init__(self, iface, rLayer, DataStore, Finishorder, Yval):
        """
        Interpret a row of the rLayer given based off the given Y-Value.

        :param iface: QGis Iface
        :param rLayer: rLayer Pointer
        :param DataStore: DataStore Pointer
        :param Finishorder: Finish Order Array pointer
        :param Yval: The Y row
        """

        Thread.__init__(self)
        self.iface = iface
        self.com = Communicate(self.iface)
        self.rLayer = rLayer
        self.DataStore = DataStore
        self.Finishorder = Finishorder
        self.Yval = Yval
        self.a = RasterManip(iface=self.iface)

        self.internalData = []