Skip to content

Instantly share code, notes, and snippets.

@bertspaan
bertspaan / a10.geojson
Created May 28, 2014 11:21
Circle and A10!
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bertspaan
bertspaan / README.md
Created June 17, 2014 09:25
Bug in Grape/Hashie when POSTing GeoJSON file

I've been experiencing stack level errors in Hashie's mash.rb, when POSTing somewhat large GeoJSON files to a Grape endpoint. I'm using Grape 0.7.0.

To replicate the bug, do the following:

  1. Open two terminals, run rackup in one,
  2. and ./bug.sh in the other.

The Grape/Rack terminal will output:

[2014-06-17 11:18:37] ERROR SystemStackError: stack level too deep

@bertspaan
bertspaan / vwo.geojson
Created September 18, 2014 10:15
VWO-scholen, met locatie. Bron: http://www.schoolcijferlijst.nl/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bertspaan
bertspaan / sections.json
Created October 6, 2014 12:10
Building map sections for Stamen's Mapmaker Manifesto in Istanbul
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bertspaan
bertspaan / GTFS-to-GEOJSON.md
Last active May 13, 2017 22:47
Ruby script to convert GTFS stops and shapes to GeoJSON.

Ruby script to convert stops.txt and shapes.txt to GeoJSON.

@bertspaan
bertspaan / bag.sql
Last active August 29, 2015 14:09
Building polygons to individual linestrings
DROP TABLE IF EXISTS bert.pandlijn;
CREATE TABLE bert.pandlijn AS
SELECT ST_MakeLine(sp,ep) AS geom, trunc(random() * 9 + 1)::int AS rand
FROM
-- extract the endpoints for every 2-point line segment for each linestring
(SELECT
ST_PointN(geom, generate_series(1, ST_NPoints(geom)-1)) as sp,
ST_PointN(geom, generate_series(2, ST_NPoints(geom) )) as ep
FROM
@bertspaan
bertspaan / README.md
Created November 26, 2014 09:18
CitySDK LD API v0.9 - Matching API

CitySDK LD API v0.9 - Matching API

This gist contains the code of the matching API of the old version of CitySDK LD API.

api.rb was part of the Sinatra REST API, this code was triggered by a POST request, and called the code in the other files.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bertspaan
bertspaan / pits.ndjson
Created February 4, 2015 09:10
DRAFT of Histograph input file format. All files are NDJSON files.
// pits.ndjson contains NDJSON, each line defines a PIT,
// with the following properties:
{
"id": 9872, // integer or string, must be unique in dataset. Required.
"name": "Laren", // Label. Required.
"type": "place", // one of the following: ["place", "municipality", "country", ...]. Required.
"startDate": 1982-12-2, // XSD date. Optional.
"endDate": 2010-10-3, // XSD date. Optional.
"geometry": {}, // GeoJSON object. Optional.
@bertspaan
bertspaan / verdwenen-dorpen.json
Created February 4, 2015 17:32
Verdwenen Dorpen. Auteur: Bert Stulp, Eddie Poppe. Licentie: CC-BY
{
"features": [
{
"geometry": {
"coordinates": [
5.37197347709,
52.130290402
],
"type": "Point"
},