Skip to content

Instantly share code, notes, and snippets.

View danicarrion's full-sized avatar

Dani Carrión danicarrion

  • Valladolid, Spain
View GitHub Profile
@danicarrion
danicarrion / Dockerfile
Created November 17, 2020 08:55
Ejemplo python-mapnik
FROM ubuntu:20.04
RUN apt-get update -y && apt-get install -y apt-utils
RUN apt-get install -y python3-mapnik
WORKDIR /app
COPY . .
@danicarrion
danicarrion / explain.md
Last active February 11, 2020 17:14
Taller para el Open Space de WeCodeFest 2020
@danicarrion
danicarrion / proxy.py
Created February 2, 2018 13:42
Basic proxy that adds your CARTO API key to any requests and forwards them to CARTO
import requests
from flask import Flask, request
BASE_URL = "https://my_account.carto.com" # Or CDN, or on-prem
API_KEY = "my_api_key"
VERIFY_SSL_CERT = True # Set to False if you don't want the proxy to verify CARTO's cert
app = Flask(__name__)
@danicarrion
danicarrion / index.html
Created November 21, 2016 07:57
Forward-all proxy for CARTO's password/token-protected named maps
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="https://cartodb-libs.global.ssl.fastly.net/cartodb.js/v3/3.15/themes/css/cartodb.css" />
<script src="https://cartodb-libs.global.ssl.fastly.net/cartodb.js/v3/3.15/cartodb.js"></script>
<title>Password-protected named map example</title>
</head>
<body>
<div id="map" style="height: 500px"></div>
@danicarrion
danicarrion / index.html
Last active October 17, 2016 15:46
CARTO + Openlayers + MVT example
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>CARTO + Openlayers + MVT example</title>
<link rel="stylesheet" href="https://openlayers.org/en/v3.18.2/css/ol.css" type="text/css" />
<script src="https://openlayers.org/en/v3.18.2/build/ol.js"></script>
@danicarrion
danicarrion / index.html
Last active September 6, 2016 15:14
CARTO + Tangram + MVT example
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>CARTO + Tangram + MVT example</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.0-rc.3/leaflet.css" />
<style>
@danicarrion
danicarrion / index.html
Created August 18, 2016 16:18
CARTO + Tangram + GeoJSON example
<!doctype html>
<!--
Tangram: real-time WebGL rendering for OpenStreetMap
http://github.com/tangrams/tangram
http://mapzen.com
-->
<html lang="en-us">
<head>
<meta charset="utf-8">
@danicarrion
danicarrion / index.html
Created May 20, 2015 18:33
createLayer with torque category layer
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<title>Torque category selector</title>
<link rel="stylesheet" href="http://libs.cartocdn.com/cartodb.js/v3/3.14/themes/css/cartodb.css" />
<style type="cartocss/text" id="cartocss">
Map {
@danicarrion
danicarrion / README.md
Last active January 12, 2016 15:08
Script that reads from a CartoDB table, geocode each row with Google's geocoder and put them back into CartoDB

This script reads a table fom CartoDB using the SQL API, geocodes one of its fields using Google's geocoder and updates the data on CartoDB.

If no valid credentials are provided for Google's geocoder, the free limits will apply.

TODO: multithread support

@danicarrion
danicarrion / export.conf.example
Created September 2, 2015 11:01
Export tables from CartoDB as CSV, the_geom being converted to latitude/longitude
[cartodb]
account_name=
api_key=
table_name=
columns=
[file]
name=