Skip to content

Instantly share code, notes, and snippets.

@fgianoli
fgianoli / boundary_distance.sql
Last active June 28, 2021 10:04
Codice utilizzato per il calcolo della distanza dei confini dalla rispettiva capitale
View boundary_distance.sql
DROP TABLE IF EXISTS sahel.boundaries;CREATE TABLE sahel.boundaries AS
WITH
confini AS (SELECT isocode iso2,ST_TRANSFORM(geom,4326) geom FROM sahel.confini_lineari),
capitali AS (SELECT iso_a2 iso2,geom FROM sahel.capital_sahel),
d100 AS (SELECT iso2,100 dis,ST_BUFFER(geom::geography,100000)::geometry geom FROM capitali a),
d3 AS (SELECT iso2,ST_BUFFER(geom::geography,300000)::geometry geom,300 dis FROM capitali a),
d6 AS (SELECT iso2,ST_BUFFER(geom::geography,600000)::geometry geom,600 dis FROM capitali a),
d9 AS (SELECT iso2,ST_BUFFER(geom::geography,900000)::geometry geom,900 dis FROM capitali a),
d12 AS (SELECT iso2,ST_BUFFER(geom::geography,1200000)::geometry geom,1200 dis FROM capitali a),
d18 AS (SELECT iso2,ST_BUFFER(geom::geography,1800000)::geometry geom,1800 dis FROM capitali a),
View PostgreSQL_PostGIS.md
@fgianoli
fgianoli / lizmap.md
Last active November 14, 2022 17:17
Installazione Lizmap
View lizmap.md

Installazione Lizmap

sudo su

install apache2

apt install apache2

ensure to have PHP installed and all required extensions:

View geoserver
------------------------------
INSTALL GEOSERVER UNDER TOMCAT 8
------------------------------
//Install JAVA 8 for Geoserver
apt install openjdk-8-jdk
//Install Tomcat8 https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-8-on-ubuntu-16-04
View copernicus_FG.py
from qgis.core import QgsProcessing
from qgis.core import QgsProcessingAlgorithm
from qgis.core import QgsProcessingMultiStepFeedback
from qgis.core import QgsProcessingParameterRasterLayer
from qgis.core import QgsProcessingParameterRasterDestination
from qgis.core import QgsCoordinateReferenceSystem
import processing
class Copernicus(QgsProcessingAlgorithm):
View gdal_warp.py
from processing.gui.wrappers import WidgetWrapper
from qgis.PyQt.QtWidgets import QDateEdit
from qgis.PyQt.QtCore import Qt, QCoreApplication, QDate
from qgis.core import QgsProcessing
from qgis.core import QgsProcessingAlgorithm
from qgis.core import QgsProcessingMultiStepFeedback
from qgis.core import QgsProcessingParameterFolderDestination
from qgis.core import QgsProcessingParameterFile
from qgis.core import QgsProcessingParameterRasterDestination, QgsProcessingParameterRasterLayer
View resample_rasterio.py
# coding: utf-8
import os
import rasterio
import rasterio.warp
import rasterio.features
from rasterio.enums import Resampling
from rasterio import Affine, MemoryFile
import time
View download_copernicus_translate.py
from processing.gui.wrappers import WidgetWrapper
from qgis.PyQt.QtWidgets import QDateEdit
from qgis.PyQt.QtCore import Qt, QCoreApplication, QDate
from qgis.core import QgsProcessing
from qgis.core import QgsProcessingAlgorithm
from qgis.core import QgsProcessingMultiStepFeedback
from qgis.core import QgsProcessingParameterFolderDestination
from qgis.core import QgsProcessingParameterFile
from qgis.core import QgsProcessingParameterRasterDestination, QgsProcessingParameterRasterLayer
View GeoNode_Ieraci
## Install dependencies
# Install packages from GeoNode core
sudo apt install -y gdal-bin
sudo apt install -y python3-pip python3-dev python3-virtualenv python3-venv virtualenvwrapper
sudo apt install -y libxml2 libxml2-dev gettext
sudo apt install -y libxslt1-dev libjpeg-dev libpng-dev libpq-dev libgdal-dev libgdal20
sudo apt install -y software-properties-common build-essential
sudo apt install -y git unzip gcc zlib1g-dev libgeos-dev libproj-dev
sudo apt install -y sqlite3 spatialite-bin libsqlite3-mod-spatialite
View WebGIS_Backend
------------------------
CONFIGURE SERVER FOR GIS
------------------------
sudo su
apt update
apt upgrade
apt install apache2
------------------------------