C03 Import Data¶
Save all land occupancy data to the database.
Command ¶
Bases: BaseCommand
Source code in back/iarbre_data/management/commands/c03_import_data.py
handle(*args, **options) ¶
Save all land occupancy data to the database.
Source code in back/iarbre_data/management/commands/c03_import_data.py
download_cerema(url) ¶
Download Friches from CEREMA API.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url | str | URL to download data from | required |
Returns:
| Name | Type | Description |
|---|---|---|
gdf | GeoDataFrame | GeoDataFrame with data from URL |
Source code in back/iarbre_data/management/commands/c03_import_data.py
download_dbtopo(url) ¶
Download Batiments from IGN BD TOPO V3.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url | str | URL to download data from | required |
Returns:
| Name | Type | Description |
|---|---|---|
gdf | GeoDataFrame | GeoDataFrame with data from URL |
Source code in back/iarbre_data/management/commands/c03_import_data.py
download_from_url(url, layer_name) ¶
Download data from a URL.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url | str | URL to download data from | required |
layer_name | str | Name of the layer to download | required |
Returns:
| Name | Type | Description |
|---|---|---|
gdf | GeoDataFrame | GeoDataFrame with data from URL |
Source code in back/iarbre_data/management/commands/c03_import_data.py
read_data(data_config) ¶
Read data from a file or URL and return a GeoDataFrame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_config | dict | Contains either URL of the data or path to the file. | required |
Returns:
| Name | Type | Description |
|---|---|---|
df | GeoDataFrame | Use TARGET_PROJ and null and not valid geometry are removed. |