Skip to content

Instantly share code, notes, and snippets.

View jsanz's full-sized avatar
🗺️
Mapping

Jorge Sanz jsanz

🗺️
Mapping
View GitHub Profile
@jsanz
jsanz / README.md
Last active December 7, 2015 09:46
Taller Elecciones 2015

Taller mapas electorales con CartoDB

En este taller se describe el proceso de creación de diversos mapas electorales con CartoDB, enfocado sobre todo al tratamient o de los datos y las reglas de simbolización cartográfica.

http://bit.ly/cdb-elecciones-151203

Contacto:

@jsanz
jsanz / gist:5141420
Created March 12, 2013 09:15
From CartoDB to DXF, with all my love to CAD users
# With the GeoJSON OGR driver one can use the CartoDB SQL API to create any OGR supported format output
# OGR Formats: http://gdal.org/ogr/ogr_formats.html
# CartoDB SQL API: http://developers.cartodb.com/documentation/sql-api.html
# This sample creates a DXF making a "select the_geom from meteo" from my account at CartoDB
ogr2ogr -skipfailures -f DXF out.dxf "http://xurxosanz.cartodb.com/api/v2/sql?q=select%20the_geom%20from%20meteo&format=GeoJSON" OGRGeoJSON
@jsanz
jsanz / aprilwebinars.md
Last active December 15, 2015 16:39
Eventos de abril
@jsanz
jsanz / gist:5373513
Created April 12, 2013 17:04
Tissot circles like calculation
<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://coffeescript.org/extras/coffee-script.js"> </script>
<script src="http://svn.osgeo.org/metacrs/proj4js/trunk/lib/proj4js-compressed.js"> </script>
<script type="text/coffeescript">
Proj4js.defs["EPSG:4326"] = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs";
Proj4js.defs["EPSG:3042"] = "+proj=utm +zone=30 +ellps=WGS84 +units=m +no_defs";
Proj4js.defs["EPSG:900913"]= "+title=GoogleMercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs";
@jsanz
jsanz / README.md
Last active December 17, 2015 11:14
Using fields on infowindows styling

Default CartoDB infowindows are rendered using moustache.js templates. The variables you can pass are normally used to render data on the infowindow but you can also use them on other parts of the markup, like using them as CSS property styles to apply to element sizes or colours.

On this map, the infowindow show the percentage of votes of the three most voted parties by municipality. Apart from showing the result as a number, and thanks to some SQL juggling (check the complete query on this cdb-fiddle) you can also have a bar with the representative color of the party and a proper width.

See below the details of the infowindow templat

@jsanz
jsanz / introduccion-georreferencias.rst
Last active December 21, 2015 11:38
Post de escuela de datos sobre temas Geo

Introducción a las georreferencias

Note

Este gist tiene como objetivo mejorar el texto del curso de Escuela de datos. Si tienes sugerencias o mejoras no dudes en comentar o hacer un fork del mismo y proponer tus cambios.

To read
----------
The moon is a harsh mistress - Robert A. Heinlein
A canticle for Leibowitz - Walter M. Miller
Flowers for Algernon - Daniel Keyes
The Forever War - Joe Haldeman
God is Dead - Ron Currie Jr.
The world without us - Alan Weisman (not really sci fi, but interesting, anyways)
Animal Farm - George Orwell
@jsanz
jsanz / london-subways.xml
Last active December 28, 2015 07:39
Overpass Turbo query, run it at http://overpass-turbo.eu/ to get a map of the London subways
<!--
paste this XML at http://overpass-turbo.eu/
-->
<osm-script output="json">
<query type="way">
<has-kv k="railway" v="subway"/>
<bbox-query s="51.34004940750071" w="-0.5033111572265625" n="51.75466513020617" e="0.2197265625"/>
</query>
<print mode="body"/>
@jsanz
jsanz / index.html
Last active December 29, 2015 22:19
CartoDB.js named map with custom infowindow
<!DOCTYPE html>
<html>
<head>
<title>Named Maps Tutorial | CartoDB</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link rel="shortcut icon" href="http://cartodb.com/assets/favicon.ico" />
<style>
html, body, #map {
@jsanz
jsanz / index.html
Last active December 29, 2015 23:05
CartoDB.js named map with custom infowindo (mustache)
<!DOCTYPE html>
<html>
<head>
<title>Named Maps Tutorial | CartoDB</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link rel="shortcut icon" href="http://cartodb.com/assets/favicon.ico" />
<style>
html, body, #map {