Skip to content

Instantly share code, notes, and snippets.

# -*- coding: utf-8 -*-
from operator import itemgetter
from PyQt5.QtCore import QCoreApplication
from qgis.core import (QgsFeatureSink,
QgsProcessing,
QgsProcessingAlgorithm,
QgsProcessingParameterFeatureSink,
QgsProcessingParameterNumber,
from qgis.core import (QgsProcessingParameterFeatureSource,
QgsProcessingParameterField,
QgsProcessingParameterFileDestination,
QgsProcessingUtils,
QgsProcessingAlgorithm)
class myScript(QgsProcessingAlgorithm):
INPUT = 'INPUT'
@ghtmtt
ghtmtt / missing_tests_list.py
Last active December 7, 2017 15:14
Processing tests missing list
import processing
import yaml
# get QGIS algorithm list by name
qgis_algs = [i.name() for i in QgsApplication.processingRegistry().providerById("qgis").algorithms()]
# get NATIVE algorithm list by name
native_algs = [i.name() for i in QgsApplication.processingRegistry().providerById("native").algorithms()]
# total algorithms of QGIS provider in Processing
<head><meta charset="utf-8" /><script src="https://cdn.plot.ly/plotly-latest.min.js"></script></head><div id="myDiv" style="height: 100%; width: 100%;" class="plotly-graph-div"></div><script type="text/javascript">window.PLOTLYENV=window.PLOTLYENV || {};window.PLOTLYENV.BASE_URL="https://plot.ly";Plotly.newPlot("myDiv", [{"type": "scatter", "x": [6.81, 6.78, 6.49, 6.72, 6.88, 7.68, 7.69, 7.38, 6.76, 6.84, 6.91, 6.74, 6.77, 6.73, 6.68, 6.94, 6.72], "y": [1046.67, 1315.0, 1418.0, 997.33, 2972.3, 9700.0, 6726.0, 6002.5, 2096.0, 2470.0, 867.0, 2201.7, 1685.6, 2416.7, 1618.3, 2410.0, 2962.0], "mode": "markers", "ids": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]}], {"showlegend": true}, {"linkText": "Export to plot.ly", "showLink": false})</script>
<script>
var plotly_div = document.getElementById('myDiv')
var plotly_data = plotly_div.data
plotly_div.on('plotly_selected', function(data){
featureId = plotly_data[0].ids[data.points[0].pointNumber]
featureIds = []
data.points.forEa
# -*- coding: utf-8 -*-
"""
***************************************************************************
customwidgets.py
---------------------
Date : May 2014
Copyright : (C) 2014 by Denis Rouzaud
Email : denis.rouzaud@gmail.com
***************************************************************************
"""
allows multiple selection in a large list
Contact : marco@opengis.ch
.. note:: 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.
"""
@ghtmtt
ghtmtt / gist:b719344c6170ea2504a7
Created November 19, 2015 17:46
no plot plotly
In [1]: from plotly.offline import download_plotlyjs, init_notebook_mode, iplot
In [2]: init_notebook_mode()
<IPython.core.display.HTML object>
In [3]: iplot([{"x": [1, 2, 3], "y": [3, 1, 6]}])
<IPython.core.display.HTML object>
<IPython.core.display.HTML object>