当前位置: 首页>>代码示例>>Python>>正文


Python Qgis.Info方法代码示例

本文整理汇总了Python中qgis.core.Qgis.Info方法的典型用法代码示例。如果您正苦于以下问题:Python Qgis.Info方法的具体用法?Python Qgis.Info怎么用?Python Qgis.Info使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在qgis.core.Qgis的用法示例。


在下文中一共展示了Qgis.Info方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: canvasReleaseEvent

# 需要导入模块: from qgis.core import Qgis [as 别名]
# 或者: from qgis.core.Qgis import Info [as 别名]
def canvasReleaseEvent(self, event):
        '''Capture the coordinate when the mouse button has been released,
        format it, and copy it to the clipboard. pt is QgsPointXY'''
        pt = self.snappoint(event.originalPixelPoint())
        self.removeVertexMarker()
        if settings.captureShowLocation:
            if self.marker is None:
                self.marker = QgsVertexMarker(self.canvas)
                self.marker.setIconSize(18)
                self.marker.setPenWidth(2)
                self.marker.setIconType(QgsVertexMarker.ICON_CROSS)
            self.marker.setCenter(pt)
        else:
            self.removeMarker()

        try:
            msg = self.formatCoord(pt, self.settings.delimiter)
            formatString = self.coordFormatString()
            if msg is not None:
                clipboard = QApplication.clipboard()
                clipboard.setText(msg)
                self.iface.messageBar().pushMessage("", "{} coordinate {} copied to the clipboard".format(formatString, msg), level=Qgis.Info, duration=4)
        except Exception as e:
            self.iface.messageBar().pushMessage("", "Invalid coordinate: {}".format(e), level=Qgis.Warning, duration=4) 
开发者ID:NationalSecurityAgency,项目名称:qgis-latlontools-plugin,代码行数:26,代码来源:copyLatLonTool.py

示例2: log

# 需要导入模块: from qgis.core import Qgis [as 别名]
# 或者: from qgis.core.Qgis import Info [as 别名]
def log(message, level_in=0):
    """
    Writes to QGIS inbuilt logger accessible through panel.

    :param message: logging message to write, error or URL.
    :type message: str

    :param level_in: integer representation of logging level.
    :type level_in: int
    """
    if level_in == 0:
        level = Qgis.Info
    elif level_in == 1:
        level = Qgis.Warning
    elif level_in == 2:
        level = Qgis.Critical
    else:
        level = Qgis.Info

    QgsMessageLog.logMessage(message, PLUGIN_NAME.strip(), level) 
开发者ID:GIScience,项目名称:orstools-qgis-plugin,代码行数:22,代码来源:logger.py

示例3: saveInfoToJson

# 需要导入模块: from qgis.core import Qgis [as 别名]
# 或者: from qgis.core.Qgis import Info [as 别名]
def saveInfoToJson(self):
        """ Save video Info to json """
        out_json, _ = askForFiles(self, QCoreApplication.translate(
            "QgsFmvPlayer", "Save Json"),
            isSave=True,
            exts="json")

        if not out_json:
            return

        taskSaveInfoToJson = QgsTask.fromFunction('Save Video Info to Json Task',
                                                  self.converter.probeToJson,
                                                  fname=self.fileName, output=out_json,
                                                  on_finished=self.finishedTask,
                                                  flags=QgsTask.CanCancel)

        QgsApplication.taskManager().addTask(taskSaveInfoToJson)
        return 
开发者ID:All4Gis,项目名称:QGISFMV,代码行数:20,代码来源:QgsFmvPlayer.py

示例4: __init__

# 需要导入模块: from qgis.core import Qgis [as 别名]
# 或者: from qgis.core.Qgis import Info [as 别名]
def __init__(self, min, max, message, parent=None, timeout = 1.5):
        """
        Constructs a progress widget
        """
        super(self.__class__, self).__init__(parent)
        self.min = min
        self.max = max
        sizePolicy = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Fixed)
        if parent:
            self.setMinimumSize(parent.width(),40)
        else:
            self.setMinimumSize(766,40)
        self.setSizePolicy(sizePolicy)
        self.progressBar = QProgressBar()
        self.progressBar.setMinimum(min)
        self.progressBar.setMaximum(max)
        self.parent = parent
        self.msgBarItem = QgsMessageBarItem(self.tr("INFO: "), message, self.progressBar, level=Qgis.Info, duration=timeout, parent = self.parent)
        self.pushItem(self.msgBarItem)
        self.parent.repaint() 
开发者ID:dsgoficial,项目名称:DsgTools,代码行数:22,代码来源:progressWidget.py

示例5: reclassify

# 需要导入模块: from qgis.core import Qgis [as 别名]
# 或者: from qgis.core.Qgis import Info [as 别名]
def reclassify(self):
        """
        Performs the actual reclassification, moving the geometry to the correct layer along with the specified attributes
        """
        if not self.checkConditions():
            return
        #button that sent the signal
        self.buttonName = self.sender().text().split(' [')[0].replace('&', '')
        (reclassificationLayer, self.category, self.edgvClass) = self.getLayerFromButton(self.buttonName)
        if reclassificationLayer is not None:
            reclassificationDict = self.reclassificationDict[self.category][self.edgvClass][self.buttonName]
            reclassifiedFeatures = self.layerHandler.reclassifySelectedFeatures(
                                        reclassificationLayer,
                                        reclassificationDict
                                    )
            self.iface.mapCanvas().refreshAllLayers()
            if reclassifiedFeatures > 0:
                self.iface.messageBar().pushMessage(
                    self.tr('Information!'),
                    self.tr('{} features reclassified with success!').format(reclassifiedFeatures),
                    level=Qgis.Info,
                    duration=3
                ) 
开发者ID:dsgoficial,项目名称:DsgTools,代码行数:25,代码来源:field_toolbox.py

示例6: flipSelectedLines

# 需要导入模块: from qgis.core import Qgis [as 别名]
# 或者: from qgis.core.Qgis import Info [as 别名]
def flipSelectedLines(self):
        """
        Method for flipping all selected lines. Used for button callback.
        """        
        # get all selected features and remove all features that are not lines
        selectedFeatures = self.getAllSelectedLines()
        pop = 0
        for idx, item in enumerate(selectedFeatures):
            if item[2] != 1:
                selectedFeatures.pop(idx-pop)
                pop += 1
        if not selectedFeatures:
            logMsg = self.getLogMessage(None, None)
            self.iface.messageBar().pushMessage(self.tr('Error'), logMsg, level=Qgis.Critical, duration=3)
            # QMessageBox.critical(self, self.tr('Critical!'), logMsg)
            QgsMessageLog.logMessage(logMsg, "DSGTools Plugin", Qgis.Critical)
            return
        # call the method for flipping features from geometry module
        flippedLines, failedLines = self.DsgGeometryHandler.flipFeatureList(featureList=selectedFeatures, debugging=True)
        logMsg = self.getLogMessage(flippedLines, failedLines)
        self.iface.messageBar().pushMessage(self.tr('Success'), logMsg, level=Qgis.Info, duration=3)
        QgsMessageLog.logMessage(logMsg, "DSGTools Plugin", Qgis.Info) 
开发者ID:dsgoficial,项目名称:DsgTools,代码行数:24,代码来源:flipLineTool.py

示例7: run

# 需要导入模块: from qgis.core import Qgis [as 别名]
# 或者: from qgis.core.Qgis import Info [as 别名]
def run(self, func, action):
        layer = self.canvas.currentLayer()
        if layer in self.iface.editableLayers():
            if layer.geometryType() in [QgsWkbTypes.LineGeometry , QgsWkbTypes.PolygonGeometry]:
                if self.tool:
                    self.tool.deactivate()
                self.tool = func(self.canvas, self.iface, action)
                self.tool.setAction(action)
                self.canvas.setMapTool(self.tool)
            else:
                self.iface.messageBar().pushMessage(self.tr('Warning'), self.tr('Tool not defined for points'),
                                                                    level=Qgis.Info, duration=3)
                self.tool.deactivate() if self.tool else ""
        else:
            self.iface.messageBar().pushMessage(self.tr('Warning'), self.tr('Start editing in current layer!'), level=Qgis.Info, duration=3)
            self.tool.deactivate() if self.tool else "" 
开发者ID:dsgoficial,项目名称:DsgTools,代码行数:18,代码来源:acquisition.py

示例8: log_info

# 需要导入模块: from qgis.core import Qgis [as 别名]
# 或者: from qgis.core.Qgis import Info [as 别名]
def log_info(cls, msg):
        QgsMessageLog.logMessage(msg, tag="Raster Vision", level=Qgis.Info) 
开发者ID:azavea,项目名称:raster-vision-qgis,代码行数:4,代码来源:log.py

示例9: copyCanvas

# 需要导入模块: from qgis.core import Qgis [as 别名]
# 或者: from qgis.core.Qgis import Info [as 别名]
def copyCanvas(self):
        extent = self.iface.mapCanvas().extent()
        canvasCrs = self.canvas.mapSettings().destinationCrs()
        if settings.bBoxCrs == 0 and canvasCrs != epsg4326:
            transform = QgsCoordinateTransform(canvasCrs, epsg4326, QgsProject.instance())
            p1x, p1y = transform.transform(float(extent.xMinimum()), float(extent.yMinimum()))
            p2x, p2y = transform.transform(float(extent.xMaximum()), float(extent.yMaximum()))
            extent.set(p1x, p1y, p2x, p2y)
        delim = settings.bBoxDelimiter
        prefix = settings.bBoxPrefix
        suffix = settings.bBoxSuffix
        precision = settings.bBoxDigits
        outStr = ''
        minX = extent.xMinimum()
        minY = extent.yMinimum()
        maxX = extent.xMaximum()
        maxY = extent.yMaximum()
        if settings.bBoxFormat == 0:  # minX,minY,maxX,maxY - using the delimiter
            outStr = '{:.{prec}f}{}{:.{prec}f}{}{:.{prec}f}{}{:.{prec}f}'.format(
                minX, delim, minY, delim, maxX, delim, maxY, prec=precision)
        elif settings.bBoxFormat == 1:  # minX,maxX,minY,maxY - Using the selected delimiter'
            outStr = '{:.{prec}f}{}{:.{prec}f}{}{:.{prec}f}{}{:.{prec}f}'.format(
                minX, delim, maxX, delim, minY, delim, maxY, prec=precision)
        elif settings.bBoxFormat == 2:  # x1 y1,x2 y2,x3 y3,x4 y4,x1 y1 - Polygon format
            outStr = '{:.{prec}f} {:.{prec}f},{:.{prec}f} {:.{prec}f},{:.{prec}f} {:.{prec}f},{:.{prec}f} {:.{prec}f},{:.{prec}f} {:.{prec}f}'.format(
                minX, minY, minX, maxY, maxX, maxY, maxX, minY, minX, minY, prec=precision)
        elif settings.bBoxFormat == 3:  # x1,y1 x2,y2 x3,y3 x4,y4 x1,y1 - Polygon format
            outStr = '{:.{prec}f},{:.{prec}f} {:.{prec}f},{:.{prec}f} {:.{prec}f},{:.{prec}f} {:.{prec}f},{:.{prec}f} {:.{prec}f},{:.{prec}f}'.format(
                minX, minY, minX, maxY, maxX, maxY, maxX, minY, minX, minY, prec=precision)
        elif settings.bBoxFormat == 4:  # WKT Polygon
            outStr = extent.asWktPolygon()
        elif settings.bBoxFormat == 5:  # bbox: [minX, minY, maxX, maxY] - MapProxy
            outStr = 'bbox: [{}, {}, {}, {}]'.format(
                minX, minY, maxX, maxY)
        elif settings.bBoxFormat == 6:  # bbox: [minX, minY, maxX, maxY] - MapProxy
            outStr = 'bbox={},{},{},{}'.format(
                minX, minY, maxX, maxY)
        outStr = '{}{}{}'.format(prefix, outStr, suffix)
        clipboard = QApplication.clipboard()
        clipboard.setText(outStr)
        self.iface.messageBar().pushMessage("", "'{}' copied to the clipboard".format(outStr), level=Qgis.Info, duration=4) 
开发者ID:NationalSecurityAgency,项目名称:qgis-latlontools-plugin,代码行数:43,代码来源:latLonTools.py

示例10: proto_method

# 需要导入模块: from qgis.core import Qgis [as 别名]
# 或者: from qgis.core.Qgis import Info [as 别名]
def proto_method(self, endpoint, **kwargs):
        kwargs['client_id'] =  CLIENT_ID
        res = requests.get(ROOT+endpoint, params=kwargs, proxies=getProxiesConf())
        if res.status_code == 200:
            return res.json()
        else:
            QgsMessageLog.logMessage("mapillary connection error: %d" % res.status_code, tag="go2mapillary",level=Qgis.Info) 
开发者ID:enricofer,项目名称:go2mapillary,代码行数:9,代码来源:mapillary_api.py

示例11: start

# 需要导入模块: from qgis.core import Qgis [as 别名]
# 或者: from qgis.core.Qgis import Info [as 别名]
def start(self,max=0, msg = ''):
        self.widget = self.iface.messageBar().createMessage(self.title,msg)
        self.progressBar = QProgressBar()
        self.progressBar.setRange(0,max)
        self.progressBar.setValue(0)
        self.progressBar.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
        self.widget.layout().addWidget(self.progressBar)
        QApplication.processEvents()
        self.iface.messageBar().pushWidget(self.widget, Qgis.Info, 50)
        QApplication.processEvents() 
开发者ID:enricofer,项目名称:go2mapillary,代码行数:12,代码来源:mapillary_coverage.py

示例12: stop

# 需要导入模块: from qgis.core import Qgis [as 别名]
# 或者: from qgis.core.Qgis import Info [as 别名]
def stop(self, msg = ''):
        '''
        the progressbar is stopped with a succes message
        :param msg: string
        :return:
        '''
        self.iface.messageBar().clearWidgets()
        message = self.iface.messageBar().createMessage(self.title,msg)
        self.iface.messageBar().pushWidget(message, Qgis.Info, 2) 
开发者ID:enricofer,项目名称:go2mapillary,代码行数:11,代码来源:mapillary_coverage.py

示例13: __init__

# 需要导入模块: from qgis.core import Qgis [as 别名]
# 或者: from qgis.core.Qgis import Info [as 别名]
def __init__(self,module):
        self.module = module
        self.iface = module.iface
        self.cache_dir = os.path.join(tempfile.gettempdir(),'go2mapillary')
        QgsMessageLog.logMessage("CACHE_DIR"+self.cache_dir, tag="go2mapillary",level=Qgis.Info)
        if not os.path.exists(self.cache_dir):
            os.makedirs(self.cache_dir)
        self.setDefaultLayers()
        self.actual_ranges = None 
开发者ID:enricofer,项目名称:go2mapillary,代码行数:11,代码来源:mapillary_coverage.py

示例14: showVideoInfo

# 需要导入模块: from qgis.core import Qgis [as 别名]
# 或者: from qgis.core.Qgis import Info [as 别名]
def showVideoInfo(self):
        ''' Show default probe info '''
        taskSaveInfoToJson = QgsTask.fromFunction('Show Video Info Task',
                                                  self.converter.probeShow,
                                                  fname=self.fileName,
                                                  on_finished=self.finishedTask,
                                                  flags=QgsTask.CanCancel)

        QgsApplication.taskManager().addTask(taskSaveInfoToJson)
        return 
开发者ID:All4Gis,项目名称:QGISFMV,代码行数:12,代码来源:QgsFmvPlayer.py

示例15: updateDurationInfo

# 需要导入模块: from qgis.core import Qgis [as 别名]
# 或者: from qgis.core.Qgis import Info [as 别名]
def updateDurationInfo(self, currentInfo):
        '''Update labels duration Info and CallBack Metadata
        @type currentInfo: String
        @param currentInfo: Current time value
        '''
        duration = self.duration
        self.currentInfo = currentInfo
        if currentInfo or duration:

            totalTime = _seconds_to_time(duration)
            currentTime = _seconds_to_time(currentInfo)
            tStr = currentTime + " / " + totalTime
            currentTimeInfo = _seconds_to_time_frac(currentInfo)

            if self.isStreaming:
                # get last metadata available
                self.get_metadata_from_buffer()
                # qgsu.showUserAndLogMessage("", "Streaming on ", onlyLog=True)
                # nextTime = currentInfo + self.pass_time / 1000
                # nextTimeInfo = _seconds_to_time_frac(nextTime)
                # self.callBackMetadata(currentTimeInfo, nextTimeInfo)
            elif self.islocal:
                self.readLocal(currentInfo)
            else:
                # Get Metadata from buffer
                self.get_metadata_from_buffer(currentTimeInfo)

        else:
            tStr = ""

        self.labelDuration.setText(tStr) 
开发者ID:All4Gis,项目名称:QGISFMV,代码行数:33,代码来源:QgsFmvPlayer.py


注:本文中的qgis.core.Qgis.Info方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。