Skip to content

Instantly share code, notes, and snippets.

View ThomasG77's full-sized avatar

Thomas Gratier ThomasG77

View GitHub Profile
@ThomasG77
ThomasG77 / Readme.md
Last active January 6, 2017 00:13 — forked from timelyportfolio/Readme.md
vega for time series chart with shaded blocks

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"},
@ThomasG77
ThomasG77 / .block
Created March 3, 2017 23:20 — forked from veltman/.block
Scribble map
height: 600
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
OpenLayers.Layer.D3 = OpenLayers.Class(OpenLayers.Layer.Vector, {
d3FeaturesNodeClass:'d3features',
d3Features:[],
afterAdd:function(){
var self = this;
if(this.renderer.CLASS_NAME.match(/SVG$/)){
this.d3InitSVG();
this.events.register('moveend',this,this.onMoveEnd);
@ThomasG77
ThomasG77 / README.md
Created November 24, 2017 00:37 — forked from tmcw/README.md
Leaflet With simplestyle Markers
@ThomasG77
ThomasG77 / .gitignore
Created February 28, 2018 01:17 — forked from tschaub/.gitignore
OpenLayers + Webpack
/node_modules/
bundle.js
@ThomasG77
ThomasG77 / postgis_geojson.php
Created September 21, 2012 20:25 — forked from bmcbride/postgis_geojson.php
PHP PostGIS to GeoJSON
<?php
header('Content-Type: application/json; charset=UTF-8');
/**
* PostGIS to GeoJSON
* Query a PostGIS table or view and return the results in GeoJSON format, suitable for use in OpenLayers, Leaflet, etc.
*
* @param string $geotable The PostGIS layer name *REQUIRED*
* @param string $geomfield The PostGIS geometry field *REQUIRED*
* @param string $srid The SRID of the returned GeoJSON *OPTIONAL (If omitted, EPSG: 4326 will be used)*
* @param string $fields Fields to be returned *OPTIONAL (If omitted, all fields will be returned)* NOTE- Uppercase field names should be wrapped in double quotes
@ThomasG77
ThomasG77 / README.md
Last active July 5, 2018 11:16 — forked from elemoine/README.md
OpenLayers 3 Google Maps API

Use OL3 and Google Maps together

This GIST provides an example of a Google Maps map with an OL3 map as control, to give users a Google base map with OL3 content on top.

Open the corresponding bl.ock to view the example in your browser.

Warning!

@ThomasG77
ThomasG77 / README.md
Created July 12, 2018 22:22 — forked from tmcw/README.md
Line Chart
@ThomasG77
ThomasG77 / README.md
Last active July 24, 2018 14:18 — forked from rveciana/README.md
Using JSTS to measure how far a line travels through a polygon

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.