Skip to content

Instantly share code, notes, and snippets.

View VictorVelarde's full-sized avatar
🚀

Víctor Velarde VictorVelarde

🚀
View GitHub Profile
@VictorVelarde
VictorVelarde / DescripcionCampos.py
Created August 28, 2014 10:35
ESRI - Mostrar descripción de campos de una tabla o entidad. ArcGIS 10.1
import arcpy
def pprint_fields(table):
""" pretty print table's fields and their properties """
def _print(l):
print("".join(["{:>12}".format(i) for i in l]))
atts = ['name', 'aliasName', 'type', 'baseName', 'domain',
'editable', 'isNullable', 'length', 'precision',
'required', 'scale',]
_print(atts)
for f in arcpy.ListFields(table):
@VictorVelarde
VictorVelarde / Puntos
Last active August 29, 2015 14:19
PyQGIS - Capa en memoria de PUNTOS (EPSG:4326 con ID)
'''
Capa en memoria de Puntos EPSG:4326 con ID
'''
#input: lista de (id, lon, lat)
puntos = [
(1, -5.3899, 36.12),
(2, -5.6096268, 35.9423065),
(3, -5.1701736, 36.2972908)
]
@VictorVelarde
VictorVelarde / gource
Last active August 29, 2015 14:21
UTILES - gource sobre repositorio SVN
D:\trunk>gource --max-files 400 -s 1 --user-image-dir D:\trunk\img -e 0.05 --user-scale 3.0
@VictorVelarde
VictorVelarde / Encuadres
Last active August 29, 2015 14:22
PyQGIS - Capa en memoria de ENCUADRES (EPSG:4326 con ID)
'''
Capa en memoria de Encuadres EPSG:4326 con ID
'''
#input: lista de (id, xmin, ymin, xmax, ymax)
encuadres = [
("1", -5.505, 35.89,-5.30,36.20),
("2", -5.4697, 36.03,-5.3101,36.21),
]
# proceso
@VictorVelarde
VictorVelarde / gdal2tiles
Last active October 15, 2015 11:46
Creación de TMS a partir de tif (niveles 1 a 6)
gdal2tiles -z "1-6" -v input.tif tms
@VictorVelarde
VictorVelarde / gist:9bb7fd6743ea34b3dccb
Last active October 19, 2015 17:02
Descomprimir teselas .mbtiles con mb-util
# Instalacion de mbutil con pip
cd C:\Python27\Scripts
pip install mbutil
# Generación de la cache de mapa (MBtiles) con TileMill
# Ejecución para descomprimir mbtiles (generados con TileMill):
python mb-util.py C:/Users/velardev/Documents/MapBox/export/fichero.mbtiles teselas --scheme=xyz
@VictorVelarde
VictorVelarde / D3 - Pirámide de graduados
Last active January 28, 2016 17:10
D3 - Pirámide de graduados
@VictorVelarde
VictorVelarde / Composite.png
Last active January 21, 2016 16:30
OpenLayers 3 - Imagen georreferenciada
Composite.png
@VictorVelarde
VictorVelarde / OpenLayers 3 - Terremotos recientes USGS
Last active January 24, 2016 14:37
OpenLayers 3 - Terremotos recientes USGS
@VictorVelarde
VictorVelarde / OpenLayers 3 - Sincronización con MarineTraffic
Last active November 27, 2023 07:56
OpenLayers 3 - Sincronización con MarineTraffic