Skip to content

Commit

Permalink
add 60esimo esempio
Browse files Browse the repository at this point in the history
  • Loading branch information
pigreco committed Nov 5, 2021
1 parent 5167bbf commit 289df4a
Show file tree
Hide file tree
Showing 5 changed files with 40 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 @@ -23,4 +23,5 @@ data | descrizione
14/10/2021 | aggiornata pagina Parlano di Noi
18/10/2021 | aggiunto corso di formazione avanzato
02/11/2021 | aggiunto [59esimo](esempi/geometria_vicina_filtro_condizionato.md) esempio
03/11/2021 | aggiornato pagina sitografia
03/11/2021 | aggiornato pagina sitografia
05/11/2021 | aggiunto [60esimo](esempi/atlas_righe_verticale.md) esempio
35 changes: 35 additions & 0 deletions docs/esempi/atlas_righe_verticale.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## Atlas con righe tabella attributi in verticale

Alcune volte nasce l'esigenza di stampare la tabella attributi di un atlante in verticale e non nel classico modo in orizzontale:

[![](../img/esempi/atlas_righe_verticali/img_01.png)](../img/esempi/atlas_righe_verticali/img_01.png)

Espressione da usare:

```python
replace()
replace(
replace (
map_to_hstore( attributes())
,'"',''),
'=>',' = '),
',','\n')
```

dove l'espressione che crea una struttura `a mappa` è:

```
map_to_hstore( attributes()) → '"cod_reg"=>"1","cod_rip"=>"1","den_reg"=>"Piemonte","fid"=>"…'
```

le funzioni `replace()` servono a modificare l'output, cioè a togliere i doppi apici, la freccia e aggiungere il vai a capo.

**NB:** I campi sono ordinati alfabeticamente!

---

Funzioni e variabili utilizzate:

* [replace](../gr_funzioni/stringhe_di_testo/stringhe_di_testo_unico.md#replace)
* [map_to_hstore](../gr_funzioni/maps/maps_unico.md#map_to_hstore)
* [attributes](../gr_funzioni/record_e_attributi/record_e_attributi_unico.md#attributes)
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 **59** esempi svolti! (in evoluzione)
Attualmente ci sono **60** esempi svolti! (in evoluzione)

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

Expand Down Expand Up @@ -78,6 +78,7 @@ nro|Esempio|Descrizione|Autore | Livello | funzioni utilizzate
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
59|[geometrie vicine ma con condizione](geometria_vicina_filtro_condizionato.md)|tracciare un segmento tra punti vicini che soddisfano la condizione `id1` <> `id2` |Salvatore Fiandaca | 4 | overlay_nearest, array_filter, attribute, make_line, collect_geometries, $geometry, geometry
60|[geometrie vicine ma con condizione](atlas_righe_verticale.md)|riga tabella attributi in verticale nel layout di stampa di un atlante |Salvatore Fiandaca | 3 | replace, map_to_hstore, attributes

## Partecipa

Expand Down
Binary file added docs/img/esempi/atlas_righe_verticali/img_01.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ nav:
- Ricercare caratteri speciali: esempi/ricerca_caratteri_speciali.md
- Confrontare campi tabella attributi: esempi/confrontare_campi_tabella.md
- Geometrie vicine con condizione: esempi/geometria_vicina_filtro_condizionato.md
- Atlante con righe tabella in verticale: esempi/atlas_righe_verticale.md
- Provaci tu: mettiti_alla_prova.md

- Corsi di Formazione:
Expand Down

0 comments on commit 289df4a

Please sign in to comment.