# Zone e repository Geodata
Il repository [`casavo/geodata`](https://github.com/casavo/geodata) è pensato per essere la source di tutte le info geografiche usate da vari attori in Casavo.
In particolare le informazioni sulle zone delle città sono prensenti in questo file sotto forma di file "GeoJson" e/o "NDJson"
> TODO aggiungere spiegazione su cosa sono i level e a cosa serve il level `casavo-listing`
## Get the Repo
Poichè nel repository `casavo/geodata` ci sono principalmente grossi file JSON o CSV, oltre a git è necessario il [tool dvc](https://dvc.org/doc/install) per poter interagire.
```console
$ gh repo clone casavo/geodata && cd geodata
$ export AWS_ACCESS_KEY_ID=xxx
$ export AWS_SECRET_ACCESS_KEY=yyy
$ dvc pull
A sources/it/cities/
A sources/pt/cities/
A sources/es/cities/
A geodata/
A sources/fr/cities/
5 files added and 707 files fetched
```
I valori dei secret xxx & yyy sono su [1Password](https://my.1password.com/vaults/all/allitems/5exvb4soeza55jhwgsxlcunvoy)
Eseguire per recupeare i
```
$ cp .evnrc.example .envrc
$ # put AWS credentials into .evnrc
$ make start
$ make unzip-geodata
```
## Reuse Existing Zone Level for "casavo-listing" level
* copy existing ndjson under `./sources/` to new file `casavo-listing.ndjson`
* run task convert/validate ndjson file `make convert-zones` -> outcome is GeoJson file under `./geodata/` directory
* zip & commit with dvc -> `make dvc-zip-commit`
* `dvc push`
* commit with changed `.dvc` files and `.doit.db` file
* push & go to master
## Release Zones on Sigismondo
* do a `casavo/geodata` release
* use this version number in hardcoded values `GEODATA_VERSION` in `casavo/sigismondo`
* deploy sigismondo in staging/production