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 / .gitignore
Last active September 27, 2021 17:59
FOSS4G 2021 - PostGIS versioning workshop
data
.env
@jsanz
jsanz / README.md
Last active August 25, 2021 06:18
CARTO VL + Airship + Vue component

Minimal example on how to wrap Airship components as a Vue ones and then use them on a CARTO VL visualization. This just outlines the procedure explained in the Airship + Vue guide.

On this minimal example a layer switcher component is used to handle the UI so it only knows about its state, and then emits input methods to the parent Vue instance to allow mapping the boolean property of the sweitcher and then react to changes on it on the layer.

A range slider is used twice (to show component reusability) to allow filtering the visualization by a couple of fields.

Check also how the isLayerVisible computed variable is used for conditional rendering of several classes and widgets disable.

@jsanz
jsanz / receta-pasta-anis.md
Last active July 24, 2021 09:23
Receta navidad

Receta para pasta de anís

Esta receta sirve para hacer cocas finas, rollos de anís y pastelitos de boniato.

Ingredientes

  • 1kg de harina
  • 4 vasos de cortado de aceite
@jsanz
jsanz / README.md
Created June 4, 2021 13:59
[SPARQL] Country websites ping

Ping sites

This is a CSV with country official websites from all the world, and a simple script that randomly access to five of them every five seconds. The objective of this is to hit as many different country IP's as possible.

The CSV is obtained from this SPARQL query to Wikidata:

SELECT 
  ?idLabel 
 (SAMPLE(?website) as ?web) 
@jsanz
jsanz / blablacar.ipynb
Created March 13, 2018 16:27
Python: Get data from BlaBlaCar API
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jsanz
jsanz / mbtiles_delete_zoom_level.sql
Created April 22, 2021 15:04 — forked from zhm/mbtiles_delete_zoom_level.sql
Delete zoom levels from an MBTiles file (set max zoom)
-- change 18 to whatever the max zoom level you want in your MBTiles
DELETE FROM images WHERE
tile_id IN (SELECT tile_id FROM map WHERE zoom_level > 18) AND
tile_id NOT IN (SELECT tile_id FROM map WHERE zoom_level <= 18);
DELETE FROM map WHERE zoom_level > 18;
UPDATE metadata SET value = '18' WHERE name = 'maxzoom';
@jsanz
jsanz / README.md
Last active December 5, 2019 08:45
Docker wrapper for OGR commands

Simple wrappers around docker and OGR commands to expose ogr2ogr and ogrinfo using the latest builds. You need to be careful to always put absolute paths to your local data so the docker image can access it.

@jsanz
jsanz / numbers.scala
Created October 30, 2012 22:10
Scala collections: mapping letters example
package week6
import scala.io.Source
object collections {
/* read a file of words */
val in = Source.fromURL("http://lamp.epfl.ch/files/content/sites/lamp/files/teaching/progfun/linuxwords.txt")
/* create a list and filter all words where *all* their characters are not letters (like dashes) */
val words = in.getLines.toList filter (word => word forall (chr => chr.isLetter))
@jsanz
jsanz / README.md
Last active November 11, 2019 13:20
OSGeo Charter Members

OSGeo Charter Members data

Check the viz.

What is this repository for?

This is a simple exercise to learn D3 basics using a data set I have at hand, the charter members of the Open Source Geospatial Foundation OSGeo.

@jsanz
jsanz / README.md
Last active June 28, 2019 12:27
Leaflet Geocoder with CARTO.js

Just a minimal CARTO.js example with the defalut Leaflet Control Geocoder.

Simply add the JS and CSS imports

<!-- Geocoder-->
<link rel="stylesheet" href="https://unpkg.com/leaflet-control-geocoder/dist/Control.Geocoder.css" />
<script src="https://unpkg.com/leaflet-control-geocoder/dist/Control.Geocoder.js"></script>