Skip to content

Instantly share code, notes, and snippets.

Avatar

Thomas Gratier ThomasG77

View GitHub Profile
@ThomasG77
ThomasG77 / dms2dec.py
Last active May 31, 2021 — forked from chrisjsimpson/dms2dec.py
Convert coordinates in DMS notation to decimal in Python.
View dms2dec.py
#!/env/python
# coding=utf8
"""
Converting Degrees, Minutes, Seconds formatted coordinate strings to decimal.
Formula:
DEC = (DEG + (MIN * 1/60) + (SEC * 1/60 * 1/60))
Assumes S/W are negative.
@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>
@ThomasG77
ThomasG77 / README.md
Last active Jul 24, 2018 — forked from rveciana/README.md
Using JSTS to measure how far a line travels through a polygon
View README.md

Example to ilustrate this question at gis.stackoverflow.

We choose to replace Turf with JSTS.

If the result is more complex (i.e. the resulting intersection is a polyline), the algorithm should be repeated for each part in the polygon.

@ThomasG77
ThomasG77 / README.md
Created Jul 12, 2018 — forked from tmcw/README.md
Line Chart
View README.md
@ThomasG77
ThomasG77 / .gitignore
Created Feb 28, 2018 — forked from tschaub/.gitignore
OpenLayers + Webpack
View .gitignore
/node_modules/
bundle.js
@ThomasG77
ThomasG77 / README.md
Created Nov 24, 2017 — forked from tmcw/README.md
Leaflet With simplestyle Markers
View README.md
View install.sh
hg clone https://bitbucket.org/tiax/bitbucket-issues-cli # Fork repo with support for Git on Bitbucket
cd bitbucket-issues-cli
hg patch ../patch-bitbucket-issues-cli-1
@ThomasG77
ThomasG77 / .block
Created Mar 3, 2017 — forked from veltman/.block
Scribble map
View .block
height: 600
@ThomasG77
ThomasG77 / Readme.md
Last active Jan 6, 2017 — forked from timelyportfolio/Readme.md
vega for time series chart with shaded blocks
View Readme.md

vega stocks spec forked to add shaded blocks

Often time series charts can be enhanced by shaded blocks to highlight events or periods as shown by this example which uses the R package xtsExtra. Vega specs already allow this functionality, and it is fairly easy to implement.

I added an events object to the JSON data array.

    {
      "name": "events",
      "values": [
        {"name":"Test1", "start":"Apr 2000", "end":"Mar 2003"},