Skip to content

Instantly share code, notes, and snippets.

Carsten Keßler crstn

Block or report user

Report or block crstn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View kommunertopo.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View datashader.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@crstn
crstn / voronoi.r
Created Jan 17, 2018
This is a small fix of Carson Farmer's Voronoi Polygons function (http://carsonfarmer.com/2009/09/voronoi-polygons-with-r/) which also copies the input points layer's CRS string over to the output polygons.
View voronoi.r
voronoipolygons = function(layer) {
require(deldir)
crds = layer@coords
z = deldir(crds[,1], crds[,2])
w = tile.list(z)
polys = vector(mode='list', length=length(w))
require(sp)
for (i in seq(along=polys)) {
pcrds = cbind(w[[i]]$x, w[[i]]$y)
pcrds = rbind(pcrds, pcrds[1,])
View rats-dynamic.html
<html>
<head>
<title>A D3 chart</title>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
</head>
<body>
<script>
@crstn
crstn / definer.sql
Last active Aug 31, 2016
Editing data in a CartoDB table via Leaflet with leaflet.draw plugin. Heavily inspired by http://blog.cartodb.com/read-and-write-to-cartodb-with-the-leaflet-draw-plugin/.
View definer.sql
DROP FUNCTION IF EXISTS carsten_upsert_pois(int[], text[]);
-- Returns a set of op,cartodb_id values where op means:
--
-- deleted: -1
-- updated: 0
-- inserted: 1
--
CREATE OR REPLACE FUNCTION carsten_upsert_pois(
cartodb_ids integer[],
@crstn
crstn / tomcat-users.xml
Created Oct 15, 2015
Tomcat user configuration for Strabon
View tomcat-users.xml
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users xmlns="http://tomcat.apache.org/xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
version="1.0">
<user username="endpoint" password="endpoint" roles="manager"/>
</tomcat-users>
View enviroCar-track-1.json
This file has been truncated, but you can view the full file.
{
"features": [
{
"type": "Feature",
"properties": {
"phenomenons": {
"Engine Load": {
"value": 25.490196228027344
},
View asylum-data.csv
name Est. GDP in USD 2015 Applicants since 2011 Est. Pop 2015 Applicants by pop Applicants by GDP
Austria 380.555 104489 8.556 12.21236559 274.5700359
Belgium 463.799 79209 11.239 7.047691076 170.7830332
Bulgaria 51.551 27124 7.166 3.785096288 526.1585614
Denmark 297.359 35302 5.629 6.271451412 118.7184514
Finland 235.276 14361 5.506 2.60824555 61.03895
France 2469.530 255800 64.213 3.983617025 103.5824631
Germany 3413.483 547034 81.360 6.723623402 160.2568403
Greece 207.148 42800 10.993 3.893386701 206.6155599
Hungary 126.691 129203 9.857 13.10774069 1019.82777
View index.html
<html>
<head>
<title>Leaflet template</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css"/>
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="https://raw.githubusercontent.com/calvinmetcalf/leaflet-ajax/master/dist/leaflet.ajax.min.js"></script>
<style>
html, body, #map {
height: 100%;
@crstn
crstn / evac_zones-simplified.geojson
Created Aug 11, 2014
NYC Flood Evacuation Zones Map
View evac_zones-simplified.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.