Skip to content

Instantly share code, notes, and snippets.

View clhenrick's full-sized avatar

Chris Henrick clhenrick

View GitHub Profile

#Using NYC geospport linux shared library from Ubuntu 16.04

I have been trying to understand more about geosupport, specifically geosupport desktop edition for linux which contains a linux .so shared library. I would like to eventually write node.js bindings for it so that I can write geocoding scripts that don't require a ton of network traffic.

I am a C noob and this was my first time messing with C and gcc on linux. I was able to write and compile a simple C program that calls the Geosupport shared library with hard-coded arguments.

##What is geosupport?

"Geosupport is a data processing system originally designed to run on IBM mainframes to support geographic processing needs common to New York City agencies." Basically, it's an NYC-specific geocoder released by the NYC department of city planning. It does many things, but at its simplest it can take human-readable address fields and return a point coordinate.

@jsanz
jsanz / README.md
Created September 14, 2016 09:23
SQL: ring buffers with several distances

Query to produce a series of rings using buffers:

  • First you get a generate_series with the number of rings you want to produce
  • Then produce the 80km buffers multiplying by the radius for a number of cities
  • Finally use the lag function to remove for every ring the previous one so you get the ring

@jsanz
jsanz / README.md
Last active February 10, 2017 22:02
SQL: Postgis workshop

Postgis queries workshop

With this viewer you will have a sandbox space to try different PostGIS capabilities using several datasets. Change the SQL and press Control+S or Command+S and check the results on the map on the right.

You can also play with the styles on the CartoCSS pane.

Contents

Editing OSM Boundaries

##Task:

@almccon
almccon / README.md
Last active June 15, 2016 20:15 — forked from rochoa/README.md
turbo-cartocss examples

Color ramps: *-fill

Basic usage

marker-fill: ramp([column_name], colorbrewer(Greens));
                  |                    |
                  v                    |
      column to calculate ramp         |
                                       v
@andrewxhill
andrewxhill / batchAPI.py
Last active May 16, 2018 16:01
quick example of using the batch api over python
import sys
import urllib
import urllib2
import json
import requests
# Start a new batch SQL task
def cartoBatchQuery(username, api_key, sql):
r = requests.post('http://%s.cartodb.com/api/v2/sql/job?api_key=%s' %(username,api_key),
headers={'content-type':'application/json'},
@ebrelsford
ebrelsford / index.html
Created April 27, 2016 14:55
Blur a Leaflet map with html2canvas and StackBlur
<html>
<head>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v1.0.0-rc.1/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet/v1.0.0-rc.1/leaflet.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.5.0-alpha2/html2canvas.min.js"></script>
<script src="https://cdn.rawgit.com/flozz/StackBlur/master/dist/stackblur.min.js"></script>
<script src="https://code.jquery.com/jquery-2.2.3.min.js"></script>
<style>
html, body {
margin:0;
@olih
olih / jq-cheetsheet.md
Last active May 15, 2026 23:10
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@biovisualize
biovisualize / README.md
Last active September 20, 2024 08:13
d3.selection.appendHTML and appendSVG

Parse and append an HTML or SVG string. I use it a lot for appending a template, instead of generating it with d3.

d3.select('.container').appendHTML('<div><svg><g><rect width="50" height="50" /></g></svg></div>');

Unlike using .html, .appendHTML can append multiple elements

d3.select('.container').html('<span id="a"></span>');
d3.select('.container').html('<span id="b"></span>'); // will replace content
d3.select('.container').appendHTML('<span id="c"></span>'); // will append content
@rochoa
rochoa / README.md
Last active August 4, 2017 04:59
[CARTO] turbo-cartocss examples

Color ramps: *-fill

Basic usage

marker-fill: ramp([column_name], colorbrewer(Greens));
                  |                    |
                  v                    |
      column to calculate ramp         |
                                       v