Skip to content

Instantly share code, notes, and snippets.

View benizar's full-sized avatar

Benito Zaragozí benizar

View GitHub Profile
@benizar
benizar / IDcardswithQRcodes.tex
Last active December 24, 2015 20:49
This TeX code generates a series of ID cards with QR codes for your conference assistants. You will need to add your own background image (fondoTarjeta).
\documentclass[a4paper,12pt]{article}
\usepackage[english,spanish]{babel}
\usepackage[utf8]{inputenc}
%Load layout and data packages
\usepackage{fullpage}
\usepackage{filecontents}
\usepackage{csvtools}
\usepackage{eso-pic}
\usepackage{graphicx}
@benizar
benizar / MyGeometricShapeFactory.cs
Last active December 25, 2015 06:29
This class creates simple-shape spatial tesellations such as rectangles, triangles and hexagons for GIS applications. Use this class in combination with the "MyGeometryShapeFactory". Want more info? Check gisandchips.org: http://www.gisandchips.org/2012/11/21/crear-teselaciones-repitiendo-formas-hasta-decir-%C2%A1basta/
//MyGeometricShapeFactory class for creating tessellations.
//Copyright (C) 2012 Benito M. Zaragozi­
//Authors: Benito M. Zaragozi­ (www.gisandchips.org)
//Send comments and suggestions to benito.zaragozi@ua.es
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//
@benizar
benizar / GraticuleBuilder.cs
Last active December 25, 2015 06:29
This class creates simple-shape spatial tesellations such as rectangles, triangles and hexagons for GIS applications. Use this class in combination with the "GraticuleBuilder" class. Want more info? Check gisandchips.org: http://www.gisandchips.org/2012/11/21/crear-teselaciones-repitiendo-formas-hasta-decir-%C2%A1basta/
//GraticuleBuilder class for creating tessellations.
//Copyright (C) 2012 Benito M. Zaragozi
//Authors: Benito M. Zaragozi­ (www.gisandchips.org)
//Send comments and suggestions to benito.zaragozi@ua.es
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
@benizar
benizar / G&C_businessCard_front.tex
Created October 11, 2013 10:40
This template is composed by three .tex files (businessCard.tex, businessCard_back.tex and businessCardx10.tex) for preparing a basic layout. Want more info? Visit our www.gisandchips.org blog (http://www.gisandchips.org/2011/11/06/business-card-de-gischips-en-latex-3/)
% GIS&Chips nice business card
% By Benito M. Zaragozí
% Version 0.1 released 02/11/2011
% Further releases in: www.gisandchips.org
% This template is composed by three .tex files (businessCard.tex, businessCard_back.tex and businessCardx10.tex) for preparing a basic layout.
\documentclass{beamer}
\usepackage[utf8x]{inputenc}
\usepackage[spanish]{babel}
\usepackage{hyperref}
@benizar
benizar / G&C_businessCard_back.tex
Last active December 25, 2015 06:29
This template is composed by three .tex files (businessCard.tex, businessCard_back.tex and businessCardx10.tex) for preparing a basic layout. Want more info? Visit our www.gisandchips.org blog (http://www.gisandchips.org/2011/11/06/business-card-de-gischips-en-latex-3/)
% GIS&Chips nice business card
% By Benito M. Zaragozí
% Version 0.1 released 02/11/2011
% Further releases in: www.gisandchips.org
% This template is composed by three .tex files (businessCard.tex, businessCard_back.tex and businessCardx10.tex) for preparing a basic layout.
\documentclass{beamer}
\usepackage[utf8x]{inputenc}
\usepackage[spanish]{babel}
\usepackage{geometry}
@benizar
benizar / G&C_businessCard_x12.tex
Last active December 25, 2015 06:29
This template is composed by three .tex files (businessCard.tex, businessCard_back.tex and businessCardx10.tex) for preparing a basic layout. Want more info? Visit our www.gisandchips.org blog (http://www.gisandchips.org/2011/11/06/business-card-de-gischips-en-latex-3/)
% GIS&Chips nice business card
% By Benito M. Zaragozí
% Version 0.1 released 02/11/2011
% Further releases in: www.gisandchips.org
% This template is composed by three .tex files (businessCard.tex, businessCard_back.tex and businessCardx10.tex) for preparing a basic layout.
\documentclass[10pt,a4paper]{minimal}
\usepackage{graphicx}
\usepackage[margin=1cm]{geometry}
@benizar
benizar / R_SAGA_GIS_example.R
Created October 11, 2013 10:50
This is a very basic example for using SAGA GIS from the R console. Load a polygon shapefile and a raster file and then split the raster into parts. Want more info? Visit our www.gisandchips.org blog (http://www.gisandchips.org/2011/01/13/usando-rsaga-para-procesar-un-raster-grande-por-partes/#more-1692)
## Abrimos la consola de R y cargamos la librería
library(RSAGA)
## Seleccionamos el fichero raster que queremos trocear y una capa vectorial que queramos usar como límites. También especificamos el directorio donde van los outputs. Para trabajar con Windows recomiendo rutas sin espacios.
raster<- file.choose()
poligonos<- file.choose()
directorio <-choose.dir()
## Consultamos hasta encontrar la herramienta que nos separa un shapefile en varios, obteniendo un shapefile por cada polígono, o lo que quisiéramos. Por ejemplo:
## rsaga.get.modules("shapes_grid")
@benizar
benizar / _plr_clasif_textural_usage.sql
Created October 11, 2013 11:03
This code creates a pl/R function for creating texture triangles directly from a PostgreSQL database.This example is composed by three pl/R files (_plr_clasif_textural_usage.sql, _plr_clasif_textural.sql and _plr_clasif_textural.R). This code is quite old and it would look better using the "The Soil Texture Wizard" package. Want more info? Visit…
SELECT _plr_clasif_textural ( 'arenas' , 'limos' , 'arcilla' , 'submuestra' , 'simbolo' , 'etiquetas') ;
@benizar
benizar / _plr_clasif_textural.sql
Created October 11, 2013 11:05
This code creates a pl/R function for creating texture triangles directly from a PostgreSQL database.This example is composed by three pl/R files (_plr_clasif_textural_usage.sql, _plr_clasif_textural.sql and _plr_clasif_textural.R). This code is quite old and it would look better using the "The Soil Texture Wizard" package. Want more info? Visit…
-- Function: _plr_clasif_textural(text, text, text, text, text, text)
-- DROP FUNCTION _plr_clasif_textural(text, text, text, text, text, text);
CREATE OR REPLACE FUNCTION _plr_clasif_textural(text, text, text, text, text, text)
RETURNS text AS
$BODY$
--
--Put the R code here
--
@benizar
benizar / _plr_clasif_textural.R
Created October 11, 2013 11:06
This code creates a pl/R function for creating texture triangles directly from a PostgreSQL database.This example is composed by three pl/R files (_plr_clasif_textural_usage.sql, _plr_clasif_textural.sql and _plr_clasif_textural.R). This code is quite old and it would look better using the "The Soil Texture Wizard" package. Want more info? Visit…
# Cargamos las librerias necesarias
library(Cairo)
library(plotrix)
# Definimos la funcion
clasif.textural = function (soiltexture = NULL, at = seq(0.1, 0.9, by = 0.1),
axis.labels = c("% arena (entre 0,05 y 2 mm)", "% limo (entre 0,05 y 0,002 mm)", "% arcilla (menor de 0,002 mm)"),
tick.labels = list(l = seq(10, 90, by = 10), r = seq(10,
90, by = 10), b = seq(10, 90, by = 10)), show.names = TRUE,
show.lines = TRUE, col.names = "black", bg.names = par("bg"),
show.grid = TRUE, col.axis = "black", col.lines = "black",