Skip to content

Instantly share code, notes, and snippets.

View gka's full-sized avatar
🐢

Gregor Aisch gka

🐢
View GitHub Profile
@gka
gka / processing-jython.sublime-build
Created May 20, 2012 19:28
Sublime build system for running Processing sketches via Jython
{
"env": {
"CLASSPATH": ".:/usr/local/lib/processing/core.jar"
},
"cmd": ["jython", "$file"]
}
@gka
gka / cameroon.json
Created June 5, 2012 17:57
Cameroon Arrondissements
{
"proj": {
"id": "laea"
},
"layers": [
{
"id": "commune",
"src": "arrondissements.shp",
"simplify": 1.3,
"attributes": ["commune", "arrondisse", "departemen", "region"]
@gka
gka / data.csv
Created June 14, 2012 06:05
Miso.Dataset auto column names
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
1995 2000 2005 2010
Germany 29 25 28 29
France 29 28 28 30
Greece 35 33 33 33
@gka
gka / delimited.js
Created June 14, 2012 20:50
Extended CSV Parser for Miso.Dataset
(function(global, _) {
var Miso = (global.Miso || (global.Miso = {}));
/**
* Smart delimited data parser.
* - Handles CSV and other delimited data.
* - Includes auto-guessing of delimiter character if delimiter is set to "auto"
* Parameters:
* options
@gka
gka / italia.yaml
Created July 6, 2012 07:04
YAML descriptor for Bella Italia showcase on kartograph.org
proj:
id: satellite
lat0: 33
lon0: 15
dist: 1.1
up: 11
layers:
- special: graticule
latitudes: [30,32,34,36,38,40,42,44,46,48,50]
longitudes: [5,7.5,10,12.5,15,17.5,20]
@gka
gka / berlin.svg
Created July 10, 2012 12:24
Berlin Street Map (PostGIS, OSM)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gka
gka / index.html
Created July 11, 2012 06:40
How to use HCL in d3.js
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<style>
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
padding: 14px;
}
@gka
gka / join_osm_roads.py
Created July 11, 2012 11:09
Joins OSM road segments that share the same name
from psycopg2 import connect
from shapely.wkb import loads, dumps
from shapely.ops import linemerge
from osgeo import ogr
from osgeo.osr import SpatialReference
import os
db = connect('dbname=osm')
cur = db.cursor()
@gka
gka / gist:3098831
Created July 12, 2012 15:21
Join OSM road segments that share the same reference number
from psycopg2 import connect
from shapely.wkb import loads, dumps
from shapely.ops import linemerge
from osgeo import ogr
from osgeo.osr import SpatialReference
import os
db = connect('dbname=osm-czech')
cur = db.cursor()
types = "'motorway'"
@gka
gka / qgis2kartograph.py
Created July 17, 2012 13:18
Kartograph config generator for QGis
# Very first draft of a Kartograph config generator for QGis
from qgis.core import *
import json
def hexcol(c):
return '#%02x%02x%02x' % (c.red(), c.green(), c.blue())