Skip to content

Instantly share code, notes, and snippets.

Thomas Gratier ThomasG77

View GitHub Profile
View time_series_covid19_all_layers_hopkins.vrt
<OGRVRTDataSource>
<!-- CONFIRMED. See https://github.com/CSSEGISandData/COVID-19/tree/master/csse_covid_19_data/csse_covid_19_time_series -->
<OGRVRTLayer name="time_series_covid19_confirmed_global">
<SrcDataSource>/vsicurl/https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv</SrcDataSource>
<GeometryType>wkbPoint</GeometryType>
<LayerSRS>WGS84</LayerSRS>
<GeometryField encoding="PointFromColumns" x="Long" y="Lat"/>
</OGRVRTLayer>
<!-- DEATHS. See https://github.com/CSSEGISandData/COVID-19/tree/master/csse_covid_19_data/csse_covid_19_time_series -->
<OGRVRTLayer name="time_series_covid19_deaths_global">
View README.md

QGIS tips

Expressions

Insert scale as an expression

In QGIS composer, set for the map an "Item ID" with value main_map and then in an expression in a HTML box or a Text box, you can insert the following expressions

[%'1 : '  || round(map_get(item_variables('main_map'), 'map_scale'),0)%]
View write-json-qgisnetworklogger.py
import json
from qgis.utils import plugins
from qgisnetworklogger.model import (RequestDetailsItem,
RequestHeadersItem, ReplyDetailsItem, ReplyHeadersItem)
def process_record_to_json(record):
_, tot = record.progress
reply_children = record.children[0].children
response_children = record.children[1].children
View example2.kml
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>Red Bull X-Alps 2019 Route</name>
<snippet>https://www.redbullxalps.com/ Created by twpayne@gmail.com</snippet>
<open>1</open>
<Folder>
<name>Route</name>
<Placemark>
<LineString>
View test-processing-quickosm.py
import sys
import os
import qgis
from qgis.gui import *
from qgis.core import *
from qgis.utils import plugins
from PyQt5.QtCore import *
quickosm = os.path.join(os.environ['HOME'], '.local/share/QGIS/QGIS3/profiles/default/python/plugins/')
sys.path.append(quickosm)
@ThomasG77
ThomasG77 / bitbucket-issues-rest-api.md
Last active Feb 24, 2020
Create, update and list issues from Bitbucket API V2 using CURL
View bitbucket-issues-rest-api.md

Set variables

export user=my_user_email
export password=my_password
export org=my_org_or_my_user
export repo=my_repo_name
@ThomasG77
ThomasG77 / index.html
Last active Feb 22, 2020 — forked from Andrew-Reid/index.html
Leaflet and Popup with D3
View index.html
<!DOCTYPE html>
<html>
<head>
<title>Leaflet with D3 popups</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.13.0/d3.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css" integrity="sha512-Rksm5RenBEKSKFjgI3a41vrjkw4EVPlJ3+OiI65vTjIdo9brlAacEuKOiQ5OFh7cOI1bkDwLqdLw3Zg0cRJAAQ==" crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js" integrity="sha512-/Nsx9X4HebavoBvEBuyp3I7od5tA0UzAxs+j83KgC8PU0kgB4XiK4Lfe4y4cgBtaRJQEIFCW+oC506aPT2L1zw==" crossorigin=""></script>
View openstreetmap-logo-only.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View index.html
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.6.0/dist/leaflet.css"
integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ=="
crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.6.0/dist/leaflet.js"
integrity="sha512-gZwIG9x3wUXg2hdXF6+rVkLF/0Vi9U8D2Ntg4Ga5I5BZpVkVxlJWbSQtXPSiUTtC0TjtGOmxa1AJPuV0CPthew=="
You can’t perform that action at this time.