Import Heat Vulnerability¶
Heat vulnerability
The script assumes that the vulnerability data is stored in a geopackage file located in the file_data/vulnerability
directory. This geopackage has been produced by Maurine Di Tommaso (Service Climat & Résilience – Direction Environnement, Écologie, Énergie).
A description of the approach can be found here : https://geoweb.grandlyon.com/portal/apps/storymaps/collections/7e7862ec92694601a7085074dcaf7481?item=3.
Command
¶
Bases: BaseCommand
Source code in back/iarbre_data/management/commands/import_vulnerability.py
handle(*args, **options)
¶
Load heat vulnerability data in the DB.
Source code in back/iarbre_data/management/commands/import_vulnerability.py
load_data()
¶
Open the geopackage for vulnerabilty.
Returns:
Type | Description |
---|---|
GeoDataFrame | geopandas.GeoDataFrame: The loaded geopackage as a GeoDataFrame. |
Raises:
Type | Description |
---|---|
FileNotFoundError | If no folder with "vulnerability" in the name is found or no .gpkg file is found in the folder. |
Source code in back/iarbre_data/management/commands/import_vulnerability.py
save_geometries(vulnerability_datas)
¶
Save vulnerability data to the database.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vulnerability_datas | GeoDataFrame | GeoDataFrame to save to the database. | required |
Returns:
Type | Description |
---|---|
None | None |