Skip to content

Instantly share code, notes, and snippets.

Avatar
🗺️
Mapping

Jorge Sanz jsanz

🗺️
Mapping
View GitHub Profile
@jsanz
jsanz / README.md
Last active Dec 5, 2019
Docker wrapper for OGR commands
View README.md

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 / fix-geometries.py
Created Oct 30, 2019
Python - QGIS - Fix geometries
View fix-geometries.py
"""
Small script to fix geometries of the first file argument
using the native QGIS processing algorithm. You may need
to adjust the path to you installation.
"""
import sys
sys.path.append('/usr/share/qgis/python/plugins')
from processing.core.Processing import Processing
@jsanz
jsanz / docker-compose.yml
Last active Oct 14, 2019
Docker Compose: Elastic Search/Kibana 7.4 cluster
View docker-compose.yml
# Minimal Docker Compose cluster for ElasticSearch and Kibana 7.4
# Put this file any folder creating "logs" and "esdata" folders
# to persist the cluster indices and kibana state
version: "3"
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.4.0
container_name: elasticsearch
ports:
@jsanz
jsanz / download-instagram.py
Created Jul 27, 2019
Python: Download Instagram pictures
View download-instagram.py
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
get_ipython().system('pip3 install -U InstagramApi')
# In[37]:
@jsanz
jsanz / README.md
Last active Apr 22, 2019
Python: word cloud of FOSS4G 2019 submissions
View README.md
@jsanz
jsanz / README.md
Last active Jun 28, 2019
Leaflet Geocoder with CARTO.js
View README.md

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>
@jsanz
jsanz / README.md
Last active Feb 7, 2019
CARTO VL + Airship + Vue component
View README.md

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 / index.html
Last active Jun 17, 2019
CARTO VL - Basemap Switcher
View index.html
<!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 / index.html
Last active Jan 2, 2019
CARTO VL: Selection by polygon
View index.html
<!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 Dec 5, 2018
CARTO VL - Table Widget example
View index.html
<!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>
You can’t perform that action at this time.