Skip to content

Instantly share code, notes, and snippets.

Avatar

Thomas Gratier ThomasG77

View GitHub Profile
View france-bleu-tdf-2020-retrive-kml.sh
wget --content-disposition https://www.google.com/maps/d/kml?mid=1QEn5vwRp0NEDEu_VWPdaaVtGQ1-a45oK
wget --content-disposition https://www.google.com/maps/d/kml?mid=1eOPdoMdxtabrzH9roJJI5sITPApXqVi-
wget --content-disposition https://www.google.com/maps/d/kml?mid=1WavrdJ0nw29v5k9V05bcidGkcxALtftx
wget --content-disposition https://www.google.com/maps/d/kml?mid=1Igkv4wOMBPzLoGMNQfbL2EyPBvCIanSl
wget --content-disposition https://www.google.com/maps/d/kml?mid=1F0dLcEfcSZlUGM4cD_AGTiQSkUYoTOJp
wget --content-disposition https://www.google.com/maps/d/kml?mid=19Rp4va6o16TLWqdzz6m6u2DODkj00uef
wget --content-disposition https://www.google.com/maps/d/kml?mid=1l5nipJpygoeJNdfGLx2eVk4gBI953m_K
wget --content-disposition https://www.google.com/maps/d/kml?mid=1gf5g6KiNUTSuKYwgHXM9BN6_DmIdNWBz
wget --content-disposition https://www.google.com/maps/d/kml?mid=1X8tlktwMmRkpV4c_5juUt_UqFTfrVo7l
wget --content-disposition https://www.google.com/maps/d/kml?mid=1014wApjDVCtaXk0Za_fPlXMX1hmbsvmZ
View 3d__tessellate.md

tessellate

Tessellate (3d:tessellate)

This algorithm tessellates a polygon geometry layer, dividing the geometries into triangular components.

The output layer consists of multipolygon geometries for each input feature, with each multipolygon consisting of multiple triangle component polygons.

View 3d__tessellate.md
Tessellate (3d:tessellate)

This algorithm tessellates a polygon geometry layer, dividing the geometries into triangular components.

The output layer consists of multipolygon geometries for each input feature, with each multipolygon consisting of multiple triangle component polygons.


----------------
Input parameters
View 3d__tessellate.md
Tessellate (3d:tessellate)

This algorithm tessellates a polygon geometry layer, dividing the geometries into triangular components.

The output layer consists of multipolygon geometries for each input feature, with each multipolygon consisting of multiple triangle component polygons.


----------------
Input parameters
View draw-freehand.0f2006e6.js
(function () {function uh(a){return a&&a.__esModule?{d:a.default}:{d:a}}var Uf={};var Wf={};var Gd={};var Se={};function ca(){return function(){throw new Error("Unimplemented abstract method.")}()}var bo=0;function ga(t){return t.ol_uid||(t.ol_uid=String(++bo))}var Ye="6.3.1";var lo=Se&&Se.__extends||function(){var t=function(r,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(r,e)};return function(r,e){function o(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),tg=function(t){function r(r){var e=this,o="Assertion failed. See https://openlayers.org/en/"+("latest"===Ye?Ye:"v"+Ye.split("-")[0])+"/doc/errors/#"+r+" for details.";return(e=t.call(this,o)||this).code=r,e.name="AssertionError",e.message=o,e}return lo(r,t),r}(Error);Se.default=tg;var ra={ADD:"add",REMOVE:"remove"};var Wc={};var ub={PROPERTYCHANGE:"propertychange"};var ye={};function fa(e,t
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Freehand Drawing</title>
<!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=fetch,requestAnimationFrame,Element.prototype.classList,URL"></script>
<style>
.map {
width: 100%;
height:400px;
View index.js
json = require('./data.json');
var fields1 = json.operationalLayers[2].featureCollection.layers[0].layerDefinition.fields.reduce((acc, field) => {
if (field.name) {
acc[field.name] = null;
}
return acc;
}, {})
var fields2 = json.operationalLayers[2].featureCollection.layers[0].layerDefinition.fields.filter(field => field.name.length > 0).map(field => field.name);
//console.log(fields2);
@ThomasG77
ThomasG77 / README.md
Last active Jun 21, 2020
Script to write QGIS expressions on one page (easy to reference to help people on the web, text search from your browser) https://gist.githack.com/ThomasG77/0c6862fb2b6b3fc301ea994733688ea5/raw/99ecc5e6127e7238814da330a4d5d0b9fa2afe4e/qgis-3-12-expressions-single-page.html
View README.md

Generate single page documentation for expressions

Why?

The goal was a single page documentation on expression

One approach could have been about using scripts/process_function_template.py and/or files in resources/function_help/json/. As there is no link between groups and functions documented in these json files, you need to look for the relation in the source src/core/expression/qgsexpressionfunction.cpp. You would also need to manage translations. FYI, all paths are relative to the root of the source code repo.

So, instead we've made the choice to use HTML generated doc for expressions from PyQGIS docs. It works for any languages

@ThomasG77
ThomasG77 / mapbox-gl-js-wms-single-call.html
Last active Jun 18, 2020
Demo to make single WMS call using "image" source in Mapbox GL JS. Useful for correctly managing labels (default WMS source multiply them because it calls tiled WMS)
View mapbox-gl-js-wms-single-call.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Add a WMS source</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<script src="https://api.mapbox.com/mapbox-gl-js/v1.11.0/mapbox-gl.js"></script>
<script src="https://unpkg.com/@mapbox/sphericalmercator@1.1.0/sphericalmercator.js"></script>
<link href="https://api.mapbox.com/mapbox-gl-js/v1.11.0/mapbox-gl.css" rel="stylesheet" />
<style>
@ThomasG77
ThomasG77 / scales-and-zoom-levels.py
Created Jun 13, 2020
Python functions to convert from/to zoom level to scale (assuming 96 dpi and latitude 0)
View scales-and-zoom-levels.py
from math import cos, log, pi
def getScale(zoom_level, screen_dpi=96, latitude=0):
resolution = (6378137.0 * 2 * pi / 256) * cos(latitude) / (2**zoom_level)
return (screen_dpi * 1/0.0254 * resolution)
def getZoomLevel(scale, screen_dpi=96, latitude=0):
resolution = scale / (screen_dpi * 1/0.0254)
zoom_level = ((6378137.0 * 2 * pi / 256) * cos(latitude)) / resolution
You can’t perform that action at this time.