Skip to content

Instantly share code, notes, and snippets.

"""Calculate building floors from the Spanish Cadastre GIS files (SHP).
Once logged, data can be downloaded from https://www.sedecatastro.gob.es/
and the data specification is at
http://www.catastro.minhap.gob.es/ayuda/manual_descriptivo_shapefile.pdf
This python script is to be used in the QGIS 2.x field calculator.
The "CONSTRU" field stores volumetric data and other attributes in the form
of a structured text code. Floor numbers are in roman numerals.
As for example, "-II+IV+TZA" is a building part with two underground floors,
@oscarfonts
oscarfonts / .block
Last active December 4, 2017 13:41
Ejemplo WMTS en OpenLayers
license: mit
@oscarfonts
oscarfonts / .block
Last active December 4, 2017 13:40
Ejemplo TMS en Leaflet
license: mit
@oscarfonts
oscarfonts / docker_ce_install.sh
Created June 15, 2017 10:04
Install docker ce in Ubuntu 16.04
sudo apt update
sudo apt install linux-image-extra-$(uname -r) linux-image-extra-virtual
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt update
sudo apt install docker-ce
sudo groupadd docker
sudo usermod -aG docker $USER
sudo systemctl enable docker
docker run hello-world
@oscarfonts
oscarfonts / index.html
Last active February 8, 2017 18:29
iecolab
<html>
<head>
<title>Map Widget Example</title>
<script src="http://sensors.fonts.cat/js/SensorWidgets.js"></script>
<script>
SensorWidget('map', {
"service": "http://wsncentral.iecolab.es/observations/service",
"offering": "offering:http://wsncentral.iecolab.es/observations/procedure/sensirion/TemperatureandHumidityProbe/noSerialNumberDeclared/0EAD0000000001DX/observations",
"title": "Temperatura Bosque de los Sentidos",
"features": [
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@oscarfonts
oscarfonts / index.html
Last active September 23, 2016 08:43
Barcelona Airport T1 - Floor plants
<!DOCTYPE html>
<html>
<head>
<title>Barcelona Airport T1 - Floor plants</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.css" />
<style type="text/css">
html, body, #map {
margin: 0;
@oscarfonts
oscarfonts / epsg.properties
Last active September 1, 2016 11:23
Projecció Barcelona
8080=PROJCS["Barcelona Eixample", \
GEOGCS["ETRS89", \
DATUM["European Terrestrial Reference System 1989", \
SPHEROID["GRS 1980", 6378137.0, 298.257222101, AUTHORITY["EPSG","7019"]], \
TOWGS84[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], \
AUTHORITY["EPSG","6258"]], \
PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], \
UNIT["degree", 0.017453292519943295], \
AXIS["Geodetic longitude", EAST], \
AXIS["Geodetic latitude", NORTH], \
@oscarfonts
oscarfonts / hamster2toggl.sql
Created October 28, 2015 14:43
SQL query to export Hamster database to toggl time tracker
select
"user@example.com" as 'Email',
date(facts.start_time) as 'Start date',
time(facts.start_time) as 'Start time',
strftime('%H:%M:%S', strftime('%s',facts.end_time) - strftime('%s',facts.start_time), 'unixepoch') as 'Duration',
categories.name as 'Project',
activities.name as 'Description'
from
facts, categories, activities
where
@oscarfonts
oscarfonts / layers.schema.json
Last active October 8, 2015 15:49
UNREDD Portal - Schema proposal for layers.json
{
"$schema":"http://json-schema.org/draft-04/schema#",
"definitions":{
"wmsLayer-base":{
"type":"object",
"properties":{
"id":{
"type":"string"
},
"type":{