Skip to content

Instantly share code, notes, and snippets.

View davo's full-sized avatar
🏠

Davo Galavotti davo

🏠
View GitHub Profile
@davo
davo / Make
Last active August 29, 2015 14:01
Parcelario CABA, GeoJSON a TopoJSON
# Requiere GDAL y TopoJSON
# brew install gdal
# npm install -g topojson
all: \
parcelario-topojson.json
parcelario.zip:
curl -o parcelario.zip 'https://recursos-data.buenosaires.gob.ar/ckan2/parcelas/parcelas.zip'

A demonstration of how to calculate the areas of Voronoi regions clipped by geographic features using D3.

[D3’s implementation](Sutherland–Hodgman algorithm) of the Sutherland–Hodgman algorithm only works for convex clip polygons, but we exploit the fact that Voronoi regions are guaranteed to be convex, and use each Voronoi region as a clip polygon, with the projected geographic boundary as a subject polygon.

In response to a question by Gonzalo Bellver.

@davo
davo / README.md
Last active August 29, 2015 14:01 — forked from jasondavies/README.md
Voronoi CABA

A demonstration of how to calculate the areas of Voronoi regions clipped by geographic features using D3.

[D3’s implementation](Sutherland–Hodgman algorithm) of the Sutherland–Hodgman algorithm only works for convex clip polygons, but we exploit the fact that Voronoi regions are guaranteed to be convex, and use each Voronoi region as a clip polygon, with the projected geographic boundary as a subject polygon.

In response to a question by Gonzalo Bellver.

@davo
davo / Merge.sql
Last active August 29, 2015 14:01
Merge polygons via PostGIS Query on CartoDB
SELECT ST_Union(ST_makeValid( ST_SnapToGrid(the_geom_webmercator ,0.0001))) FROM barrios GROUP BY barrios.the_geom_webmercator

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@davo
davo / README.md
Created August 7, 2014 17:48 — forked from madelfio/README.md

Shows multiple overlaid Voronoi diagrams, given multiple point sets.

@davo
davo / _.md
Created August 26, 2014 17:50
MoveToFront();
@davo
davo / _.md
Created August 26, 2014 18:47
Reusable Line Chart
@davo
davo / _.md
Created September 1, 2014 22:53
Word wrap with foreignObject