Skip to content

Instantly share code, notes, and snippets.

View nachouve's full-sized avatar

Nacho Varela nachouve

  • GeoFreelance
  • Galicia, Spain
View GitHub Profile
@nachouve
nachouve / summarize_git_log.py
Last active May 15, 2023 08:16
Git Log Parser - Parse and summarize the output of a `git log --name-status`` command.
"""
Git Log Parser - Version 0.1
Parse and summarize the output of a `git log --name-status`` command.
Extract information about commits, authors, and file modifications,
and then summarizing this information in tables that show the number of commits,
files updated, and lines modified by author and by date.
The code uses classes to represent commits and file modifications,
and functions to parse the output of the git log command and summarize the data.
@nachouve
nachouve / qgis_script_to_enumerate_elements_by_xy.py
Created March 7, 2018 11:39
QGIS python script to update a field with a autoincrement value using an xy order of features.
##
# QGIS python script to update a field with a autoincrement value using an xy order of features.
# Created at: March 2018
import operator
# Attribute field to update
FIELD_TO_AUTOINCREMENT = 'id'
START_AT = 1 #0
@nachouve
nachouve / gist:c59a85e04e8f234c5152
Last active August 29, 2015 14:19
Using cURL to test WFS with filter as a file
== request.txt (with no spaces,returns,etc.) ==
<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.0.0" maxFeatures="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd"> <wfs:Query typeName="Viticola_Viticola_SIXPAC14_WFS:Recintos_2014" xmlns:Viticola_Viticola_SIXPAC14_WFS="http://idegintranet.xunta.es/arcgis/services/Viticola/Viticola_SIXPAC14_WFS/MapServer/WFSServer"> <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"> <ogc:And> <ogc:PropertyIsEqualTo> <ogc:PropertyName>provincia</ogc:PropertyName> <ogc:Literal>32</ogc:Literal> </ogc:PropertyIsEqualTo> <ogc:PropertyIsEqualTo> <ogc:PropertyName>municipio</ogc:PropertyName> <ogc:Literal>039</ogc:Literal> </ogc:PropertyIsEqualTo> <ogc:PropertyIsEqualTo> <ogc:PropertyName>poligono</ogc:PropertyName> <ogc:Literal>004</ogc:Literal> </ogc:PropertyIsEqualTo> <ogc:PropertyIsEqualTo> <ogc:PropertyName>parcela</ogc:PropertyName>
@nachouve
nachouve / webscrapper_find_text.py
Created April 7, 2015 07:24
WebScrapper to find a text in a URL response
# Usage:
# python webscrapper_find_text.py
#
# A useful way to execute this script could be:
#
# while true ; do
# python webscrapper_find_text.py ;
# sleep 30;
# done
@nachouve
nachouve / simple_web_service.sh
Created February 28, 2014 13:59
Simple script to check web services/pages with request each 'SLEEP_TIME' seconds.
#!/bin/bash
# Very simple script to check web services/pages with request each 'SLEEP_TIME' seconds.
# It is useful for health checks of OGC services.
#
# IMPORTANT: You must configure the RESPONSE_CHARS_NUM_EXPECTED used to compare with the real response.
#
# It has a infinite loop.
# Recomended redirect output to a file.
#
@nachouve
nachouve / fabfile.py
Last active December 18, 2015 00:29 — forked from rburhum/fabfile.py
Fabric script to compile GDAL with ESRI FileGDB and python support.
"""
Compile GDAL with ESRI FileGDB and python support.
Requirements: python-dev
"""
from fabric.api import *
from fabric.contrib.console import confirm
import tempfile
import re
@nachouve
nachouve / mapproxy.yaml
Created March 29, 2012 09:20 — forked from jsanz/mapproxy.yaml
Simple proxying of the Spanish PNOA service to get a WMS from their TMS
services:
demo:
kml:
tms:
wmts:
wms:
srs: ['EPSG:900913', 'EPSG:4258']
image_formats: ['image/jpeg', 'image/png']
md:
title: PNOA MapProxy