예제 #1
0
    def openImportObservationData(self, serie_id):
        """
        Opens the processing alg ImportObservationData
        with dynamic inputs based on given serie id
        """

        class DynamicImportObservationData(ImportObservationData):

            def name(self):
                return 'dynamic_import_observation_data'

            def displayName(self):
                return 'Import observation data'

            def group(self):
                return 'Manage'

            def groupId(self):
                return 'gobs_manage'

            def getSerieId(self):
                return serie_id

            def initAlgorithm(self, config):

                # use parent class to get other parameters
                super(self.__class__, self).initAlgorithm(config)

        alg = DynamicImportObservationData()
        alg.setProvider(QgsApplication.processingRegistry().providerById("gobs"))
        param = {}
        execAlgorithmDialog(alg, param)
예제 #2
0
 def publishCallback(self):
     processing.execAlgorithmDialog(
         "mappia:Share", {
             'LAYERS': [
                 layer.dataProvider().dataSourceUri(False)
                 for layer in iface.mapCanvas().layers()
             ]
         })
예제 #3
0
    def openDialog(self, button):
        """Shortcut method to open the algorithm dialog."""

        params = {}
        
        if button == self.exportFolder:
            alg = execAlgorithmDialog('mapsprinter:ExportLayoutsFromFolder', params)
        elif button == self.exportProject:
            alg = execAlgorithmDialog('mapsprinter:ExportLayoutsFromProject', params)
    def runAlgorithm(self, name):

        if name not in self.algorithms:
            self.iface.messageBar().pushMessage(
                tr("Error"),
                tr("This algorithm cannot be found") + ' {}'.format(name),
                level=Qgis.Critical)
            return

        # Run alg
        param = {}
        alg_name = 'lizsync:{0}'.format(name)
        execAlgorithmDialog(alg_name, param)
예제 #5
0
 def run_create_contours(self):
     '''Run CreateContours module'''
     result = processing.execAlgorithmDialog('cruisetools:createcontours', {})
     if not result == {}:
         iface.activeLayer().setSubsetString('"length_m" > 1000')
         iface.messageBar().pushMessage('Cruise Tools ', f'{utils.return_success()}! Contours have been computed: {utils.return_file_link(result["OUTPUT"])}', level=Qgis.Success)
     return
예제 #6
0
 def run_t(self, startX, startY, endX, endY):
     if startX == endX and startY == endY:
         return
     extent = '%f,%f,%f,%f' % (startX, endX, startY, endY)
     [
         p_datefrompoint, p_interval_b, p_interval_a, p_singledate,
         p_composite, p_preyear, p_postyear, p_prefix, p_combi, p_band1,
         p_band2, p_band3, p_cloudfilters, p_clouds, p_cloudfilterc,
         p_cloudc, p_vis_min, p_vis_max, p_visible
     ] = self.get_config("set2")
     if p_datefrompoint:
         cur_Layer = self.iface.mapCanvas().currentLayer()
         today = ''
     else:
         cur_layer = ''
         today = datetime.date.today().strftime("%Y-%m-%d")
     self.iface.mapCanvas().setMapTool(self.prevMapTool)
     processing.execAlgorithmDialog(
         'Fire hunter:Make a Sentinel-2 mosaic', {
             'EXTENT': extent,
             'DATEFROMPOINT': p_datefrompoint,
             'INPUT': cur_Layer,
             'DATE': today,
             'INTERVAL_B': p_interval_b,
             'INTERVAL_A': p_interval_a,
             'SINGLEDATE': p_singledate,
             'COMPOSITE': p_composite,
             'PREYEAR': p_preyear,
             'POSTYEAR': p_postyear,
             'PREFIX': p_prefix,
             'COMBI': p_combi,
             'BAND1': p_band1,
             'BAND2': p_band2,
             'BAND3': p_band3,
             'CLOUDFILTERS': p_cloudfilters,
             'CLOUDS': p_clouds,
             'CLOUDFILTERC': p_cloudfilterc,
             'CLOUDC': p_cloudc,
             'VIS_MIN': p_vis_min,
             'VIS_MAX': p_vis_max,
             'VISIBLE': p_visible
         })
예제 #7
0
 def createLOB(sefl):
     processing.execAlgorithmDialog('shapetools:createlob', {})
예제 #8
0
 def createHypocycloid(sefl):
     processing.execAlgorithmDialog('shapetools:createhypocycloid', {})
 def field2geom(self):
     '''Convert layer containing a point x & y coordinate to a new point layer'''
     results = processing.execAlgorithmDialog('latlontools:field2geom', {})
 def geom2Field(self):
     '''Convert layer geometry to a text string'''
     results = processing.execAlgorithmDialog('latlontools:geom2field', {})
예제 #11
0
 def open_drape():
     '''
     function to open Processing algorithm dialog, used later
     '''
     processing.execAlgorithmDialog('native:setzfromraster')
예제 #12
0
 def createMagNorthLayer(self):
     processing.execAlgorithmDialog('compassroutes:createmagneticnorth', {})
 def PlusCodestoLayer(self):
     results = processing.execAlgorithmDialog('latlontools:pluscodes2point', {})
예제 #14
0
 def flipRotateTool(self):
     processing.execAlgorithmDialog('shapetools:geodesicflip', {})
예제 #15
0
 def measureLayerTool(self):
     processing.execAlgorithmDialog('shapetools:measurelayer', {})
예제 #16
0
 def createRadialLines(sefl):
     processing.execAlgorithmDialog('shapetools:createradiallines', {})
 def showGRs2PointsProcessingTools(self):
      processing.execAlgorithmDialog('FSC:Add GRs to layers', {})
 def toMGRS(self):
     '''Display the to MGRS  dialog box'''
     results = processing.execAlgorithmDialog('latlontools:point2mgrs', {})
 def MGRStoLayer(self):
     '''Display the to MGRS  dialog box'''
     results = processing.execAlgorithmDialog('latlontools:mgrs2point', {})
예제 #20
0
 def createPie(sefl):
     processing.execAlgorithmDialog('shapetools:createpie', {})
 def geodesicDensifyTool(self):
     results = processing.execAlgorithmDialog(
         'shapetools:geodesicdensifier', {})
예제 #22
0
 def createPolygon(sefl):
     processing.execAlgorithmDialog('shapetools:createpolygon', {})
 def toPlusCodes(self):
     results = processing.execAlgorithmDialog('latlontools:point2pluscodes', {})
예제 #24
0
 def createStar(sefl):
     processing.execAlgorithmDialog('shapetools:createstar', {})
예제 #25
0
 def pointDecimateTool(self):
     processing.execAlgorithmDialog('shapetools:geodesicpointdecimate', {})
예제 #26
0
 def transformTool(self):
     processing.execAlgorithmDialog('shapetools:geodesictransformations',
                                    {})
예제 #27
0
 def lineDecimateTool(self):
     processing.execAlgorithmDialog('shapetools:geodesiclinedecimate', {})
 def xyLineTool(self):
     results = processing.execAlgorithmDialog('shapetools:xy2line', {})
예제 #29
0
 def geodesicLineBreakTool(self):
     processing.execAlgorithmDialog('shapetools:linebreak', {})
예제 #30
0
 def createRouteLayer(self):
     processing.execAlgorithmDialog('compassroutes:createroutelayer', {})
예제 #31
0
 def createArc(sefl):
     processing.execAlgorithmDialog('shapetools:createarc', {})
예제 #32
0
    def __init__(self, iface, parent=None):
        """
        :param iface: QGIS interface
        :type iface: QgisInterface

        :param parent: parent window for modality.
        :type parent: QDialog/QApplication
        """
        QDialog.__init__(self, parent)
        self.setupUi(self)

        self.iface = iface
        self.project = QgsProject.instance()  # invoke a QgsProject instance

        # enable functionality to select all text when in focus
        for lineedit_widget in self.findChildren(QgsFilterLineEdit):
            lineedit_widget.setSelectOnFocus(True)

        # Map Tools & other class-wide variables
        self.point_tool = None
        self.rect_tool = None
        self.last_maptool = self.iface.mapCanvas().mapTool()

        self.layer_list = self.search_struc_list
        self.clear_buttons = [
            self.search_rest_circle_clear, self.search_rest_rect_clear,
            self.search_focus_clear, self.reverse_clear
        ]

        # Disable components for
        # Collapse all QgsCollapsibleGroupBoxs
        collapsible_boxes = self.findChildren(QgsCollapsibleGroupBox)
        for box in collapsible_boxes:
            box.setCollapsed(True)

        #### Set up signals/slots ####
        # Tab widget to disable components for reverse..
        self.search_tab.currentChanged.connect(self._on_reverse_select)

        # Config/Help dialogs
        # self.config_button.clicked.connect(lambda: on_config_click(self))
        self.help_button.clicked.connect(on_help_click)
        self.provider_config.clicked.connect(lambda: on_config_click(self))
        self.provider_refresh.clicked.connect(self._on_prov_refresh_click)

        # Search Buttons
        self.search_focus_button.clicked.connect(self._on_point_click)
        self.search_rest_circle_button.clicked.connect(self._on_point_click)
        self.search_rest_rect_button.clicked.connect(self._on_rect_click)
        for button in self.clear_buttons:
            button.clicked.connect(self._on_clear_click)

        # Structured Buttons
        self.search_struc_add.clicked.connect(self._on_add_click)
        self.search_struc_remove.clicked.connect(self._on_remove_click)

        # Reverse
        self.reverse_map.clicked.connect(self._on_point_click)

        # Batch
        self.batch_free.clicked.connect(lambda: processing.execAlgorithmDialog(
            '{}:pelias_search_free'.format(PLUGIN_NAME)))
        self.batch_structured.clicked.connect(
            lambda: processing.execAlgorithmDialog(
                '{}:pelias_search_structured'.format(PLUGIN_NAME)))
        self.batch_reverse.clicked.connect(
            lambda: processing.execAlgorithmDialog('{}:pelias_reverse'.format(
                PLUGIN_NAME)))
예제 #33
0
 def createDonut(sefl):
     processing.execAlgorithmDialog('shapetools:createdonut', {})
예제 #34
0
 def showDialog(self):
     """Display the KML Dialog window."""
     processing.execAlgorithmDialog('kmltools:importkml', {})
예제 #35
0
 def createEllipseRose(sefl):
     processing.execAlgorithmDialog('shapetools:createrose', {})
예제 #36
0
 def run(self):#icon
     processing.execAlgorithmDialog("Aguaje:Detection algorithm")#icon
예제 #37
0
 def createHeart(sefl):
     processing.execAlgorithmDialog('shapetools:createheart', {})