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 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

@jsanz
jsanz / query.sql
Created September 5, 2016 18:24
SQL: Draw max circles that cross the date line
/*
All the details on how this work here, all credit to PRamsey :-)
https://carto.com/blog/jets-and-datelines/
*/
with
-- data preparation you need rows with origin and destination
-- and any number of associated data
pairs as (
@jsanz
jsanz / query.sql
Created September 5, 2016 09:12
SQL: Stacking Chips
WITH
data as (
SELECT
cartodb_id,
ST_SnapToGrid(the_geom,.5) as the_geom
FROM team
),
m AS (
SELECT array_agg(cartodb_id) id_list, the_geom, ST_Y(the_geom) y
FROM data
@jsanz
jsanz / ovafix.md
Last active January 10, 2019 14:03
Making a OVA file compatible with VMWare

This is a recipe to fix this error when importing to VMWare an OVA file:

Download and install OVFTool (https://www.vmware.com/support/developer/ovf/)

Convert OVA to VMX using the command below (this will create example.vmx)

$ ovftool example.ova example.vmx
@jsanz
jsanz / README.md
Last active May 17, 2018 13:53
Geocode with Mapzen search and Google Spreadsheets

How to set up a quick geocoding system on google spreadsheets.

  1. Create a new spreadsheet
  2. Open the Scripts editor and paste the script attached
  3. Use on your spreadsheet this new formula
=searchMapzen(place_cell,mapzen_api_key)

@jsanz
jsanz / app.js
Last active November 6, 2017 10:08 — forked from rochoa/app.js
Basic CARTO viewer
'use strict';
var DEFAULTS = {
endpoint: 'http://jsanz.cartodb.com/api/v1/map',
sql: 'select * from ne_10m_populated_places_simple',
cartocss: [
"#layer['mapnik::geometry_type'=1] {",
" marker-width: 7;",
" marker-fill: #EE4D5A;",
" marker-fill-opacity: 0.9;",
@jsanz
jsanz / template.js
Last active September 14, 2016 09:00
API: Named Maps minimal template
{
"auth": {
"method": "open"
},
"version": "0.0.1",
"name": "test_literal",
"placeholders": {
"color": {
"type": "css_color",
"default": "red"
@jsanz
jsanz / README.md
Last active September 14, 2016 09:00
JavaScript: CartoDB in Bing SDK

Using CartoDB tiles and features inside a simple Bing Maps application

@jsanz
jsanz / README.md
Last active September 14, 2016 09:00
JavaScript: Bing on CartoDB

Testing Bing basemaps with Leaflet/CartoDB

@jsanz
jsanz / README.md
Last active September 14, 2016 08:59
SQL: Routing with CartoDB

Using new CartoDB routing functions, take a scheduled route table made of straight lines with a rough plan for a route and convert it in a detailed route using the shortest path on a car.

Check the viz