Skip to content

Instantly share code, notes, and snippets.

View ThomasG77's full-sized avatar

Thomas Gratier ThomasG77

View GitHub Profile
import json
import tempfile
import urllib.request
baseUrl='https://wxs.ign.fr/calcul/alti/rest/elevationLine.json'
layer = iface.activeLayer()
# Caution: our line is a linestring and use by default epsg 4326, so we already have lon, lat
# You also need to select a line for the layer
for feature in layer.selectedFeatures():
current_date=$(date +%Y-%m-%d)
curl "https://www.metoffice.gov.uk/weather/warnings-and-advice/uk-warnings#?date=${current_date}" \
| grep "window.metoffice.warnings.geojson" \
| sed 's/window.metoffice.warnings.geojson = \|;$//g' \
>| "/tmp/metoffice-${current_date}.json"
@ThomasG77
ThomasG77 / CMake_3_20_Ubuntu_18_04.md
Created December 6, 2021 15:36 — forked from bmegli/CMake_3_20_Ubuntu_18_04.md
CMake 3.20 in Ubuntu 18.04 (reversible way)

Motivatation

  • modern CMake is required for building a lot of new software
  • CMake is dependency for many packages (e.g. ROS related)
  • we don't want to remove CMake (which would remove packages that depend on it)
  • we want safe procedure to update CMake that can be reversed easily

Current version in OS

Check current version

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Leaflet rotated marker example</title>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
<style>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Display cadastre on Maplibre</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="text/javascript" src="https://unpkg.com/[email protected]/dist/maplibre-gl.js"></script>
<link rel="stylesheet" type="text/css" href="https://unpkg.com/[email protected]/dist/maplibre-gl.css">
<style type="text/css">
@ThomasG77
ThomasG77 / README.md
Last active October 8, 2021 17:10
Une proposition pour avoir les accès https et FTP aux ressources actuellement uniquement en FTP

Montage https des ressources FTP IGN France

Pourquoi?

Historiquement, le protocole FTP était directement supporté par les navigateurs mais depuis quelques mois maintenant ce n'est plus vrai https://www.generation-nt.com/firefox-support-ftp-chrome-actualite-1974453.html. De ce fait, lorsqu'on clique sur un lien FTP, il faut choisir un logiciel tiers pour ouvrir le lien, généralement Filezilla. Ce n'est pas commode pour des utilisateurs novices ou ayant des contraintes d'installation sur leur poste informatique.

@ThomasG77
ThomasG77 / .gitignore
Last active September 30, 2021 18:38
Play with pkg to bundle offline content in a binary, to serve through local server
node_modules/
server-static-offline*
gh-pages.zip
dist/
@ThomasG77
ThomasG77 / README.md
Last active September 28, 2021 19:14
VRT Demo. Derived corners from building to get a CSV with xmin, xmax, ymin and ymax. The goal: create a polygon from these 4 coordinates using a VRT