Skip to content

Instantly share code, notes, and snippets.

Avatar
😎

Salvatore Fiandaca pigreco

😎
View GitHub Profile
View toto.txt
with_variable('andy',
array_foreach( array_foreach(
generate_series(1,num_geometries(segments_to_lines($geometry))),
centroid(geometry_n(segments_to_lines($geometry),@element))),
distance(@element, overlay_nearest('roads',$geometry)[0])),
/*shortest line*/
shortest_line(
array_foreach(
generate_series(1, num_geometries( segments_to_lines($geometry))),
centroid(geometry_n(segments_to_lines($geometry),@element)))
View fill_down.csv
data nuts2 zona zona_fill
2020-11-09T17:00:00 ITF1
2020-11-10T17:00:00 ITF1 arancione arancione
2020-11-11T17:00:00 ITF1 arancione
2020-11-12T17:00:00 ITF1 arancione
2020-11-20T17:00:00 ITF1 arancione
2020-11-21T17:00:00 ITF1 arancione
2020-11-22T17:00:00 ITF1 rossa rossa
2020-11-23T17:00:00 ITF1 rossa
2020-11-24T17:00:00 ITF1 rossa
@pigreco
pigreco / qgis-utenti-telegram_prov.vrt
Created Mar 21, 2021
Utenti Gruppo Telegram QGIS province
View qgis-utenti-telegram_prov.vrt
<OGRVRTDataSource>
<OGRVRTLayer name="QGIS-USER-TELEGRAM-PROV">
<SrcDataSource relativeToVRT="0">CSV:/vsicurl/https://docs.google.com/spreadsheets/d/e/2PACX-1vTx6h-a7JI5eNt2VPe7qkSb90lGQPC67-oz-2iXqcW056p1Z0Kkqwmp7cQY-mM-YTtH_8KjZjgnk4f4/pub?gid=1931437420&amp;single=true&amp;output=csv</SrcDataSource>
<SrcLayer>pub?gid=1931437420&amp;single=true&amp;output=csv</SrcLayer>
<Field name="cod_prov" type="Integer" />
<Field name="provincia" type="String" />
<Field name="count provincia" type="Integer" />
</OGRVRTLayer>
</OGRVRTDataSource>
@pigreco
pigreco / qgis-utenti-telegram_reg.vrt
Created Mar 21, 2021
Utenti Gruppo Telegram QGIS per regione
View qgis-utenti-telegram_reg.vrt
<OGRVRTDataSource>
<OGRVRTLayer name="QGIS-USER-TELEGRAM-REG">
<SrcDataSource relativeToVRT="0">CSV:/vsicurl/https://docs.google.com/spreadsheets/d/e/2PACX-1vTx6h-a7JI5eNt2VPe7qkSb90lGQPC67-oz-2iXqcW056p1Z0Kkqwmp7cQY-mM-YTtH_8KjZjgnk4f4/pub?gid=1189600571&amp;single=true&amp;output=csv</SrcDataSource>
<SrcLayer>pub?gid=1189600571&amp;single=true&amp;output=csv</SrcLayer>
<Field name="cod_reg" type="Integer" />
<Field name="regione" type="String" />
<Field name="count cod_reg" type="Integer" />
<Field name="popolazione" type="Integer" />
<Field name="incidenza1M" type="Real" />
<Field name="NUT2" type="String" />
View province2021.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pigreco
pigreco / minimum_distance.txt
Created Mar 19, 2021
here is the expression used in the Default widget
View minimum_distance.txt
if (
distance(
overlay_nearest(
layer:='poligono',
expression:= $geometry )[0], $geometry) <
distance(
overlay_nearest(
layer:='linea',
expression:= $geometry )[0], $geometry),overlay_nearest(
layer:='poligono',
View progetto_vuoto_anonymize-true.qgs
<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
<qgis version="3.16.4-Hannover" projectname="">
<homePath path=""/>
<title></title>
<autotransaction active="0"/>
<evaluateDefaultValues active="0"/>
<trust active="0"/>
<projectCrs>
<spatialrefsys>
<wkt>GEOGCRS["WGS 84",DATUM["World Geodetic System 1984",ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["unknown"],AREA["World"],BBOX[-90,-180,90,180]],ID["EPSG",4326]]</wkt>
View utmzones_area.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View sigla_codice.csv
cod_rip COD_REG ITTER107 NUTS2 area cod_reg_prov cod_reg_prov_t Name den_reg_prov regione
1 1 ITC1 ITC1 PIE 1 01 Piemonte Piemonte Piemonte
1 2 ITC2 ITC2 VDA 2 02 Valle d'Aosta / Vallée d'Aoste Valle d'Aosta Valle d'Aosta
1 3 ITC4 ITC4 LOM 3 03 Lombardia Lombardia Lombardia
2 5 ITD3 ITH3 VEN 5 05 Veneto Veneto Veneto
2 6 ITD4 ITH4 FVG 6 06 Friuli-Venezia Giulia Friuli Venezia Giulia Friuli-Venezia Giulia
1 7 ITC3 ITC3 LIG 7 07 Liguria Liguria Liguria
2 8 ITD5 ITH5 EMR 8 08 Emilia-Romagna Emilia Romagna Emilia-Romagna
3 9 ITE1 ITI1 TOS 9 09 Toscana Toscana Toscana
3 10 ITE2 ITI2 UMB 10 10 Umbria Umbria Umbria
@pigreco
pigreco / puntiSomministrazioni-19.csv
Last active Jan 5, 2021
Punti di somministrazione Vaccino anti-Covid-19 - by shorturl.at/lwDFK
View puntiSomministrazioni-19.csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 10 should actually have 6 columns, instead of 3. in line 9.
struttura,indirizzo,latitude,longitude,comune,provincia
“S. Antonio Abate” di Trapani,"Via Cosenza, 82 – Erice – Casa Santa ,TP",38.028068,12.549695,Erice,Trapani
"A.O. per l'Emergenza ""Cannizzaro"" – Catania","Via Messina, 829",37.542032,15.119535,Catania,Catania
"A.O. Universitaria Policlinico di Catania ""S. Marco""","Via C. Azeglio Ciampi, Edificio C, Catania",37.480002,15.037397,Catania,Catania
A.O.O.R. Villa Sofia – Cervello P.O. CTO,Via Antonio Cassarà – 90146 PA,38.155272,13.337027,Palermo,Palermo
A.U.O.P. Palermo,"Via Del Vespro, 129 – 90127 PA",38.102125,13.361030,Palermo,Palermo
AUOP G. MARTINO,Via Consolare Valeria,38.165740,15.537661,Messina,Messina
DEA I LIVELLO RAGUSA (SIMT)\Giovanni Paolo II,"Piazza Igea 1 – RG , C/da Cisternazzi",36.905987,14.679675,Ragusa,Ragusa
IRCCS CENTRO NEUROLESI 2 – BONINO PULEJO – P.O. CASAZZA,"Strada Statale 113, 98123 Messina ME",38.206828,15.519750,Messina,Messina
IRCCS CENTRO NEUROLESI 2 – BONINO PULEJO – P.O. PIEMONTE,"Viale Europa, 45, 98124 Messina ME",38.1819