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 / index.html
Last active June 17, 2019 09:19
CARTO VL - Basemap Switcher
<!DOCTYPE html>
<html lang="en">
<head>
<title>CARTO VL: Switch the basemap</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="shortcut icon" href="https://carto.com/favicon.ico">
@jsanz
jsanz / pgdump+copy.md
Last active April 24, 2019 18:14
CARTO new COPY endpoint & ogr2ogr

These are the steps to test the new CARTO COPY endpoint (more details here and here.

  1. Downloaded a Brooklyn PLUTO shapefile from here as a data testing example.
  2. Generated a 1 row dataset to upload to CARTO the definition of the shapefile
  3. Uploaded it to CARTO using normal Import API (with a client I have for convenience)
  4. Removed the row
  5. Converted the original shapefile into a PGDump file
  6. Generated the COPY command using the third line of bkmappluto.txt
  7. Removed first 4 and last 2 lines of the resulting $file.
  8. Encoding the COPY command to be used on a URL, I run curl command to upload the dataset
@jsanz
jsanz / README.md
Last active April 22, 2019 16:57
Python: word cloud of FOSS4G 2019 submissions
@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 / index.html
Last active January 2, 2019 16:51
CARTO VL: Selection by polygon
<!DOCTYPE html>
<html lang="en">
<head>
<title>CARTO VL: Selection by polygon example</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="shortcut icon" href="https://carto.com/favicon.ico">
@jsanz
jsanz / index.html
Last active December 5, 2018 13:13
CARTO VL - Table Widget example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v1.0.3/airship.css">
<script src="https://libs.cartocdn.com/airship-components/v1.0.3/airship.js"></script>
<script src="https://libs.cartocdn.com/carto-vl/v1.0.0/carto-vl.min.js"></script>
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.js"></script>
@jsanz
jsanz / .gitignore
Last active December 3, 2018 15:52
Python: Download all the maps from your account
*.carto
@jsanz
jsanz / README.md
Last active November 19, 2018 09:33
14.000km to Dubai

14.0000km to Dubai

This SQL is an experiment to play with Postgis ST_LineInterpolatePoint function and other SQL tricks to generate a points dataset that travels from a starting point in Dubai to several cities all over the world and under a distance similar the coverage of a long distance flight (between 14 an 15 thousand kilometres).

This SQL is the main part of this CartoDB Visualization.

1000km to Dubai

The SQL is separated in several dataset constructions using the WITHclause so the approach is:

@jsanz
jsanz / index.html
Last active August 14, 2018 15:02 — forked from padawannn/index.html
HaCkARTO.js · Javier Aragón submission
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CARTO.js App</title>
<link href="https://fonts.googleapis.com/css?family=Fira+Sans:200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet">
<!-- Include Leaflet 1.2.0 Library -->
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.2.0/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.2.0/dist/leaflet.js"></script>
<!-- Include cartodb.js Library -->
@jsanz
jsanz / app.css
Created August 14, 2018 14:38 — forked from jorgesancha/app.css
This file has been truncated, but you can view the full file.
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
a {
text-decoration: none;
color: #4285F4;
}
.map {