This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from PyQt5.QtCore import QCoreApplication | |
from qgis.core import (QgsProcessing, | |
QgsFeatureSink, | |
QgsProcessingAlgorithm, | |
QgsProcessingParameterFeatureSource, | |
QgsProcessingParameterFeatureSink) | |
import processing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
*************************************************************************** | |
* * | |
* 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. * | |
* * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from PyQt5.QtCore import QCoreApplication, QVariant | |
from qgis.core import (QgsProcessing, | |
QgsFeatureSink, | |
QgsField, | |
QgsFields, | |
QgsProcessingUtils, | |
QgsProcessingException, | |
QgsProcessingAlgorithm, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# the function needs geopy | |
# for Windows users, to install geopy, open the OSGEO4W Shell and type: | |
# py3_env | |
# pip3 install geopy | |
from qgis.core import * | |
from qgis.gui import * | |
from geopy.geocoders import Nominatim | |
locator = Nominatim(user_agent="myGeocoder") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
project = QgsProject.instance() | |
start_points = project.mapLayersByName('start_points')[0] # start | |
end_points = project.mapLayersByName('end_points')[0] # end | |
network = project.mapLayersByName('network')[0] # network | |
## from polyline to director | |
director = QgsVectorLayerDirector( | |
source=network, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
/*************************************************************************** | |
DataPlotlyDialog | |
A QGIS plugin | |
D3 Plots for QGIS | |
------------------- | |
begin : 2020-08-17 | |
git sha : $Format:%H$ | |
copyright : (C) 2017 by matteo ghetta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ee | |
from ee_plugin import Map | |
# Sentinel data | |
collection = ee.ImageCollection('COPERNICUS/S5P/OFFL/L3_NO2') | |
# Band of NO2 | |
collection = collection.select('tropospheric_NO2_column_number_density') | |
# 2019 data | |
collection2019 = collection.filterDate('2019-03-01', '2019-04-30') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
*************************************************************************** | |
* * | |
* 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. * | |
* * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import plotly.express as px | |
df = pd.read_csv("https://gist.github.com/ghtmtt/66164cc25a7b160cef99fa61b2feca59/raw/3034facfdecf7358934d9f0a78341c4d13f2af47/covid-pandas.csv") | |
col = [col for col in df.columns if '20' in col] | |
dfm = pd.melt( | |
df, | |
id_vars=["Province/State", "Country/Region", "continent", "Lat", "Long"], | |
value_vars=col, |
NewerOlder