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:
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:
# 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 |
<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"; |
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
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 |
<!-- | |
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"/> |
<!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 { |
<!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 { |