Skip to content

Commit

Permalink
add 58esimo esempio
Browse files Browse the repository at this point in the history
  • Loading branch information
pigreco committed Oct 13, 2021
1 parent ca3faf2 commit bc52986
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ data | descrizione
27/09/2021 | aggiornata sezione autore con workshop al FOSS4G-IT 2021
01/10/2021 | aggiunto [57esimo](esempi/confrontare_campi_tabella.md) esempio
04/010/2021| aggiunta colonna Versione nella sezione contributors
12/010/2021| aggiornata pagina sitografia
12/010/2021| aggiornata pagina sitografia
13/10/2021 | aggiunto [58esimo](esempi/estrarre_campo_hstore.md) esempio
20 changes: 20 additions & 0 deletions docs/esempi/estrarre_campo_hstore.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Estrarre un campo da un attributo HStore

Il formato HStore è molto usato nel database OpenStreetMap, leggi [qui](https://pigrecoinfinito.com/2021/10/12/qgis-e-il-formato-hstore/).

In questo esempio estrarremo dall'attributo `other_tags` il valore della chiave `population`, il dataset è [qui](https://download.geofabrik.de/europe/italy/isole.html)

[![](https://pigrecoinfinito.files.wordpress.com/2021/10/image-14.png)](https://pigrecoinfinito.files.wordpress.com/2021/10/image-14.png)

espressione utilizzata:

```
to_int(
map_get(
hstore_to_map("other_tags"),'population')
)
```

## provaci tu

[download isole](https://download.geofabrik.de/europe/italy/isole.html)
3 changes: 2 additions & 1 deletion docs/esempi/lista_esempi.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ social_image: img/card_social/hfc_lista_esempi.png

---

Attualmente ci sono **57** esempi svolti! (in evoluzione)
Attualmente ci sono **58** esempi svolti! (in evoluzione)

... e **50** esempi da svolgere: [mettiti alla prova](../mettiti_alla_prova.md)

Expand Down Expand Up @@ -76,6 +76,7 @@ nro|Esempio|Descrizione|Autore | Livello | funzioni utilizzate
55|[Nome del campo con massimo valore](maxValoreCampoNome.md)|Determina il nome del campo che contiene il valore massimo su un record |Salvatore Fiandaca | 4 | @with_variable, hstore_to_map, array_max, array_find, attributes, map_delete, map_avals, map_akeys
56|[Ricerca caratteri speciali](ricerca_caratteri_speciali.md)|Ricerca e selezione di record con campi che contengono caratteri speciali |Salvatore Fiandaca | 3 | regexp_substr, <>
57|[confrontare campi tabella](confrontare_campi_tabella.md)|Ricercare valori uguali in due campi diversi |Salvatore Fiandaca | 3 | array_to_string, array_majority, array_cat, string_to_array
58|[estrarre campo da un hstore](estrarre_campo_hstore.md)|Aggiungere un campo a partire da un altro campo in formato hstore (tipico di OSM) |Salvatore Fiandaca | 3 | hstore_to_map, map_get, to_int

## Partecipa

Expand Down

0 comments on commit bc52986

Please sign in to comment.