Skip to content

Instantly share code, notes, and snippets.

@luipir
luipir / rt_mapserver_exporter-Z15285.sld
Created January 7, 2014 18:44
SVG problem on SLD to MAP - applySLD mapscript method - SLD test file produced using rt_mapserver_exporte QGIS plugin
<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd" xmlns:se="http://www.opengis.net/se">
<NamedLayer>
<se:Name>formapuntuale</se:Name>
<UserStyle>
<se:Name>formapuntuale</se:Name>
<se:FeatureTypeStyle>
<se:Rule>
<se:Name>2020</se:Name>
<se:Description>
@luipir
luipir / rt_mapserver_exporter-local.sld
Created January 10, 2014 10:59
related to pull request: https://github.com/mapserver/mapserver/pull/4836 first file: sld generated by rt_mapserver_exporter qgis plugin second file: map file generated by rt_mapserver_exporter sld is esported by qgis to generate mapfile usign applySLD mapscript api
<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd" xmlns:se="http://www.opengis.net/se">
<NamedLayer>
<se:Name>formapuntuale</se:Name>
<UserStyle>
<se:Name>formapuntuale</se:Name>
<se:FeatureTypeStyle>
<se:Rule>
<se:Name>2020</se:Name>
<se:Description>
@luipir
luipir / gist:2cd9f01b1d2e881c9f479f55069600ce
Created May 11, 2016 13:20
qgis custom expression to check if feature is selected
"""
Template function file. Define new functions using @qgsfunction.
When using args="auto" you may define a new variable for each value for the function.
feature and parent must always be the last args.
To pass a any number of args into a function use args=-1 the first
variable will then be a list of values.
"""
from qgis.core import *
from qgis.gui import *
@luipir
luipir / ctest -V -R PyQgsDBManagerGpkg
Created November 10, 2017 16:04
Error eceuting test PyQgsDBManagerGpkg with qgis master 46ec158
16:46 $ ctest -V -R PyQgsDBManagerGpkg
UpdateCTestConfiguration from :/home/ginetto/PROGRAMMING/QGIS/QGIS-master/build/DartConfiguration.tcl
Parse Config file:/home/ginetto/PROGRAMMING/QGIS/QGIS-master/build/DartConfiguration.tcl
Add coverage exclude regular expressions.
Add coverage exclude: /CMakeFiles/CMakeTmp/
Add coverage exclude: .*/Testing/Utilities/.*
Add coverage exclude: .*/Utilities/.*
Add coverage exclude: .*/Code/Wrappers/SWIG/otbApplicationPYTHON_wrap.*
Add coverage exclude: .*/Code/Wrappers/SWIG/otbApplicationJAVA_wrap.*
SetCTestConfiguration:CMakeCommand:/usr/bin/cmake
@luipir
luipir / gdal_ecw.sh
Created April 16, 2019 10:43 — forked from 1papaya/gdal_ecw.sh
Install GDAL 2.3 with ECW support on Ubuntu 18.04
#!/bin/bash
##
## Tested on: Ubuntu 18.04 & ECW 5.4 & GDAL 2.3.1
##
## Download the ERDAS ECW JP2 SDK v5.4 Linux
## https://download.hexagongeospatial.com/downloads/ecw/erdas-ecw-jp2-sdk-v5-4-linux
## Download GDAL v2.3 Source (ex. 2.3.1)
@luipir
luipir / pure_python_and_gdal_metadata_parser.py
Last active August 29, 2019 15:21
Pure python and GDAL metadata extractor
from xml.etree import cElementTree as ElementTree
from osgeo import gdal
imgpath = '???????????<put the image path here>????????????'
###############################################
# XML to dict parsing code get from:
# https://stackoverflow.com/questions/2148119/how-to-convert-an-xml-string-to-a-dictionary
class XmlListConfig(list):
def __init__(self, aList):
@luipir
luipir / azure_uamqp_lock_token_error.log
Created September 20, 2019 09:30
uamqp debug messages about lock token nto trasmitetd in a specific azure queue
2019-09-20 11:21:26,122 uamqp.receiver INFO Received Link detach event: b'amqp:link:detach-forced'
Link: b'receiver-link-5cb0a0ba-bbab-411c-819f-110bbea40add'
Description: b"The link 'G26:34611229:receiver-link-5cb0a0ba-bbab-411c-819f-110bbea40add' is force detached by the broker due to errors occurred in consumer(link14926311). Detach origin: InnerMessageReceiver was closed. TrackingId:b6bf33280011000100e3c1e75d849a0c_G26_B8, SystemTracker:primare-desa-service-bus:Topic:primare_desa_topic_initplanification|proyestegal_initplanification_suscriber, Timestamp:2019-09-20T09:21:26"
Details: None
Retryable: True
Connection: b'SBReceiver-63f1aa5a-3d35-4049-95e8-47703b3a93aa'
2019-09-20 11:21:26,122 uamqp.c_uamqp DEBUG Deallocating cError
2019-09-20 11:21:26,123 uamqp.receiver INFO Message receiver b'receiver-link-5cb0a0ba-bbab-411c-819f-110bbea40add' state changed from <MessageReceiverState.Open: 2> to <MessageReceiverState.Error: 4> on connection: b'SBReceiver-63f1aa5a-3d35-4049-95e8-47703b3a93aa'
2019-
@luipir
luipir / camera_calculator.py
Last active February 29, 2024 16:45
Camera Footprint Calculator
"""
***************************************************************************
camera_calculator.py
---------------------
Date : August 2019
Copyright : (C) 2019 by Luigi Pirelli
Email : luipir at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *