Skip to content

Instantly share code, notes, and snippets.

View jbants's full-sized avatar

James Banting jbants

View GitHub Profile
@jbants
jbants / data.tsv
Last active September 12, 2015 14:32
My first gist
date close
1-May-12 582.13
30-Apr-12 583.98
27-Apr-12 603.00
26-Apr-12 607.70
25-Apr-12 610.00
24-Apr-12 560.28
23-Apr-12 571.70
20-Apr-12 572.98
19-Apr-12 587.44
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>D3 Demo</title>
</head>
<style>
body { font: 12px Arial;}
path {
@jbants
jbants / index.html
Last active September 13, 2015 05:34
Pie Chart Hover Over
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>D3 Demo</title>
</head>
<style>
path {
stroke: steelblue;
stroke-width: 2;
@jbants
jbants / data.csv
Last active September 13, 2015 15:39
overlapping bar chart
letter col1 col2
A .08167 .0865
B .01492 .0756
C .02782 .07843
D .04253 .035
E .12702 .0544
F .02288 .0856
G .02015 .0734
H .06094 .01854
@jbants
jbants / app.js
Last active September 15, 2015 06:05
bulletish chart
var dataFlag = 1
var data = [{"name":"A","value":0.15},
{"name":"B","value":-0.025},
{"name":"C","value":-0.35},
];
var data1 = [{"name":"A","value":0.012},
{"name":"B","value":-0.15},
{"name":"C","value":0.25},
@jbants
jbants / notes.txt
Last active October 5, 2015 16:59
Tilestache Notes
- Postgres query must be on one line.
- When using vectiles provider, percision is reduced (Note for points)!
- Does not work with Pillow 3.0 - 2.9 works (05/10/15)
Snippets for geoserver
# create boundingbox from geometry
toString(xmin( $geometry )) + ' , '+ toString(ymin( $geometry )) + ' , '+ toString(xmax( $geometry )) + ' , '+ toString(ymax( $geometry ))
Ensure Basic Resource Info name is the same as the data layer name
this keyword: http://stackoverflow.com/questions/133973/how-does-this-keyword-work-within-a-javascript-object-literal
Feathering a raster with transparency for display.
Description: This document describes the steps involved for creating a transparent mask around the edges of a raster for display on map or tiling service.
1. Convert the raw raster data to appropriate projection (EPSG: 900913 or EPSG: 3857 for the web) and data format to TIFF.
2. Apply any styling to the raster (colour ramps, discrete colouring, etc...) using mapping software or image editing software. Save as TIFF.
3. Feather transparent edges in GIMP
a. Open the coloured raster in GIMP
b. Use the free select tool (f) to define an area within the raster extents. Ensure there is sufficient raster data outside of the area you define as this will be used to feather the transparency.
c. On the layer menu (with the selection still highlighted), right click your layer and select Add Layer Mask. (At this point you may want to save the image as a gimp image file in case you need to edit is further)
d. A Dialog will open, select Black (full transparency). Select Add