diff --git a/Taches_Artif_BDTopo/TACHE_URBAINE LITTORALE.ipynb b/Taches_Artif_BDTopo/TACHE_URBAINE LITTORALE.ipynb new file mode 100644 index 0000000..26515e6 --- /dev/null +++ b/Taches_Artif_BDTopo/TACHE_URBAINE LITTORALE.ipynb @@ -0,0 +1,1749 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## L'artificialisation du littoral d'après la BD Topo" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "*Denis Vannier - Le Plan Studio - 2024 - https://leplan.studio/ - https://github.com/Denis-Vannier*" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Source : IGN, BD Topo : https://geoservices.ign.fr/bdtopo" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "pd.set_option(\"display.max_columns\", None)\n", + "#pd.set_option(\"display.max_rows\", None)\n", + "pd.set_option('display.float_format', lambda x: '%.9f' % x)\n", + "import requests\n", + "import datetime\n", + "import matplotlib.pyplot as plt\n", + "import geopandas as gpd\n", + "import mapclassify\n", + "import os\n", + "import numpy as np\n", + "import shapely\n", + "from shapely.geometry import Polygon, Point\n", + "from shapely.validation import make_valid\n" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "RangeIndex: 1994 entries, 0 to 1993\n", + "Data columns (total 8 columns):\n", + " # Column Non-Null Count Dtype \n", + "--- ------ -------------- ----- \n", + " 0 BANDE_LITT 1994 non-null object \n", + " 1 INSEE_COM 1994 non-null object \n", + " 2 NOM 1994 non-null object \n", + " 3 SIREN_EPCI 1994 non-null object \n", + " 4 NOM_EPCI 1984 non-null object \n", + " 5 numdep 1994 non-null object \n", + " 6 SURFACE_M2 1994 non-null float64 \n", + " 7 geometry 1994 non-null geometry\n", + "dtypes: float64(1), geometry(1), object(6)\n", + "memory usage: 124.8+ KB\n" + ] + } + ], + "source": [ + "# Chargement des polygones des bandes littorales :\n", + "Bande10kmComLitt=gpd.read_file(\"BANDE_LITTORALE/BANDE_LITTORALE_SECTEURS_COM_BZH.shp\")\n", + "Bande10kmComLitt=Bande10kmComLitt.to_crs(\"EPSG:2154\")\n", + "Bande10kmComLitt[\"INSEE_COM\"]=Bande10kmComLitt[\"INSEE_COM\"].astype(\"str\")\n", + "ComLitt=Bande10kmComLitt[\"INSEE_COM\"].tolist()\n", + "Bande10kmComLitt_dissolve=Bande10kmComLitt[[\"geometry\"]]\n", + "Bande10kmComLitt_dissolve=Bande10kmComLitt_dissolve.dissolve()\n", + "Bande10kmComLitt.info()" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Création de la couche artificialisée à partir des bâtiments et des voies de communication" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 2014" + ] + }, + { + "cell_type": "code", + "execution_count": 58, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/Users/denisvannier/opt/anaconda3/envs/GEODATA2/lib/python3.9/site-packages/geopandas/geodataframe.py:1819: SettingWithCopyWarning: \n", + "A value is trying to be set on a copy of a slice from a DataFrame.\n", + "Try using .loc[row_indexer,col_indexer] = value instead\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + " super().__setitem__(key, value)\n", + "/var/folders/zf/sc5qjn6x54b02sbxg3k9jbkr0000gn/T/ipykernel_37896/4281919854.py:88: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.\n", + "The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.\n", + "\n", + "For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.\n", + "\n", + "\n", + " Route2014[\"buff\"].fillna(\"1\", inplace=True)\n", + "/var/folders/zf/sc5qjn6x54b02sbxg3k9jbkr0000gn/T/ipykernel_37896/4281919854.py:88: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '1' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n", + " Route2014[\"buff\"].fillna(\"1\", inplace=True)\n", + "/var/folders/zf/sc5qjn6x54b02sbxg3k9jbkr0000gn/T/ipykernel_37896/4281919854.py:104: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.\n", + "The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.\n", + "\n", + "For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.\n", + "\n", + "\n", + " VoieFerree2014[\"buff\"].fillna(\"1\", inplace=True)\n", + "/var/folders/zf/sc5qjn6x54b02sbxg3k9jbkr0000gn/T/ipykernel_37896/4281919854.py:122: DeprecationWarning: The 'unary_union' attribute is deprecated, use the 'union_all()' method instead.\n", + " Artif2014_ok=gpd.GeoDataFrame(geometry=[Artif2014.unary_union], crs=\"EPSG:2154\").explode(index_parts=False).reset_index(drop=True)\n", + "/Users/denisvannier/opt/anaconda3/envs/GEODATA2/lib/python3.9/site-packages/geopandas/geodataframe.py:1819: SettingWithCopyWarning: \n", + "A value is trying to be set on a copy of a slice from a DataFrame.\n", + "Try using .loc[row_indexer,col_indexer] = value instead\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + " super().__setitem__(key, value)\n", + "/var/folders/zf/sc5qjn6x54b02sbxg3k9jbkr0000gn/T/ipykernel_37896/4281919854.py:88: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.\n", + "The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.\n", + "\n", + "For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.\n", + "\n", + "\n", + " Route2014[\"buff\"].fillna(\"1\", inplace=True)\n", + "/var/folders/zf/sc5qjn6x54b02sbxg3k9jbkr0000gn/T/ipykernel_37896/4281919854.py:88: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '1' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n", + " Route2014[\"buff\"].fillna(\"1\", inplace=True)\n", + "/var/folders/zf/sc5qjn6x54b02sbxg3k9jbkr0000gn/T/ipykernel_37896/4281919854.py:104: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.\n", + "The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.\n", + "\n", + "For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.\n", + "\n", + "\n", + " VoieFerree2014[\"buff\"].fillna(\"1\", inplace=True)\n", + "/var/folders/zf/sc5qjn6x54b02sbxg3k9jbkr0000gn/T/ipykernel_37896/4281919854.py:122: DeprecationWarning: The 'unary_union' attribute is deprecated, use the 'union_all()' method instead.\n", + " Artif2014_ok=gpd.GeoDataFrame(geometry=[Artif2014.unary_union], crs=\"EPSG:2154\").explode(index_parts=False).reset_index(drop=True)\n", + "/Users/denisvannier/opt/anaconda3/envs/GEODATA2/lib/python3.9/site-packages/geopandas/geodataframe.py:1819: SettingWithCopyWarning: \n", + "A value is trying to be set on a copy of a slice from a DataFrame.\n", + "Try using .loc[row_indexer,col_indexer] = value instead\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + " super().__setitem__(key, value)\n", + "/var/folders/zf/sc5qjn6x54b02sbxg3k9jbkr0000gn/T/ipykernel_37896/4281919854.py:88: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.\n", + "The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.\n", + "\n", + "For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.\n", + "\n", + "\n", + " Route2014[\"buff\"].fillna(\"1\", inplace=True)\n", + "/var/folders/zf/sc5qjn6x54b02sbxg3k9jbkr0000gn/T/ipykernel_37896/4281919854.py:88: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '1' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n", + " Route2014[\"buff\"].fillna(\"1\", inplace=True)\n", + "/var/folders/zf/sc5qjn6x54b02sbxg3k9jbkr0000gn/T/ipykernel_37896/4281919854.py:104: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.\n", + "The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.\n", + "\n", + "For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.\n", + "\n", + "\n", + " VoieFerree2014[\"buff\"].fillna(\"1\", inplace=True)\n", + "/var/folders/zf/sc5qjn6x54b02sbxg3k9jbkr0000gn/T/ipykernel_37896/4281919854.py:104: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '1' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n", + " VoieFerree2014[\"buff\"].fillna(\"1\", inplace=True)\n", + "/var/folders/zf/sc5qjn6x54b02sbxg3k9jbkr0000gn/T/ipykernel_37896/4281919854.py:122: DeprecationWarning: The 'unary_union' attribute is deprecated, use the 'union_all()' method instead.\n", + " Artif2014_ok=gpd.GeoDataFrame(geometry=[Artif2014.unary_union], crs=\"EPSG:2154\").explode(index_parts=False).reset_index(drop=True)\n", + "/Users/denisvannier/opt/anaconda3/envs/GEODATA2/lib/python3.9/site-packages/geopandas/geodataframe.py:1819: SettingWithCopyWarning: \n", + "A value is trying to be set on a copy of a slice from a DataFrame.\n", + "Try using .loc[row_indexer,col_indexer] = value instead\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + " super().__setitem__(key, value)\n", + "/var/folders/zf/sc5qjn6x54b02sbxg3k9jbkr0000gn/T/ipykernel_37896/4281919854.py:88: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.\n", + "The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.\n", + "\n", + "For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.\n", + "\n", + "\n", + " Route2014[\"buff\"].fillna(\"1\", inplace=True)\n", + "/var/folders/zf/sc5qjn6x54b02sbxg3k9jbkr0000gn/T/ipykernel_37896/4281919854.py:88: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '1' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.\n", + " Route2014[\"buff\"].fillna(\"1\", inplace=True)\n", + "/var/folders/zf/sc5qjn6x54b02sbxg3k9jbkr0000gn/T/ipykernel_37896/4281919854.py:104: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.\n", + "The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.\n", + "\n", + "For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.\n", + "\n", + "\n", + " VoieFerree2014[\"buff\"].fillna(\"1\", inplace=True)\n", + "/var/folders/zf/sc5qjn6x54b02sbxg3k9jbkr0000gn/T/ipykernel_37896/4281919854.py:122: DeprecationWarning: The 'unary_union' attribute is deprecated, use the 'union_all()' method instead.\n", + " Artif2014_ok=gpd.GeoDataFrame(geometry=[Artif2014.unary_union], crs=\"EPSG:2154\").explode(index_parts=False).reset_index(drop=True)\n" + ] + } + ], + "source": [ + "dep=[\"56\",\"22\",\"29\",\"44\"]\n", + "\n", + "for dep in dep:\n", + " #################### Batiments 2014 ##########################\n", + " batA2014=gpd.read_file(\"BD_TOPO/BDTOPO_2014/BDTOPO_2-1_TOUSTHEMES_SHP_LAMB93_D0\"+dep+\"_2014-04-02/BDTOPO/1_DONNEES_LIVRAISON_2021-09-00173/BDT_2-1_SHP_LAMB93_D0\"+dep+\"-ED141/E_BATI/BATI_INDIFFERENCIE.SHP\")\n", + " batB2014=gpd.read_file(\"BD_TOPO/BDTOPO_2014/BDTOPO_2-1_TOUSTHEMES_SHP_LAMB93_D0\"+dep+\"_2014-04-02/BDTOPO/1_DONNEES_LIVRAISON_2021-09-00173/BDT_2-1_SHP_LAMB93_D0\"+dep+\"-ED141/E_BATI/BATI_INDUSTRIEL.SHP\")\n", + " batC2014=gpd.read_file(\"BD_TOPO/BDTOPO_2014/BDTOPO_2-1_TOUSTHEMES_SHP_LAMB93_D0\"+dep+\"_2014-04-02/BDTOPO/1_DONNEES_LIVRAISON_2021-09-00173/BDT_2-1_SHP_LAMB93_D0\"+dep+\"-ED141/E_BATI/CIMETIERE.SHP\")\n", + " batD2014=gpd.read_file(\"BD_TOPO/BDTOPO_2014/BDTOPO_2-1_TOUSTHEMES_SHP_LAMB93_D0\"+dep+\"_2014-04-02/BDTOPO/1_DONNEES_LIVRAISON_2021-09-00173/BDT_2-1_SHP_LAMB93_D0\"+dep+\"-ED141/E_BATI/BATI_REMARQUABLE.SHP\")\n", + " batE2014=gpd.read_file(\"BD_TOPO/BDTOPO_2014/BDTOPO_2-1_TOUSTHEMES_SHP_LAMB93_D0\"+dep+\"_2014-04-02/BDTOPO/1_DONNEES_LIVRAISON_2021-09-00173/BDT_2-1_SHP_LAMB93_D0\"+dep+\"-ED141/E_BATI/CONSTRUCTION_SURFACIQUE.SHP\")\n", + " batF2014=gpd.read_file(\"BD_TOPO/BDTOPO_2014/BDTOPO_2-1_TOUSTHEMES_SHP_LAMB93_D0\"+dep+\"_2014-04-02/BDTOPO/1_DONNEES_LIVRAISON_2021-09-00173/BDT_2-1_SHP_LAMB93_D0\"+dep+\"-ED141/E_BATI/RESERVOIR.SHP\")\n", + " batG2014=gpd.read_file(\"BD_TOPO/BDTOPO_2014/BDTOPO_2-1_TOUSTHEMES_SHP_LAMB93_D0\"+dep+\"_2014-04-02/BDTOPO/1_DONNEES_LIVRAISON_2021-09-00173/BDT_2-1_SHP_LAMB93_D0\"+dep+\"-ED141/E_BATI/PISTE_AERODROME.SHP\")\n", + " batH2014=gpd.read_file(\"BD_TOPO/BDTOPO_2014/BDTOPO_2-1_TOUSTHEMES_SHP_LAMB93_D0\"+dep+\"_2014-04-02/BDTOPO/1_DONNEES_LIVRAISON_2021-09-00173/BDT_2-1_SHP_LAMB93_D0\"+dep+\"-ED141/E_BATI/CONSTRUCTION_LEGERE.SHP\")\n", + " batI2014=gpd.read_file(\"BD_TOPO/BDTOPO_2014/BDTOPO_2-1_TOUSTHEMES_SHP_LAMB93_D0\"+dep+\"_2014-04-02/BDTOPO/1_DONNEES_LIVRAISON_2021-09-00173/BDT_2-1_SHP_LAMB93_D0\"+dep+\"-ED141/E_BATI/TERRAIN_SPORT.SHP\")\n", + " bat2014=gpd.GeoDataFrame(pd.concat([batA2014,batB2014,batC2014,batD2014,batE2014,batF2014,batG2014,batH2014,batI2014], ignore_index=True))\n", + " bat2014=gpd.GeoDataFrame(bat2014, crs=\"EPSG:2154\")\n", + " bat2014_com=bat2014.sjoin(Bande10kmComLitt)\n", + " bat2014_com=bat2014_com[['INSEE_COM','NOM','geometry']]\n", + " bat2014_com.to_file(\"BD_TOPO/Temp/BATIMENTS_BRUTS/BAT_COM_LITT_\"+dep+\"_2014.shp\")\n", + "\n", + " BatDep2014=bat2014_com[['geometry']]\n", + " BatDep2014['buffered']=BatDep2014.buffer(50.0, join_style=1 )\n", + " BatDep2014BUFF1=BatDep2014.set_geometry(\"buffered\")\n", + " BatDep2014BUFF1=gpd.GeoDataFrame(BatDep2014BUFF1,geometry='buffered', crs='EPSG:2154')\n", + " BatDep2014BUFF1=BatDep2014BUFF1.dissolve()\n", + " BatDep2014BUFFok=BatDep2014BUFF1.buffer(-45, join_style=1 )\n", + " BatDep2014BUFFok=BatDep2014BUFFok.reset_index()\n", + " BatDep2014BUFFok.rename(columns={0:\"geometry\"}, inplace=True)\n", + " BatDep2014BUFFok=gpd.GeoDataFrame(BatDep2014BUFFok,geometry='geometry', crs='EPSG:2154')\n", + " BatDep2014BUFFok=BatDep2014BUFFok[['geometry']]\n", + " BatDep2014BUFFok=BatDep2014BUFFok.dissolve()\n", + " BatDep2014BUFFok.to_file(\"BD_TOPO/Temp/BATIMENTS_BUFFER/BAT_BUFFER_\"+dep+\"_2014.shp\")\n", + "\n", + " BatDep2014BUFFok=gpd.read_file(\"BD_TOPO/Temp/BATIMENTS_BUFFER/BAT_BUFFER_\"+dep+\"_2014.shp\")\n", + "\n", + " #################### Routes 2014 ##########################\n", + " Route2014=gpd.read_file(\"BD_TOPO/BDTOPO_2014/BDTOPO_2-1_TOUSTHEMES_SHP_LAMB93_D0\"+dep+\"_2014-04-02/BDTOPO/1_DONNEES_LIVRAISON_2021-09-00173/BDT_2-1_SHP_LAMB93_D0\"+dep+\"-ED141/A_RESEAU_ROUTIER/ROUTE.SHP\")\n", + " # On ne garde pas les sentiers, les chemins et les pistes cyclables :\n", + " Route2014=Route2014[Route2014[\"NATURE\"]!=\"Sentier\"]\n", + " Route2014=Route2014[Route2014[\"NATURE\"]!=\"Chemin\"]\n", + " Route2014=Route2014[Route2014[\"NATURE\"]!=\"Piste cyclable\"]\n", + " # Application d'un buffer selon le type de route :\n", + " # L'emprise des infrastructures routières provient des estimations publiées en 2013 \n", + " # par le « groupe de travail national sur l’évaluation de la consommation d’espace à partir des fichiers fonciers »\n", + " # http://piece-jointe-carto.developpement-durable.gouv.fr/REG074B/FONCIER_SOL/N_OCCUPATION_SOL/L_EMPRISE_ROUTE_R74/Fiche1-7-1.pdf\n", + " # L'emprise corrigée des ponts (variable \"FRANCHISST\") n'a pas été prise en compte, pour permettre une comparaisons avec les millésimes plus récents de la BD Topo.\n", + " Route2014.loc[(Route2014[\"NATURE\"]==\"Quasi-autoroute\") & (Route2014[\"NB_VOIES\"]==2), \"buff\"] = 5\n", + " Route2014.loc[(Route2014[\"NATURE\"]==\"Quasi-autoroute\") & (Route2014[\"NB_VOIES\"]==3), \"buff\"] = 7\n", + " Route2014.loc[(Route2014[\"NATURE\"]==\"Quasi-autoroute\") & (Route2014[\"NB_VOIES\"]==4), \"buff\"] = 8\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Autre\") & (Route2014[\"NATURE\"]==\"Bretelle\") & (Route2014[\"NB_VOIES\"]==0), \"buff\"] = 4.5\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Autre\") & (Route2014[\"NATURE\"]==\"Bretelle\") & (Route2014[\"NB_VOIES\"]==1), \"buff\"] = 4.5\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Autre\") & (Route2014[\"NATURE\"]==\"Bretelle\") & (Route2014[\"NB_VOIES\"]==2), \"buff\"] = 6\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Autre\") & (Route2014[\"NATURE\"]==\"Escalier\") & (Route2014[\"NB_VOIES\"]==0), \"buff\"] = 1\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Autre\") & (Route2014[\"NATURE\"]==\"Route à 1 chaussée\") & (Route2014[\"NB_VOIES\"]==0), \"buff\"] = 3.25\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Autre\") & (Route2014[\"NATURE\"]==\"Route à 1 chaussée\") & (Route2014[\"NB_VOIES\"]==1), \"buff\"] = 3.25\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Autre\") & (Route2014[\"NATURE\"]==\"Route à 1 chaussée\") & (Route2014[\"NB_VOIES\"]==2), \"buff\"] = 3.25\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Autre\") & (Route2014[\"NATURE\"]==\"Route à 1 chaussée\") & (Route2014[\"NB_VOIES\"]==3), \"buff\"] = 3.25\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Autre\") & (Route2014[\"NATURE\"]==\"Route à 1 chaussée\") & (Route2014[\"NB_VOIES\"]==4), \"buff\"] = 3.25\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Autre\") & (Route2014[\"NATURE\"]==\"Route à 1 chaussée\") & (Route2014[\"NB_VOIES\"]==5), \"buff\"] = 3.25\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Autre\") & (Route2014[\"NATURE\"]==\"Route à 2 chaussées\") & (Route2014[\"NB_VOIES\"]==0), \"buff\"] = 4\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Autre\") & (Route2014[\"NATURE\"]==\"Route à 2 chaussées\") & (Route2014[\"NB_VOIES\"]==1), \"buff\"] = 4\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Autre\") & (Route2014[\"NATURE\"]==\"Route à 2 chaussées\") & (Route2014[\"NB_VOIES\"]==2), \"buff\"] = 4.5\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Autre\") & (Route2014[\"NATURE\"]==\"Route à 2 chaussées\") & (Route2014[\"NB_VOIES\"]==3), \"buff\"] = 4.5\n", + " Route2014.loc[Route2014[\"NATURE\"]==\"Route empierrée\", \"buff\"] = 1\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Départementale\") & (Route2014[\"NATURE\"]==\"Bretelle\") & (Route2014[\"NB_VOIES\"]==0), \"buff\"] = 3.75\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Départementale\") & (Route2014[\"NATURE\"]==\"Bretelle\") & (Route2014[\"NB_VOIES\"]==1), \"buff\"] = 3.75\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Départementale\") & (Route2014[\"NATURE\"]==\"Bretelle\") & (Route2014[\"NB_VOIES\"]==2), \"buff\"] = 5.5\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Départementale\") & (Route2014[\"NATURE\"]==\"Route à 1 chaussée\") & (Route2014[\"NB_VOIES\"]==0), \"buff\"] = 3\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Départementale\") & (Route2014[\"NATURE\"]==\"Route à 1 chaussée\") & (Route2014[\"NB_VOIES\"]==1), \"buff\"] = 3\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Départementale\") & (Route2014[\"NATURE\"]==\"Route à 1 chaussée\") & (Route2014[\"NB_VOIES\"]==2), \"buff\"] = 5\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Départementale\") & (Route2014[\"NATURE\"]==\"Route à 1 chaussée\") & (Route2014[\"NB_VOIES\"]==3), \"buff\"] = 5\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Départementale\") & (Route2014[\"NATURE\"]==\"Route à 1 chaussée\") & (Route2014[\"NB_VOIES\"]==4), \"buff\"] = 5\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Départementale\") & (Route2014[\"NATURE\"]==\"Route à 2 chaussées\") & (Route2014[\"NB_VOIES\"]==0), \"buff\"] = 4.5\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Départementale\") & (Route2014[\"NATURE\"]==\"Route à 2 chaussées\") & (Route2014[\"NB_VOIES\"]==1), \"buff\"] = 4.5\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Départementale\") & (Route2014[\"NATURE\"]==\"Route à 2 chaussées\") & (Route2014[\"NB_VOIES\"]==2), \"buff\"] = 7\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Départementale\") & (Route2014[\"NATURE\"]==\"Route à 2 chaussées\") & (Route2014[\"NB_VOIES\"]==3), \"buff\"] = 7\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Nationale\") & (Route2014[\"NATURE\"]==\"Bretelle\") & (Route2014[\"NB_VOIES\"]==1), \"buff\"] = 5.25\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Nationale\") & (Route2014[\"NATURE\"]==\"Bretelle\") & (Route2014[\"NB_VOIES\"]==2), \"buff\"] = 7\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Nationale\") & (Route2014[\"NATURE\"]==\"Route à 1 chaussée\") & (Route2014[\"NB_VOIES\"]==1), \"buff\"] = 5.25\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Nationale\") & (Route2014[\"NATURE\"]==\"Route à 1 chaussée\") & (Route2014[\"NB_VOIES\"]==2), \"buff\"] = 7\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Nationale\") & (Route2014[\"NATURE\"]==\"Route à 1 chaussée\") & (Route2014[\"NB_VOIES\"]==3), \"buff\"] = 7\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Nationale\") & (Route2014[\"NATURE\"]==\"Route à 1 chaussée\") & (Route2014[\"NB_VOIES\"]==4), \"buff\"] = 7\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Nationale\") & (Route2014[\"NATURE\"]==\"Route à 2 chaussées\") & (Route2014[\"NB_VOIES\"]==0), \"buff\"] = 7\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Nationale\") & (Route2014[\"NATURE\"]==\"Route à 2 chaussées\") & (Route2014[\"NB_VOIES\"]==1), \"buff\"] = 5.25\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Nationale\") & (Route2014[\"NATURE\"]==\"Route à 2 chaussées\") & (Route2014[\"NB_VOIES\"]==2), \"buff\"] = 7\n", + " Route2014.loc[(Route2014[\"CL_ADMIN\"]==\"Nationale\") & (Route2014[\"NATURE\"]==\"Route à 2 chaussées\") & (Route2014[\"NB_VOIES\"]==3), \"buff\"] = 7\n", + " Route2014[\"buff\"].fillna(\"1\", inplace=True)\n", + " Route2014[\"buff\"]=Route2014[\"buff\"].astype(\"float64\")\n", + " Route2014[\"buffered\"]=Route2014.buffer(Route2014[\"buff\"], join_style=1)\n", + " Route2014=Route2014[[\"buffered\"]]\n", + " Route2014BUFF=gpd.GeoDataFrame(Route2014,geometry='buffered', crs='EPSG:2154')\n", + " Route2014BUFF=Route2014BUFF.dissolve()\n", + " Route2014BUFF.rename(columns={\"buffered\":\"geometry\"}, inplace=True)\n", + " Route2014BUFF=Route2014BUFF.set_geometry(\"geometry\")\n", + "\n", + " ########################## Voies ferrées 2014 ##########################\n", + " VoieFerree2014=gpd.read_file(\"BD_TOPO/BDTOPO_2014/BDTOPO_2-1_TOUSTHEMES_SHP_LAMB93_D0\"+dep+\"_2014-04-02/BDTOPO/1_DONNEES_LIVRAISON_2021-09-00173/BDT_2-1_SHP_LAMB93_D0\"+dep+\"-ED141/B_VOIES_FERREES_ET_AUTRES/TRONCON_VOIE_FERREE.SHP\")\n", + " # Lister les valeurs de buffer à appliquer en fonction du nombre de voies : \n", + " VoieFerree2014.loc[VoieFerree2014[\"NB_VOIES\"]==1, \"buff\"] = 4.2\n", + " VoieFerree2014.loc[VoieFerree2014[\"NB_VOIES\"]==2, \"buff\"] = 5.9\n", + " VoieFerree2014.loc[VoieFerree2014[\"NB_VOIES\"]==3, \"buff\"] = 7.6\n", + " VoieFerree2014.loc[VoieFerree2014[\"NB_VOIES\"]==4, \"buff\"] = 9.3\n", + " VoieFerree2014[\"buff\"].fillna(\"1\", inplace=True)\n", + " VoieFerree2014[\"buff\"]=VoieFerree2014[\"buff\"].astype(\"float64\")\n", + " VoieFerree2014[\"buffered\"]=VoieFerree2014.buffer(VoieFerree2014[\"buff\"], join_style=1 )\n", + " VoieFerree2014=VoieFerree2014[[\"buffered\"]]\n", + " \n", + " VoieFerree2014BUFF=gpd.GeoDataFrame(VoieFerree2014,geometry=\"buffered\", crs=\"EPSG:2154\")\n", + " VoieFerree2014BUFF=VoieFerree2014BUFF.dissolve()\n", + " VoieFerree2014BUFF.rename(columns={\"buffered\":\"geometry\"}, inplace=True)\n", + " VoieFerree2014BUFF=VoieFerree2014BUFF.set_geometry(\"geometry\")\n", + "\n", + " ########################## Parkings, gares, aires de triage 2014 ##########################\n", + " Parking2014=gpd.read_file(\"BD_TOPO/BDTOPO_2014/BDTOPO_2-1_TOUSTHEMES_SHP_LAMB93_D0\"+dep+\"_2014-04-02/BDTOPO/1_DONNEES_LIVRAISON_2021-09-00173/BDT_2-1_SHP_LAMB93_D0\"+dep+\"-ED141/A_RESEAU_ROUTIER/SURFACE_ROUTE.SHP\")\n", + " Gare2014=gpd.read_file(\"BD_TOPO/BDTOPO_2014/BDTOPO_2-1_TOUSTHEMES_SHP_LAMB93_D0\"+dep+\"_2014-04-02/BDTOPO/1_DONNEES_LIVRAISON_2021-09-00173/BDT_2-1_SHP_LAMB93_D0\"+dep+\"-ED141/B_VOIES_FERREES_ET_AUTRES/GARE.SHP\")\n", + " Triage2014=gpd.read_file(\"BD_TOPO/BDTOPO_2014/BDTOPO_2-1_TOUSTHEMES_SHP_LAMB93_D0\"+dep+\"_2014-04-02/BDTOPO/1_DONNEES_LIVRAISON_2021-09-00173/BDT_2-1_SHP_LAMB93_D0\"+dep+\"-ED141/B_VOIES_FERREES_ET_AUTRES/AIRE_TRIAGE.SHP\")\n", + " Parking2014=pd.concat([Parking2014, Gare2014, Triage2014])\n", + " Parking2014=Parking2014[[\"geometry\"]]\n", + "\n", + " Artif2014=pd.concat([BatDep2014BUFFok, Route2014BUFF, VoieFerree2014BUFF, Parking2014])\n", + " Artif2014_ok=gpd.GeoDataFrame(geometry=[Artif2014.unary_union], crs=\"EPSG:2154\").explode(index_parts=False).reset_index(drop=True)\n", + " Artif2014_ok=Artif2014_ok[[\"geometry\"]]\n", + " Artif2014_ok=Artif2014_ok.dissolve()\n", + " Artif2014_ok=Artif2014_ok.overlay(Bande10kmComLitt_dissolve, how='intersection', keep_geom_type=None, make_valid=True)\n", + " Artif2014_ok.to_file(\"BD_TOPO/Temp/TACHE_ARTIF_BRUTE/TACHE_ARTIF_\"+dep+\"_2014_OK.shp\")\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 2024" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/var/folders/zf/sc5qjn6x54b02sbxg3k9jbkr0000gn/T/ipykernel_37896/14037435.py:122: DeprecationWarning: The 'unary_union' attribute is deprecated, use the 'union_all()' method instead.\n", + " Artif2024_ok=gpd.GeoDataFrame(geometry=[Artif2024.unary_union], crs=\"EPSG:2154\").explode(index_parts=False).reset_index(drop=True)\n", + "/var/folders/zf/sc5qjn6x54b02sbxg3k9jbkr0000gn/T/ipykernel_37896/14037435.py:122: DeprecationWarning: The 'unary_union' attribute is deprecated, use the 'union_all()' method instead.\n", + " Artif2024_ok=gpd.GeoDataFrame(geometry=[Artif2024.unary_union], crs=\"EPSG:2154\").explode(index_parts=False).reset_index(drop=True)\n", + "/var/folders/zf/sc5qjn6x54b02sbxg3k9jbkr0000gn/T/ipykernel_37896/14037435.py:122: DeprecationWarning: The 'unary_union' attribute is deprecated, use the 'union_all()' method instead.\n", + " Artif2024_ok=gpd.GeoDataFrame(geometry=[Artif2024.unary_union], crs=\"EPSG:2154\").explode(index_parts=False).reset_index(drop=True)\n", + "/var/folders/zf/sc5qjn6x54b02sbxg3k9jbkr0000gn/T/ipykernel_37896/14037435.py:122: DeprecationWarning: The 'unary_union' attribute is deprecated, use the 'union_all()' method instead.\n", + " Artif2024_ok=gpd.GeoDataFrame(geometry=[Artif2024.unary_union], crs=\"EPSG:2154\").explode(index_parts=False).reset_index(drop=True)\n", + "/var/folders/zf/sc5qjn6x54b02sbxg3k9jbkr0000gn/T/ipykernel_37896/14037435.py:122: DeprecationWarning: The 'unary_union' attribute is deprecated, use the 'union_all()' method instead.\n", + " Artif2024_ok=gpd.GeoDataFrame(geometry=[Artif2024.unary_union], crs=\"EPSG:2154\").explode(index_parts=False).reset_index(drop=True)\n" + ] + } + ], + "source": [ + "dep=[\"56\",\"22\",\"29\",\"35\",\"44\"]\n", + "\n", + "for dep in dep:\n", + "\n", + " #################### Batiments 2024 ##########################\n", + " batA2024=gpd.read_file(\"BD_TOPO/BDTOPO_JUIN_2024/BDTOPO_3-4_TOUSTHEMES_SHP_LAMB93_D0\"+dep+\"_2024-06-15/BDTOPO/1_DONNEES_LIVRAISON_2024-06-00178/BDT_3-4_SHP_LAMB93_D0\"+dep+\"-ED2024-06-15/BATI/BATIMENT.shp\")\n", + " batB2024=gpd.read_file(\"BD_TOPO/BDTOPO_JUIN_2024/BDTOPO_3-4_TOUSTHEMES_SHP_LAMB93_D0\"+dep+\"_2024-06-15/BDTOPO/1_DONNEES_LIVRAISON_2024-06-00178/BDT_3-4_SHP_LAMB93_D0\"+dep+\"-ED2024-06-15/BATI/CIMETIERE.shp\")\n", + " batC2024=gpd.read_file(\"BD_TOPO/BDTOPO_JUIN_2024/BDTOPO_3-4_TOUSTHEMES_SHP_LAMB93_D0\"+dep+\"_2024-06-15/BDTOPO/1_DONNEES_LIVRAISON_2024-06-00178/BDT_3-4_SHP_LAMB93_D0\"+dep+\"-ED2024-06-15/BATI/CONSTRUCTION_SURFACIQUE.shp\")\n", + " batD2024=gpd.read_file(\"BD_TOPO/BDTOPO_JUIN_2024/BDTOPO_3-4_TOUSTHEMES_SHP_LAMB93_D0\"+dep+\"_2024-06-15/BDTOPO/1_DONNEES_LIVRAISON_2024-06-00178/BDT_3-4_SHP_LAMB93_D0\"+dep+\"-ED2024-06-15/BATI/RESERVOIR.shp\")\n", + " bat2024=gpd.GeoDataFrame(pd.concat([batA2024,batB2024,batC2024,batD2024], ignore_index=True))\n", + " bat2024=gpd.GeoDataFrame(bat2024, crs=\"EPSG:2154\")\n", + " bat2024_com=bat2024.sjoin(Bande10kmComLitt)\n", + " bat2024_com=bat2024_com[['INSEE_COM','NOM','geometry']]\n", + " bat2024_com.to_file(\"BD_TOPO/Temp/BATIMENTS_BRUTS/BAT_COM_LITT_\"+dep+\"_2024.shp\")\n", + "\n", + " BatDep2024=bat2024_com[['geometry']]\n", + " BatDep2024['buffered']=BatDep2024.buffer(50.0, join_style=1 )\n", + " BatDep2024BUFF1=BatDep2024.set_geometry(\"buffered\")\n", + " BatDep2024BUFF1=gpd.GeoDataFrame(BatDep2024BUFF1,geometry='buffered', crs='EPSG:2154')\n", + " BatDep2024BUFF1=BatDep2024BUFF1.dissolve()\n", + " BatDep2024BUFFok=BatDep2024BUFF1.buffer(-45, join_style=1 )\n", + " BatDep2024BUFFok=BatDep2024BUFFok.reset_index()\n", + " BatDep2024BUFFok.rename(columns={0:\"geometry\"}, inplace=True)\n", + " BatDep2024BUFFok=gpd.GeoDataFrame(BatDep2024BUFFok,geometry='geometry', crs='EPSG:2154')\n", + " BatDep2024BUFFok=BatDep2024BUFFok[['geometry']]\n", + " BatDep2024BUFFok=BatDep2024BUFFok.dissolve()\n", + " BatDep2024BUFFok.to_file(\"BD_TOPO/Temp/BATIMENTS_BUFFER/BAT_BUFFER_\"+dep+\"_2024.shp\")\n", + "\n", + " BatDep2024BUFFok=gpd.read_file(\"BD_TOPO/Temp/BATIMENTS_BUFFER/BAT_BUFFER_\"+dep+\"_2024.shp\")\n", + " \n", + " # #################### Routes 2024 ##########################\n", + " Route2024=gpd.read_file(\"BD_TOPO/BDTOPO_JUIN_2024/BDTOPO_3-4_TOUSTHEMES_SHP_LAMB93_D0\"+dep+\"_2024-06-15/BDTOPO/1_DONNEES_LIVRAISON_2024-06-00178/BDT_3-4_SHP_LAMB93_D0\"+dep+\"-ED2024-06-15/TRANSPORT/TRONCON_DE_ROUTE.shp\")\n", + " # On ne garde pas les sentiers, les chemins et les pistes cyclables :\n", + " Route2024=Route2024[Route2024[\"NATURE\"]!=\"Sentier\"]\n", + " Route2024=Route2024[Route2024[\"NATURE\"]!=\"Chemin\"]\n", + " Route2024=Route2024[Route2024[\"NATURE\"]!=\"Piste cyclable\"]\n", + " # On applique un buffer en fonction du type de routes :\n", + " # L'emprise des infrastructures routières provient des estimations publiées en 2013 \n", + " # par le « groupe de travail national sur l’évaluation de la consommation d’espace à partir des fichiers fonciers » : \n", + " # http://piece-jointe-carto.developpement-durable.gouv.fr/REG074B/FONCIER_SOL/N_OCCUPATION_SOL/L_EMPRISE_ROUTE_R74/Fiche1-7-1.pdf\n", + " # L'emprise corrigée des ponts (variable \"FRANCHISST\") n'a pas été prise en compte, pour permettre une comparaisons avec les millésimes plus récents de la BD Topo.\n", + " Route2024.loc[(Route2024[\"NATURE\"]==\"Type autoroutier\") & (Route2024[\"NB_VOIES\"]==2), \"buff\"] = 5\n", + " Route2024.loc[(Route2024[\"NATURE\"]==\"Type autoroutier\") & (Route2024[\"NB_VOIES\"]==3), \"buff\"] = 7\n", + " Route2024.loc[(Route2024[\"NATURE\"]==\"Type autoroutier\") & (Route2024[\"NB_VOIES\"]==4), \"buff\"] = 8\n", + " Route2024.loc[(Route2024[\"NATURE\"]==\"Bretelle\") & (Route2024[\"NB_VOIES\"]==0), \"buff\"] = 4.5\n", + " Route2024.loc[(Route2024[\"NATURE\"]==\"Bretelle\") & (Route2024[\"NB_VOIES\"]==1), \"buff\"] = 4.5\n", + " Route2024.loc[(Route2024[\"NATURE\"]==\"Bretelle\") & (Route2024[\"NB_VOIES\"]==2), \"buff\"] = 6\n", + " Route2024.loc[(Route2024[\"NATURE\"]==\"Escalier\") & (Route2024[\"NB_VOIES\"]==0), \"buff\"] = 1\n", + " Route2024.loc[(Route2024[\"NATURE\"]==\"Route à 1 chaussée\") & (Route2024[\"NB_VOIES\"]==0), \"buff\"] = 3.25\n", + " Route2024.loc[(Route2024[\"NATURE\"]==\"Route à 1 chaussée\") & (Route2024[\"NB_VOIES\"]==1), \"buff\"] = 3.25\n", + " Route2024.loc[(Route2024[\"NATURE\"]==\"Route à 1 chaussée\") & (Route2024[\"NB_VOIES\"]==2), \"buff\"] = 3.25\n", + " Route2024.loc[(Route2024[\"NATURE\"]==\"Route à 1 chaussée\") & (Route2024[\"NB_VOIES\"]==3), \"buff\"] = 3.25\n", + " Route2024.loc[(Route2024[\"NATURE\"]==\"Route à 1 chaussée\") & (Route2024[\"NB_VOIES\"]==4), \"buff\"] = 3.25\n", + " Route2024.loc[(Route2024[\"NATURE\"]==\"Route à 1 chaussée\") & (Route2024[\"NB_VOIES\"]==5), \"buff\"] = 3.25\n", + " Route2024.loc[(Route2024[\"NATURE\"]==\"Route à 2 chaussées\") & (Route2024[\"NB_VOIES\"]==0), \"buff\"] = 4\n", + " Route2024.loc[(Route2024[\"NATURE\"]==\"Route à 2 chaussées\") & (Route2024[\"NB_VOIES\"]==1), \"buff\"] = 4\n", + " Route2024.loc[(Route2024[\"NATURE\"]==\"Route à 2 chaussées\") & (Route2024[\"NB_VOIES\"]==2), \"buff\"] = 4.5\n", + " Route2024.loc[(Route2024[\"NATURE\"]==\"Route à 2 chaussées\") & (Route2024[\"NB_VOIES\"]==3), \"buff\"] = 4.5\n", + " Route2024.loc[Route2024[\"NATURE\"]==\"Route empierrée\", \"buff\"] = 1\n", + " Route2024.loc[(Route2024[\"CL_ADMIN\"]==\"Départementale\") & (Route2024[\"NATURE\"]==\"Bretelle\") & (Route2024[\"NB_VOIES\"]==0), \"buff\"] = 3.75\n", + " Route2024.loc[(Route2024[\"CL_ADMIN\"]==\"Départementale\") & (Route2024[\"NATURE\"]==\"Bretelle\") & (Route2024[\"NB_VOIES\"]==1), \"buff\"] = 3.75\n", + " Route2024.loc[(Route2024[\"CL_ADMIN\"]==\"Départementale\") & (Route2024[\"NATURE\"]==\"Bretelle\") & (Route2024[\"NB_VOIES\"]==2), \"buff\"] = 5.5\n", + " Route2024.loc[(Route2024[\"CL_ADMIN\"]==\"Départementale\") & (Route2024[\"NATURE\"]==\"Route à 1 chaussée\") & (Route2024[\"NB_VOIES\"]==0), \"buff\"] = 3\n", + " Route2024.loc[(Route2024[\"CL_ADMIN\"]==\"Départementale\") & (Route2024[\"NATURE\"]==\"Route à 1 chaussée\") & (Route2024[\"NB_VOIES\"]==1), \"buff\"] = 3\n", + " Route2024.loc[(Route2024[\"CL_ADMIN\"]==\"Départementale\") & (Route2024[\"NATURE\"]==\"Route à 1 chaussée\") & (Route2024[\"NB_VOIES\"]==2), \"buff\"] = 5\n", + " Route2024.loc[(Route2024[\"CL_ADMIN\"]==\"Départementale\") & (Route2024[\"NATURE\"]==\"Route à 1 chaussée\") & (Route2024[\"NB_VOIES\"]==3), \"buff\"] = 5\n", + " Route2024.loc[(Route2024[\"CL_ADMIN\"]==\"Départementale\") & (Route2024[\"NATURE\"]==\"Route à 1 chaussée\") & (Route2024[\"NB_VOIES\"]==4), \"buff\"] = 5\n", + " Route2024.loc[(Route2024[\"CL_ADMIN\"]==\"Départementale\") & (Route2024[\"NATURE\"]==\"Route à 2 chaussées\") & (Route2024[\"NB_VOIES\"]==0), \"buff\"] = 4.5\n", + " Route2024.loc[(Route2024[\"CL_ADMIN\"]==\"Départementale\") & (Route2024[\"NATURE\"]==\"Route à 2 chaussées\") & (Route2024[\"NB_VOIES\"]==1), \"buff\"] = 4.5\n", + " Route2024.loc[(Route2024[\"CL_ADMIN\"]==\"Départementale\") & (Route2024[\"NATURE\"]==\"Route à 2 chaussées\") & (Route2024[\"NB_VOIES\"]==2), \"buff\"] = 7\n", + " Route2024.loc[(Route2024[\"CL_ADMIN\"]==\"Départementale\") & (Route2024[\"NATURE\"]==\"Route à 2 chaussées\") & (Route2024[\"NB_VOIES\"]==3), \"buff\"] = 7\n", + " Route2024.loc[(Route2024[\"CL_ADMIN\"]==\"Nationale\") & (Route2024[\"NATURE\"]==\"Bretelle\") & (Route2024[\"NB_VOIES\"]==1), \"buff\"] = 5.25\n", + " Route2024.loc[(Route2024[\"CL_ADMIN\"]==\"Nationale\") & (Route2024[\"NATURE\"]==\"Bretelle\") & (Route2024[\"NB_VOIES\"]==2), \"buff\"] = 7\n", + " Route2024.loc[(Route2024[\"CL_ADMIN\"]==\"Nationale\") & (Route2024[\"NATURE\"]==\"Route à 1 chaussée\") & (Route2024[\"NB_VOIES\"]==1), \"buff\"] = 5.25\n", + " Route2024.loc[(Route2024[\"CL_ADMIN\"]==\"Nationale\") & (Route2024[\"NATURE\"]==\"Route à 1 chaussée\") & (Route2024[\"NB_VOIES\"]==2), \"buff\"] = 7\n", + " Route2024.loc[(Route2024[\"CL_ADMIN\"]==\"Nationale\") & (Route2024[\"NATURE\"]==\"Route à 1 chaussée\") & (Route2024[\"NB_VOIES\"]==3), \"buff\"] = 7\n", + " Route2024.loc[(Route2024[\"CL_ADMIN\"]==\"Nationale\") & (Route2024[\"NATURE\"]==\"Route à 1 chaussée\") & (Route2024[\"NB_VOIES\"]==4), \"buff\"] = 7\n", + " Route2024.loc[(Route2024[\"CL_ADMIN\"]==\"Nationale\") & (Route2024[\"NATURE\"]==\"Route à 2 chaussées\") & (Route2024[\"NB_VOIES\"]==0), \"buff\"] = 7\n", + " Route2024.loc[(Route2024[\"CL_ADMIN\"]==\"Nationale\") & (Route2024[\"NATURE\"]==\"Route à 2 chaussées\") & (Route2024[\"NB_VOIES\"]==1), \"buff\"] = 5.25\n", + " Route2024.loc[(Route2024[\"CL_ADMIN\"]==\"Nationale\") & (Route2024[\"NATURE\"]==\"Route à 2 chaussées\") & (Route2024[\"NB_VOIES\"]==2), \"buff\"] = 7\n", + " Route2024.loc[(Route2024[\"CL_ADMIN\"]==\"Nationale\") & (Route2024[\"NATURE\"]==\"Route à 2 chaussées\") & (Route2024[\"NB_VOIES\"]==3), \"buff\"] = 7\n", + " Route2024[\"buff\"].fillna(\"1\", inplace=True)\n", + " Route2024[\"buff\"]=Route2024[\"buff\"].astype(\"float64\")\n", + " Route2024[\"buffered\"]=Route2024.buffer(Route2024[\"buff\"], join_style=1)\n", + " Route2024=Route2024[[\"buffered\"]]\n", + " Route2024BUFF=gpd.GeoDataFrame(Route2024,geometry='buffered', crs='EPSG:2154')\n", + " Route2024BUFF=Route2024BUFF.dissolve()\n", + " Route2024BUFF.rename(columns={\"buffered\":\"geometry\"}, inplace=True)\n", + " Route2024BUFF=Route2024BUFF.set_geometry(\"geometry\")\n", + "\n", + "\n", + " # ########################## Voies ferrées 2024 ##########################\n", + " VoieFerree2024=gpd.read_file(\"BD_TOPO/BDTOPO_JUIN_2024/BDTOPO_3-4_TOUSTHEMES_SHP_LAMB93_D0\"+dep+\"_2024-06-15/BDTOPO/1_DONNEES_LIVRAISON_2024-06-00178/BDT_3-4_SHP_LAMB93_D0\"+dep+\"-ED2024-06-15/TRANSPORT/TRONCON_DE_VOIE_FERREE.shp\")\n", + " # Lister les valeurs de buffer à appliquer en fonction du nombre de voies : \n", + " VoieFerree2024.loc[VoieFerree2024[\"NB_VOIES\"]==1, \"buff\"] = 4.2\n", + " VoieFerree2024.loc[VoieFerree2024[\"NB_VOIES\"]==2, \"buff\"] = 5.9\n", + " VoieFerree2024.loc[VoieFerree2024[\"NB_VOIES\"]==3, \"buff\"] = 7.6\n", + " VoieFerree2024.loc[VoieFerree2024[\"NB_VOIES\"]==4, \"buff\"] = 9.3\n", + " VoieFerree2024[\"buff\"].fillna(\"1\", inplace=True)\n", + " VoieFerree2024[\"buff\"]=VoieFerree2024[\"buff\"].astype(\"float64\")\n", + " VoieFerree2024[\"buffered\"]=VoieFerree2024.buffer(VoieFerree2024[\"buff\"], join_style=1 )\n", + " VoieFerree2024=VoieFerree2024[[\"buffered\"]]\n", + " \n", + " VoieFerree2024BUFF=gpd.GeoDataFrame(VoieFerree2024,geometry=\"buffered\", crs=\"EPSG:2154\")\n", + " VoieFerree2024BUFF=VoieFerree2024BUFF.dissolve()\n", + " VoieFerree2024BUFF.rename(columns={\"buffered\":\"geometry\"}, inplace=True)\n", + " VoieFerree2024BUFF=VoieFerree2024BUFF.set_geometry(\"geometry\")\n", + "\n", + " ########################## Parkings 2024 ##########################\n", + " Parking2024=gpd.read_file(\"BD_TOPO/BDTOPO_JUIN_2024/BDTOPO_3-4_TOUSTHEMES_SHP_LAMB93_D0\"+dep+\"_2024-06-15/BDTOPO/1_DONNEES_LIVRAISON_2024-06-00178/BDT_3-4_SHP_LAMB93_D0\"+dep+\"-ED2024-06-15/TRANSPORT/EQUIPEMENT_DE_TRANSPORT.shp\")\n", + " Parking2024=Parking2024[Parking2024[\"NATURE\"]==\"Parking\"]\n", + " Parking2024=Parking2024[[\"geometry\"]]\n", + "\n", + " # ########################## Pistes d'aérodromes 2024 ##########################\n", + "\n", + " Aerodrome2024=gpd.read_file(\"BD_TOPO/BDTOPO_JUIN_2024/BDTOPO_3-4_TOUSTHEMES_SHP_LAMB93_D0\"+dep+\"_2024-06-15/BDTOPO/1_DONNEES_LIVRAISON_2024-06-00178/BDT_3-4_SHP_LAMB93_D0\"+dep+\"-ED2024-06-15/TRANSPORT/PISTE_D_AERODROME.shp\")\n", + " Aerodrome2024=Aerodrome2024[[\"geometry\"]]\n", + " \n", + "\n", + " Artif2024=pd.concat([BatDep2024BUFFok, Parking2024])\n", + " Artif2024_ok=gpd.GeoDataFrame(geometry=[Artif2024.unary_union], crs=\"EPSG:2154\").explode(index_parts=False).reset_index(drop=True)\n", + " Artif2024_ok=Artif2024_ok.dissolve()\n", + " Artif2024_ok=Artif2024_ok.overlay(Bande10kmComLitt_dissolve, how='intersection', keep_geom_type=None, make_valid=True)\n", + " Artif2024_ok.to_file(\"BD_TOPO/Temp/TACHE_ARTIF_BRUTE/TACHE_ARTIF_\"+dep+\"_2024_OK.shp\")" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Jointure spatiale des tâches urbaines littorale 2014 et 2023 avec les découpage par communes et par secteurs littoraux :" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "metadata": {}, + "outputs": [], + "source": [ + "Bande_Littorale_Com=gpd.read_file(\"BANDE_LITTORALE/BANDE_LITTORALE_SECTEURS_COM.shp\")\n", + "dep=[\"56\",\"22\",\"29\",\"35\",\"44\"]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "##### 2014 #####\n", + "TacheUrb2014_22=gpd.read_file(\"BD_TOPO/Temp/TACHE_ARTIF_BRUTE/TACHE_ARTIF_22_2014_OK.shp\")\n", + "TacheUrb2014_29=gpd.read_file(\"BD_TOPO/Temp/TACHE_ARTIF_BRUTE/TACHE_ARTIF_29_2014_OK.shp\")\n", + "TacheUrb2014_56=gpd.read_file(\"BD_TOPO/Temp/TACHE_ARTIF_BRUTE/TACHE_ARTIF_56_2014_OK.shp\")\n", + "TacheUrb2014_35=gpd.read_file(\"BD_TOPO/Temp/TACHE_ARTIF_BRUTE/TACHE_ARTIF_35_2014_OK.shp\")\n", + "TacheUrb2014_44=gpd.read_file(\"BD_TOPO/Temp/TACHE_ARTIF_BRUTE/TACHE_ARTIF_44_2014_OK.shp\")\n", + "TacheUrb2014=gpd.GeoDataFrame(pd.concat([TacheUrb2014_22,TacheUrb2014_29,TacheUrb2014_56,TacheUrb2014_35,TacheUrb2014_44], ignore_index=True))\n", + "TacheUrb2014=gpd.GeoDataFrame(TacheUrb2014, crs=\"EPSG:2154\")\n", + "TacheUrb2014=TacheUrb2014[[\"geometry\"]]\n", + "TacheUrb2014[\"geometry\"]=TacheUrb2014[\"geometry\"].apply(make_valid)\n", + "TacheUrb2014_ok=TacheUrb2014.dissolve()\n", + "TacheUrb2014_ok.to_file(\"BD_TOPO/Temp/TACHE_ARTIF_BZH_Brute_2014.shp\")\n" + ] + }, + { + "cell_type": "code", + "execution_count": 66, + "metadata": {}, + "outputs": [], + "source": [ + "##### 2024 #####\n", + "TacheUrb2024_22=gpd.read_file(\"BD_TOPO/Temp/TACHE_ARTIF_BRUTE/TACHE_ARTIF_22_2024_OK.shp\")\n", + "TacheUrb2024_29=gpd.read_file(\"BD_TOPO/Temp/TACHE_ARTIF_BRUTE/TACHE_ARTIF_29_2024_OK.shp\")\n", + "TacheUrb2024_56=gpd.read_file(\"BD_TOPO/Temp/TACHE_ARTIF_BRUTE/TACHE_ARTIF_56_2024_OK.shp\")\n", + "TacheUrb2024_35=gpd.read_file(\"BD_TOPO/Temp/TACHE_ARTIF_BRUTE/TACHE_ARTIF_35_2024_OK.shp\")\n", + "TacheUrb2024_44=gpd.read_file(\"BD_TOPO/Temp/TACHE_ARTIF_BRUTE/TACHE_ARTIF_44_2024_OK.shp\")\n", + "TacheUrb2024=gpd.GeoDataFrame(pd.concat([TacheUrb2024_22,TacheUrb2024_29,TacheUrb2024_56,TacheUrb2024_35,TacheUrb2024_44], ignore_index=True))\n", + "TacheUrb2024=gpd.GeoDataFrame(TacheUrb2024, crs=\"EPSG:2154\")\n", + "TacheUrb2024=TacheUrb2024[[\"geometry\"]]\n", + "TacheUrb2024[\"geometry\"]=TacheUrb2024[\"geometry\"].apply(make_valid)\n", + "TacheUrb2024_ok=TacheUrb2024.dissolve()\n", + "TacheUrb2024_ok.to_file(\"BD_TOPO/Temp/TACHE_ARTIF_BZH_Brute_2024.shp\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Difference tâches 2014-2024\n", + "Overlay avec les données 2014, pour conserver uniquement les polygones des zones artificialisées entre 2014 et 2024." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Contenu du fichier makefile, à placer dans le même dossier que ce notebook : \n", + "\n", + "\tclean_artif:\n", + "\t\tmapshaper BD_TOPO/Temp/TACHE_ARTIF_BZH_Brute_2014.shp \\\n", + "\t\t-clean gap-fill-area=5000m2 \\\n", + "\t\t-simplify 25% weighting=0.7 keep-shapes \\\n", + "\t\t-clip BANDE_LITTORALE/BANDE_LITTORALE_SECTEURS_COM_BZH.shp \\\n", + "\t\t-o BD_TOPO/Temp/TACHE_ARTIF_BZH_CLEAN_2014.shp \\\n", + "\t\t\n", + "\n", + "\t\tmapshaper BD_TOPO/Temp/TACHE_ARTIF_BZH_Brute_2024.shp \\\n", + "\t\t-clean gap-fill-area=5000m2 \\\n", + "\t\t-simplify 25% weighting=0.7 keep-shapes \\\n", + "\t\t-erase BD_TOPO/Temp/TACHE_ARTIF_BZH_CLEAN_2014.shp \\\n", + "\t\t-o BD_TOPO/Temp/TACHE_ARTIF_BZH_2014_2024.shp\n", + "\n", + "\tclip_artif:\n", + "\t\tmapshaper BANDE_LITTORALE/BANDE_LITTORALE_SECTEURS_COM_BZH.shp \\\n", + "\t\t-clip BD_TOPO/Temp/TACHE_ARTIF_BZH_2014_2024.shp \\\n", + "\t\t-o BD_TOPO/Temp/TACHE_ARTIF_BZH_2014_2024_BandeLitt.shp\n", + "\n", + "\t\tmapshaper BANDE_LITTORALE/BANDE_LITTORALE_SECTEURS_COM_BZH.shp \\\n", + "\t\t-clip BD_TOPO/Temp/TACHE_ARTIF_BZH_CLEAN_2014.shp \\\n", + "\t\t-o BD_TOPO/Temp/TACHE_ARTIF_BZH_2014_BandeLitt.shp\n" + ] + }, + { + "cell_type": "code", + "execution_count": 67, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "python(27484) MallocStackLogging: can't turn off malloc stack logging because it was not enabled.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "mapshaper BD_TOPO/Temp/TACHE_ARTIF_BZH_Brute_2014.shp \\\n", + "\t-clean gap-fill-area=5000m2 \\\n", + "\t-simplify 25% weighting=0.7 keep-shapes \\\n", + "\t-clip BANDE_LITTORALE/BANDE_LITTORALE_SECTEURS_COM_BZH.shp \\\n", + "\t-o BD_TOPO/Temp/TACHE_ARTIF_BZH_CLEAN_2014.shp \\\n", + "\t\n", + "[i] Warning: Shapefile Z data will be lost.\n", + "[clean] Removed 63,419 / 83,920 slivers using 5000+ sqm variable threshold\n", + "[clean] Retained 1 of 1 features\n", + "[simplify] Repaired 55 intersections\n", + "[o] Wrote BD_TOPO/Temp/TACHE_ARTIF_BZH_CLEAN_2014.shp\n", + "[o] Wrote BD_TOPO/Temp/TACHE_ARTIF_BZH_CLEAN_2014.shx\n", + "[o] Wrote BD_TOPO/Temp/TACHE_ARTIF_BZH_CLEAN_2014.dbf\n", + "[o] Wrote BD_TOPO/Temp/TACHE_ARTIF_BZH_CLEAN_2014.prj\n", + "mapshaper BD_TOPO/Temp/TACHE_ARTIF_BZH_Brute_2024.shp \\\n", + "\t-clean gap-fill-area=5000m2 \\\n", + "\t-simplify 25% weighting=0.7 keep-shapes \\\n", + "\t-erase BD_TOPO/Temp/TACHE_ARTIF_BZH_CLEAN_2014.shp \\\n", + "\t-o BD_TOPO/Temp/TACHE_ARTIF_BZH_2014_2024.shp\n", + "[i] Warning: Shapefile Z data will be lost.\n", + "[clean] Removed 376 / 2,711 slivers using 5000+ sqm variable threshold\n", + "[clean] Retained 1 of 1 features\n", + "[simplify] Repaired 6 intersections\n", + "[o] Wrote BD_TOPO/Temp/TACHE_ARTIF_BZH_2014_2024.shp\n", + "[o] Wrote BD_TOPO/Temp/TACHE_ARTIF_BZH_2014_2024.shx\n", + "[o] Wrote BD_TOPO/Temp/TACHE_ARTIF_BZH_2014_2024.dbf\n", + "[o] Wrote BD_TOPO/Temp/TACHE_ARTIF_BZH_2014_2024.prj\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "python(27736) MallocStackLogging: can't turn off malloc stack logging because it was not enabled.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "mapshaper BANDE_LITTORALE/BANDE_LITTORALE_SECTEURS_COM_BZH.shp \\\n", + "\t-clip BD_TOPO/Temp/TACHE_ARTIF_BZH_2014_2024.shp \\\n", + "\t-o BD_TOPO/Temp/TACHE_ARTIF_BZH_2014_2024_BandeLitt.shp\n", + "[o] Wrote BD_TOPO/Temp/TACHE_ARTIF_BZH_2014_2024_BandeLitt.shp\n", + "[o] Wrote BD_TOPO/Temp/TACHE_ARTIF_BZH_2014_2024_BandeLitt.shx\n", + "[o] Wrote BD_TOPO/Temp/TACHE_ARTIF_BZH_2014_2024_BandeLitt.dbf\n", + "[o] Wrote BD_TOPO/Temp/TACHE_ARTIF_BZH_2014_2024_BandeLitt.prj\n", + "mapshaper BANDE_LITTORALE/BANDE_LITTORALE_SECTEURS_COM_BZH.shp \\\n", + "\t-clip BD_TOPO/Temp/TACHE_ARTIF_BZH_CLEAN_2014.shp \\\n", + "\t-o BD_TOPO/Temp/TACHE_ARTIF_BZH_2014_BandeLitt.shp\n", + "[o] Wrote BD_TOPO/Temp/TACHE_ARTIF_BZH_2014_BandeLitt.shp\n", + "[o] Wrote BD_TOPO/Temp/TACHE_ARTIF_BZH_2014_BandeLitt.shx\n", + "[o] Wrote BD_TOPO/Temp/TACHE_ARTIF_BZH_2014_BandeLitt.dbf\n", + "[o] Wrote BD_TOPO/Temp/TACHE_ARTIF_BZH_2014_BandeLitt.prj\n" + ] + } + ], + "source": [ + "!make clean_artif\n", + "!make clip_artif" + ] + }, + { + "cell_type": "code", + "execution_count": 68, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/var/folders/zf/sc5qjn6x54b02sbxg3k9jbkr0000gn/T/ipykernel_37896/1985593679.py:8: UserWarning: Column names longer than 10 characters will be truncated when saved to ESRI Shapefile.\n", + " Artif_2014_2024.to_file(\"BD_TOPO/Temp/TACHE_ARTIF_BZH_2014_2024_BandeLitt_FILTRE.shp\")\n", + "/Users/denisvannier/opt/anaconda3/envs/GEODATA2/lib/python3.9/site-packages/pyogrio/raw.py:709: RuntimeWarning: Normalized/laundered field name: 'Artif2024_m2' to 'Artif2024_'\n", + " ogr_write(\n" + ] + } + ], + "source": [ + "Artif_2014_2024=gpd.read_file(\"BD_TOPO/Temp/TACHE_ARTIF_BZH_2014_2024_BandeLitt.shp\")\n", + "Artif_2014_2024=Artif_2014_2024.explode(ignore_index=True)\n", + "Artif_2014_2024[\"Artif2024_m2\"]=Artif_2014_2024[\"geometry\"].area\n", + "\n", + "# Filtrage des polygones d'au moins 500m2 :\n", + "Artif_2014_2024=Artif_2014_2024[Artif_2014_2024[\"Artif2024_m2\"]>=500]\n", + "Artif_2014_2024.to_file(\"BD_TOPO/Temp/TACHE_ARTIF_BZH_2014_2024_BandeLitt_FILTRE.geojson\")\n", + "Artif_2014_2024.to_file(\"BD_TOPO/Temp/TACHE_ARTIF_BZH_2014_2024_BandeLitt_FILTRE.shp\")" + ] + }, + { + "cell_type": "code", + "execution_count": 69, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "python(29182) MallocStackLogging: can't turn off malloc stack logging because it was not enabled.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "mapshaper BD_TOPO/Temp/TACHE_ARTIF_BZH_2014_2024_BandeLitt_FILTRE.geojson \\\n", + "\t-simplify 50% \\\n", + "\t-clean \\\n", + "\t-o BD_TOPO/Temp/TACHE_ARTIF_BZH_2014_2024_BandeLitt_FILTRE_simplif.geojson\n", + "[simplify] Repaired 1,505 intersections\n", + "[clean] Retained 20,383 of 20,385 features\n", + "[o] RFC 7946 warning: non-WGS84 GeoJSON output.\n", + "[o] Wrote BD_TOPO/Temp/TACHE_ARTIF_BZH_2014_2024_BandeLitt_FILTRE_simplif.geojson\n", + "\n", + "RangeIndex: 1588 entries, 0 to 1587\n", + "Data columns (total 10 columns):\n", + " # Column Non-Null Count Dtype \n", + "--- ------ -------------- ----- \n", + " 0 ID_COM_LITT 1588 non-null object \n", + " 1 BANDE_LITT 1588 non-null object \n", + " 2 numdep 1588 non-null object \n", + " 3 INSEE_COM 1588 non-null object \n", + " 4 NOM_COMMUNE 1588 non-null object \n", + " 5 SIREN_EPCI 1588 non-null object \n", + " 6 NOM_EPCI 1583 non-null object \n", + " 7 SURFACE_M2 1588 non-null float64 \n", + " 8 Artif2024_m2 1588 non-null float64 \n", + " 9 geometry 1588 non-null geometry\n", + "dtypes: float64(2), geometry(1), object(7)\n", + "memory usage: 124.2+ KB\n" + ] + } + ], + "source": [ + "# Contenu du fichier makefile : \n", + "# mapshaper BD_TOPO/Temp/TACHE_ARTIF_BZH_2014_2024_BandeLitt_FILTRE.shp -simplify 50% -clean -o BD_TOPO/Temp/TACHE_ARTIF_BZH_2014_2024_BandeLitt_FILTRE_simplif.shp\n", + "! make simplifier\n", + "\n", + "Artif_2014_2024=gpd.read_file(\"BD_TOPO/Temp/TACHE_ARTIF_BZH_2014_2024_BandeLitt_FILTRE_simplif.geojson\")\n", + "Artif_2014_2024[\"ID_COM_LITT\"]=Artif_2014_2024[\"INSEE_COM\"]+\"_\"+Artif_2014_2024[\"BANDE_LITT\"]\n", + "Artif_2014_2024=Artif_2014_2024.dissolve(by=\"ID_COM_LITT\", as_index=False)\n", + "Artif_2014_2024=gpd.GeoDataFrame(Artif_2014_2024, geometry=\"geometry\", crs=\"EPSG:2154\")\n", + "\n", + "# Le nom de la commune a été modifié durant les transformations avec Mapshaper. \n", + "# On récupère les noms corrects :\n", + "epci=pd.read_csv(\"BANDE_LITTORALE/BANDE_LITTORALE_SECTEURS_COM_BZH_STATS.csv\")\n", + "epci=epci[[\"BANDE_LITT\",\"INSEE_COM\", \"NOM\", 'SIREN_EPCI', 'NOM_EPCI']]\n", + "epci[\"INSEE_COM\"]=epci[\"INSEE_COM\"].astype(\"str\")\n", + "epci[\"ID_COM_LITT\"]=epci[\"INSEE_COM\"]+\"_\"+epci[\"BANDE_LITT\"]\n", + "epci=epci[['ID_COM_LITT','NOM','SIREN_EPCI', 'NOM_EPCI']]\n", + "Artif_2014_2024=Artif_2014_2024[['ID_COM_LITT', 'geometry', 'BANDE_LITT', 'INSEE_COM', 'numdep', 'SURFACE_M2', 'Artif2024_m2']]\n", + "Artif_2014_2024=Artif_2014_2024.merge(epci, on=\"ID_COM_LITT\", how=\"left\")\n", + "\n", + "Artif_2014_2024[\"Artif2024_m2\"]=Artif_2014_2024[\"geometry\"].area\n", + "Artif_2014_2024=Artif_2014_2024.to_crs(\"epsg:4326\")\n", + "Artif_2014_2024.rename(columns={\"NOM\":\"NOM_COMMUNE\"}, inplace=True)\n", + "Artif_2014_2024=Artif_2014_2024[['ID_COM_LITT', 'BANDE_LITT', 'numdep', 'INSEE_COM', 'NOM_COMMUNE', 'SIREN_EPCI', 'NOM_EPCI', 'SURFACE_M2','Artif2024_m2', 'geometry']]\n", + "Artif_2014_2024[\"SURFACE_M2\"]=Artif_2014_2024[\"SURFACE_M2\"].round(0)\n", + "Artif_2014_2024[\"Artif2024_m2\"]=Artif_2014_2024[\"Artif2024_m2\"].round(0)\n", + "\n", + "Artif_2014_2024.to_file(\"BD_TOPO/TACHE_ARTIF_BZH_2014_2024_BandeLitt_DEF.geojson\")\n", + "Artif_2014_2024.info()" + ] + }, + { + "cell_type": "code", + "execution_count": 70, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "RangeIndex: 1973 entries, 0 to 1972\n", + "Data columns (total 11 columns):\n", + " # Column Non-Null Count Dtype \n", + "--- ------ -------------- ----- \n", + " 0 ID_COM_LITT 1973 non-null object \n", + " 1 BANDE_LITT 1973 non-null object \n", + " 2 numdep 1973 non-null object \n", + " 3 INSEE_COM 1973 non-null object \n", + " 4 NOM_COMMUNE 1973 non-null object \n", + " 5 SIREN_EPCI 1973 non-null object \n", + " 6 NOM_EPCI 1963 non-null object \n", + " 7 SURFACE_M2 1973 non-null float64 \n", + " 8 Artif2014_m2 1973 non-null float64 \n", + " 9 Part_Artif2014 1973 non-null float64 \n", + " 10 geometry 1973 non-null geometry\n", + "dtypes: float64(3), geometry(1), object(7)\n", + "memory usage: 169.7+ KB\n" + ] + } + ], + "source": [ + "Artif_2014=gpd.read_file(\"BD_TOPO/Temp/TACHE_ARTIF_BZH_2014_BandeLitt.shp\")\n", + "Artif_2014[\"ID_COM_LITT\"]=Artif_2014[\"INSEE_COM\"]+\"_\"+Artif_2014[\"BANDE_LITT\"]\n", + "Artif_2014=Artif_2014.dissolve(by=\"ID_COM_LITT\", as_index=False)\n", + "Artif_2014[\"Artif2014_m2\"]=Artif_2014[\"geometry\"].area\n", + "\n", + "# Le nom de la commune a été modifié durant les transformations avec Mapshaper. \n", + "# On récupère les noms corrects :\n", + "epci=pd.read_csv(\"BANDE_LITTORALE/BANDE_LITTORALE_SECTEURS_COM_BZH_STATS.csv\")\n", + "epci=epci[[\"BANDE_LITT\",\"INSEE_COM\", \"NOM\", 'SIREN_EPCI', 'NOM_EPCI']]\n", + "epci[\"INSEE_COM\"]=epci[\"INSEE_COM\"].astype(\"str\")\n", + "epci[\"ID_COM_LITT\"]=epci[\"INSEE_COM\"]+\"_\"+epci[\"BANDE_LITT\"]\n", + "epci=epci[['ID_COM_LITT','NOM', 'SIREN_EPCI', 'NOM_EPCI']]\n", + "Artif_2014=Artif_2014[['ID_COM_LITT', 'geometry', 'BANDE_LITT', 'INSEE_COM','numdep', 'SURFACE_M2', 'Artif2014_m2']]\n", + "Artif_2014=Artif_2014.merge(epci, on=\"ID_COM_LITT\", how=\"left\")\n", + "\n", + "Artif_2014=Artif_2014.to_crs(\"epsg:4326\")\n", + "Artif_2014[\"Part_Artif2014\"]=(Artif_2014[\"Artif2014_m2\"]/Artif_2014[\"SURFACE_M2\"])*100\n", + "Artif_2014.rename(columns={\"NOM\":\"NOM_COMMUNE\"}, inplace=True)\n", + "Artif_2014=Artif_2014[['ID_COM_LITT', 'BANDE_LITT', 'numdep', 'INSEE_COM', 'NOM_COMMUNE', 'SIREN_EPCI', 'NOM_EPCI', 'SURFACE_M2','Artif2014_m2', 'Part_Artif2014', 'geometry']]\n", + "Artif_2014[\"SURFACE_M2\"]=Artif_2014[\"SURFACE_M2\"].round(0)\n", + "Artif_2014[\"Artif2014_m2\"]=Artif_2014[\"Artif2014_m2\"].round(0)\n", + "Artif_2014[\"Part_Artif2014\"]=Artif_2014[\"Part_Artif2014\"].round(0)\n", + "\n", + "Artif_2014.to_file(\"BD_TOPO/TACHE_ARTIF_BZH_2014_BandeLitt_DEF.geojson\")\n", + "Artif_2014.info()" + ] + }, + { + "cell_type": "code", + "execution_count": 71, + "metadata": {}, + "outputs": [], + "source": [ + "### Filtrage de la tache artif à moins de 5km du rivage :\n", + "Artif_2014_5km=Artif_2014[Artif_2014[\"BANDE_LITT\"]!=\"5_10km\"]\n", + "Artif_2014_5km.to_file(\"BD_TOPO/TACHE_ARTIF_5km_BZH_2014_BandeLitt_DEF.geojson\")\n", + "\n", + "Artif_2014_2024_5km=Artif_2014_2024[Artif_2014_2024[\"BANDE_LITT\"]!=\"5_10km\"]\n", + "Artif_2014_2024_5km.to_file(\"BD_TOPO/TACHE_ARTIF_5km_BZH_2014_2024_BandeLitt_DEF.geojson\")\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# =====================================" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Synthèse par secteurs de communes sur la bande littoral de 0 à 5km:" + ] + }, + { + "cell_type": "code", + "execution_count": 72, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "RangeIndex: 1583 entries, 0 to 1582\n", + "Data columns (total 12 columns):\n", + " # Column Non-Null Count Dtype \n", + "--- ------ -------------- ----- \n", + " 0 ID_COM_LITT 1583 non-null object \n", + " 1 BANDE_LITT 1583 non-null object \n", + " 2 numdep 1583 non-null object \n", + " 3 INSEE_COM 1583 non-null object \n", + " 4 NOM_COMMUNE 1583 non-null object \n", + " 5 SIREN_EPCI 1583 non-null object \n", + " 6 NOM_EPCI 1573 non-null object \n", + " 7 SURFACE_M2 1583 non-null float64\n", + " 8 Artif2014_m2 1583 non-null float64\n", + " 9 Part_Artif2014 1583 non-null float64\n", + " 10 Artif2024_m2 1583 non-null float64\n", + " 11 EvolArtif 1583 non-null float64\n", + "dtypes: float64(5), object(7)\n", + "memory usage: 148.5+ KB\n" + ] + }, + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
ID_COM_LITTBANDE_LITTnumdepINSEE_COMNOM_COMMUNESIREN_EPCINOM_EPCISURFACE_M2Artif2014_m2Part_Artif2014Artif2024_m2EvolArtif
022002_1_5km1_5km2222002Andel200069391CA Lamballe Terre et Mer751418.00000000054802.0000000007.0000000000.0000000000.000000000
122012_1_5km1_5km2222012La Bouillie200069391CA Lamballe Terre et Mer4552934.000000000298823.0000000007.0000000001551.0000000001.000000000
222016_100_200m100_200m2222016Île-de-BréhatNRNone882124.000000000434661.00000000049.0000000002598.0000000001.000000000
322016_100m100m2222016Île-de-BréhatNRNone1841480.000000000497758.00000000027.0000000003226.0000000001.000000000
422016_200_500m200_500m2222016Île-de-BréhatNRNone393226.000000000209530.00000000053.0000000002330.0000000001.000000000
522028_1_5km1_5km2222028Camlez200065928CA Lannion-Trégor Communauté5038288.000000000505702.00000000010.00000000057843.00000000011.000000000
622042_1_5km1_5km2222042Coatréven200065928CA Lannion-Trégor Communauté9112.000000000198.0000000002.0000000000.0000000000.000000000
722044_1_5km1_5km2222044Coëtmieux200069391CA Lamballe Terre et Mer2147798.000000000330934.00000000015.00000000041291.00000000012.000000000
822049_100_200m100_200m2222049Créhen200068989CA Dinan Agglomération112985.00000000024431.00000000022.0000000000.0000000000.000000000
922049_100m100m2222049Créhen200068989CA Dinan Agglomération93818.00000000037156.00000000040.0000000000.0000000000.000000000
1022049_1_5km1_5km2222049Créhen200068989CA Dinan Agglomération9375213.0000000001270570.00000000014.00000000071305.0000000006.000000000
1122049_200_500m200_500m2222049Créhen200068989CA Dinan Agglomération381572.00000000052943.00000000014.0000000000.0000000000.000000000
1222049_500m_1km500m_1km2222049Créhen200068989CA Dinan Agglomération613247.00000000052304.0000000009.0000000002184.0000000004.000000000
1322050_1_5km1_5km2222050Dinan200068989CA Dinan Agglomération669980.000000000486409.00000000073.0000000002247.0000000000.000000000
1422054_100_200m100_200m2222054Erquy200069391CA Lamballe Terre et Mer1393980.000000000427294.00000000031.0000000005215.0000000001.000000000
1522054_100m100m2222054Erquy200069391CA Lamballe Terre et Mer1471078.000000000308716.00000000021.0000000006071.0000000002.000000000
1622054_1_5km1_5km2222054Erquy200069391CA Lamballe Terre et Mer14560463.0000000002359171.00000000016.000000000107159.0000000005.000000000
1722054_200_500m200_500m2222054Erquy200069391CA Lamballe Terre et Mer3748701.0000000001269104.00000000034.00000000034090.0000000003.000000000
1822054_500m_1km500m_1km2222054Erquy200069391CA Lamballe Terre et Mer5235506.0000000001559598.00000000030.00000000088452.0000000006.000000000
1922055_100_200m100_200m2222055Binic-Étables-sur-Mer200069409CA Saint-Brieuc Armor Agglomération799549.000000000397329.00000000050.0000000009244.0000000002.000000000
2022055_100m100m2222055Binic-Étables-sur-Mer200069409CA Saint-Brieuc Armor Agglomération831513.000000000262969.00000000032.0000000007059.0000000003.000000000
2122055_1_5km1_5km2222055Binic-Étables-sur-Mer200069409CA Saint-Brieuc Armor Agglomération7472319.0000000001400120.00000000019.00000000072824.0000000005.000000000
2222055_200_500m200_500m2222055Binic-Étables-sur-Mer200069409CA Saint-Brieuc Armor Agglomération2261824.0000000001370701.00000000061.00000000027311.0000000002.000000000
2322055_500m_1km500m_1km2222055Binic-Étables-sur-Mer200069409CA Saint-Brieuc Armor Agglomération3655638.0000000002474047.00000000068.00000000019605.0000000001.000000000
2422076_1_5km1_5km2222076Hénanbihen200069391CA Lamballe Terre et Mer2687334.000000000158601.0000000006.0000000004298.0000000003.000000000
2522081_100_200m100_200m2222081Hillion200069409CA Saint-Brieuc Armor Agglomération1045027.00000000089467.0000000009.0000000003870.0000000004.000000000
2622081_100m100m2222081Hillion200069409CA Saint-Brieuc Armor Agglomération1068833.00000000045793.0000000004.0000000000.0000000000.000000000
2722081_1_5km1_5km2222081Hillion200069409CA Saint-Brieuc Armor Agglomération15120894.0000000002259039.00000000015.000000000127561.0000000006.000000000
2822081_200_500m200_500m2222081Hillion200069409CA Saint-Brieuc Armor Agglomération2984448.000000000522561.00000000018.00000000040885.0000000008.000000000
2922081_500m_1km500m_1km2222081Hillion200069409CA Saint-Brieuc Armor Agglomération4342722.000000000814012.00000000019.00000000073397.0000000009.000000000
\n", + "
" + ], + "text/plain": [ + " ID_COM_LITT BANDE_LITT numdep INSEE_COM NOM_COMMUNE \\\n", + "0 22002_1_5km 1_5km 22 22002 Andel \n", + "1 22012_1_5km 1_5km 22 22012 La Bouillie \n", + "2 22016_100_200m 100_200m 22 22016 Île-de-Bréhat \n", + "3 22016_100m 100m 22 22016 Île-de-Bréhat \n", + "4 22016_200_500m 200_500m 22 22016 Île-de-Bréhat \n", + "5 22028_1_5km 1_5km 22 22028 Camlez \n", + "6 22042_1_5km 1_5km 22 22042 Coatréven \n", + "7 22044_1_5km 1_5km 22 22044 Coëtmieux \n", + "8 22049_100_200m 100_200m 22 22049 Créhen \n", + "9 22049_100m 100m 22 22049 Créhen \n", + "10 22049_1_5km 1_5km 22 22049 Créhen \n", + "11 22049_200_500m 200_500m 22 22049 Créhen \n", + "12 22049_500m_1km 500m_1km 22 22049 Créhen \n", + "13 22050_1_5km 1_5km 22 22050 Dinan \n", + "14 22054_100_200m 100_200m 22 22054 Erquy \n", + "15 22054_100m 100m 22 22054 Erquy \n", + "16 22054_1_5km 1_5km 22 22054 Erquy \n", + "17 22054_200_500m 200_500m 22 22054 Erquy \n", + "18 22054_500m_1km 500m_1km 22 22054 Erquy \n", + "19 22055_100_200m 100_200m 22 22055 Binic-Étables-sur-Mer \n", + "20 22055_100m 100m 22 22055 Binic-Étables-sur-Mer \n", + "21 22055_1_5km 1_5km 22 22055 Binic-Étables-sur-Mer \n", + "22 22055_200_500m 200_500m 22 22055 Binic-Étables-sur-Mer \n", + "23 22055_500m_1km 500m_1km 22 22055 Binic-Étables-sur-Mer \n", + "24 22076_1_5km 1_5km 22 22076 Hénanbihen \n", + "25 22081_100_200m 100_200m 22 22081 Hillion \n", + "26 22081_100m 100m 22 22081 Hillion \n", + "27 22081_1_5km 1_5km 22 22081 Hillion \n", + "28 22081_200_500m 200_500m 22 22081 Hillion \n", + "29 22081_500m_1km 500m_1km 22 22081 Hillion \n", + "\n", + " SIREN_EPCI NOM_EPCI SURFACE_M2 \\\n", + "0 200069391 CA Lamballe Terre et Mer 751418.000000000 \n", + "1 200069391 CA Lamballe Terre et Mer 4552934.000000000 \n", + "2 NR None 882124.000000000 \n", + "3 NR None 1841480.000000000 \n", + "4 NR None 393226.000000000 \n", + "5 200065928 CA Lannion-Trégor Communauté 5038288.000000000 \n", + "6 200065928 CA Lannion-Trégor Communauté 9112.000000000 \n", + "7 200069391 CA Lamballe Terre et Mer 2147798.000000000 \n", + "8 200068989 CA Dinan Agglomération 112985.000000000 \n", + "9 200068989 CA Dinan Agglomération 93818.000000000 \n", + "10 200068989 CA Dinan Agglomération 9375213.000000000 \n", + "11 200068989 CA Dinan Agglomération 381572.000000000 \n", + "12 200068989 CA Dinan Agglomération 613247.000000000 \n", + "13 200068989 CA Dinan Agglomération 669980.000000000 \n", + "14 200069391 CA Lamballe Terre et Mer 1393980.000000000 \n", + "15 200069391 CA Lamballe Terre et Mer 1471078.000000000 \n", + "16 200069391 CA Lamballe Terre et Mer 14560463.000000000 \n", + "17 200069391 CA Lamballe Terre et Mer 3748701.000000000 \n", + "18 200069391 CA Lamballe Terre et Mer 5235506.000000000 \n", + "19 200069409 CA Saint-Brieuc Armor Agglomération 799549.000000000 \n", + "20 200069409 CA Saint-Brieuc Armor Agglomération 831513.000000000 \n", + "21 200069409 CA Saint-Brieuc Armor Agglomération 7472319.000000000 \n", + "22 200069409 CA Saint-Brieuc Armor Agglomération 2261824.000000000 \n", + "23 200069409 CA Saint-Brieuc Armor Agglomération 3655638.000000000 \n", + "24 200069391 CA Lamballe Terre et Mer 2687334.000000000 \n", + "25 200069409 CA Saint-Brieuc Armor Agglomération 1045027.000000000 \n", + "26 200069409 CA Saint-Brieuc Armor Agglomération 1068833.000000000 \n", + "27 200069409 CA Saint-Brieuc Armor Agglomération 15120894.000000000 \n", + "28 200069409 CA Saint-Brieuc Armor Agglomération 2984448.000000000 \n", + "29 200069409 CA Saint-Brieuc Armor Agglomération 4342722.000000000 \n", + "\n", + " Artif2014_m2 Part_Artif2014 Artif2024_m2 EvolArtif \n", + "0 54802.000000000 7.000000000 0.000000000 0.000000000 \n", + "1 298823.000000000 7.000000000 1551.000000000 1.000000000 \n", + "2 434661.000000000 49.000000000 2598.000000000 1.000000000 \n", + "3 497758.000000000 27.000000000 3226.000000000 1.000000000 \n", + "4 209530.000000000 53.000000000 2330.000000000 1.000000000 \n", + "5 505702.000000000 10.000000000 57843.000000000 11.000000000 \n", + "6 198.000000000 2.000000000 0.000000000 0.000000000 \n", + "7 330934.000000000 15.000000000 41291.000000000 12.000000000 \n", + "8 24431.000000000 22.000000000 0.000000000 0.000000000 \n", + "9 37156.000000000 40.000000000 0.000000000 0.000000000 \n", + "10 1270570.000000000 14.000000000 71305.000000000 6.000000000 \n", + "11 52943.000000000 14.000000000 0.000000000 0.000000000 \n", + "12 52304.000000000 9.000000000 2184.000000000 4.000000000 \n", + "13 486409.000000000 73.000000000 2247.000000000 0.000000000 \n", + "14 427294.000000000 31.000000000 5215.000000000 1.000000000 \n", + "15 308716.000000000 21.000000000 6071.000000000 2.000000000 \n", + "16 2359171.000000000 16.000000000 107159.000000000 5.000000000 \n", + "17 1269104.000000000 34.000000000 34090.000000000 3.000000000 \n", + "18 1559598.000000000 30.000000000 88452.000000000 6.000000000 \n", + "19 397329.000000000 50.000000000 9244.000000000 2.000000000 \n", + "20 262969.000000000 32.000000000 7059.000000000 3.000000000 \n", + "21 1400120.000000000 19.000000000 72824.000000000 5.000000000 \n", + "22 1370701.000000000 61.000000000 27311.000000000 2.000000000 \n", + "23 2474047.000000000 68.000000000 19605.000000000 1.000000000 \n", + "24 158601.000000000 6.000000000 4298.000000000 3.000000000 \n", + "25 89467.000000000 9.000000000 3870.000000000 4.000000000 \n", + "26 45793.000000000 4.000000000 0.000000000 0.000000000 \n", + "27 2259039.000000000 15.000000000 127561.000000000 6.000000000 \n", + "28 522561.000000000 18.000000000 40885.000000000 8.000000000 \n", + "29 814012.000000000 19.000000000 73397.000000000 9.000000000 " + ] + }, + "execution_count": 72, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Fichier CSV des surfaces par communes et par bande littorale :\n", + "Artif_2014=gpd.read_file(\"BD_TOPO/TACHE_ARTIF_5km_BZH_2014_BandeLitt_DEF.geojson\")\n", + "Artif_2014_Bilan=Artif_2014[['ID_COM_LITT','BANDE_LITT', 'numdep', 'INSEE_COM', 'NOM_COMMUNE','SIREN_EPCI','NOM_EPCI',\n", + " 'SURFACE_M2', 'Artif2014_m2', 'Part_Artif2014']]\n", + "Artif_2014_2024=gpd.read_file(\"BD_TOPO/TACHE_ARTIF_5km_BZH_2014_2024_BandeLitt_DEF.geojson\")\n", + "Artif_2014_2024_Bilan=Artif_2014_2024[['ID_COM_LITT','Artif2024_m2']]\n", + "\n", + "Artif_Bilan=Artif_2014_Bilan.merge(Artif_2014_2024_Bilan, on=\"ID_COM_LITT\", how=\"left\")\n", + "Artif_Bilan[\"Artif2024_m2\"]=Artif_Bilan[\"Artif2024_m2\"].fillna(0)\n", + "Artif_Bilan[\"EvolArtif\"]=(Artif_Bilan[\"Artif2024_m2\"]/Artif_Bilan[\"Artif2014_m2\"])*100\n", + "Artif_Bilan[\"EvolArtif\"]=Artif_Bilan[\"EvolArtif\"].round(0)\n", + "Artif_Bilan.to_csv(\"Bilan_Artif_BDTopo_COMBandeLitt_2014-2024.csv\")\n", + "Artif_Bilan.info()\n", + "Artif_Bilan.head(30)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Synthèse par communes :" + ] + }, + { + "cell_type": "code", + "execution_count": 73, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
INSEE_COMNOM_COMMUNESIREN_EPCINOM_EPCISURFACE_M2Artif2014_m2Artif2024_m2Part_Artif2014EvolArtif
022002Andel200069391CA Lamballe Terre et Mer751418.00000000054802.0000000000.0000000007.0000000000.000000000
122012La Bouillie200069391CA Lamballe Terre et Mer4552934.000000000298823.0000000001551.0000000007.0000000001.000000000
222028Camlez200065928CA Lannion-Trégor Communauté5038288.000000000505702.00000000057843.00000000010.00000000011.000000000
322042Coatréven200065928CA Lannion-Trégor Communauté9112.000000000198.0000000000.0000000002.0000000000.000000000
422044Coëtmieux200069391CA Lamballe Terre et Mer2147798.000000000330934.00000000041291.00000000015.00000000012.000000000
522049Créhen200068989CA Dinan Agglomération10576835.0000000001437404.00000000073489.00000000014.0000000005.000000000
622050Dinan200068989CA Dinan Agglomération669980.000000000486409.0000000002247.00000000073.0000000000.000000000
722054Erquy200069391CA Lamballe Terre et Mer26409728.0000000005923883.000000000240987.00000000022.0000000004.000000000
822055Binic-Étables-sur-Mer200069409CA Saint-Brieuc Armor Agglomération15020843.0000000005905166.000000000136043.00000000039.0000000002.000000000
922076Hénanbihen200069391CA Lamballe Terre et Mer2687334.000000000158601.0000000004298.0000000006.0000000003.000000000
\n", + "
" + ], + "text/plain": [ + " INSEE_COM NOM_COMMUNE SIREN_EPCI \\\n", + "0 22002 Andel 200069391 \n", + "1 22012 La Bouillie 200069391 \n", + "2 22028 Camlez 200065928 \n", + "3 22042 Coatréven 200065928 \n", + "4 22044 Coëtmieux 200069391 \n", + "5 22049 Créhen 200068989 \n", + "6 22050 Dinan 200068989 \n", + "7 22054 Erquy 200069391 \n", + "8 22055 Binic-Étables-sur-Mer 200069409 \n", + "9 22076 Hénanbihen 200069391 \n", + "\n", + " NOM_EPCI SURFACE_M2 Artif2014_m2 \\\n", + "0 CA Lamballe Terre et Mer 751418.000000000 54802.000000000 \n", + "1 CA Lamballe Terre et Mer 4552934.000000000 298823.000000000 \n", + "2 CA Lannion-Trégor Communauté 5038288.000000000 505702.000000000 \n", + "3 CA Lannion-Trégor Communauté 9112.000000000 198.000000000 \n", + "4 CA Lamballe Terre et Mer 2147798.000000000 330934.000000000 \n", + "5 CA Dinan Agglomération 10576835.000000000 1437404.000000000 \n", + "6 CA Dinan Agglomération 669980.000000000 486409.000000000 \n", + "7 CA Lamballe Terre et Mer 26409728.000000000 5923883.000000000 \n", + "8 CA Saint-Brieuc Armor Agglomération 15020843.000000000 5905166.000000000 \n", + "9 CA Lamballe Terre et Mer 2687334.000000000 158601.000000000 \n", + "\n", + " Artif2024_m2 Part_Artif2014 EvolArtif \n", + "0 0.000000000 7.000000000 0.000000000 \n", + "1 1551.000000000 7.000000000 1.000000000 \n", + "2 57843.000000000 10.000000000 11.000000000 \n", + "3 0.000000000 2.000000000 0.000000000 \n", + "4 41291.000000000 15.000000000 12.000000000 \n", + "5 73489.000000000 14.000000000 5.000000000 \n", + "6 2247.000000000 73.000000000 0.000000000 \n", + "7 240987.000000000 22.000000000 4.000000000 \n", + "8 136043.000000000 39.000000000 2.000000000 \n", + "9 4298.000000000 6.000000000 3.000000000 " + ] + }, + "execution_count": 73, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "Artif_BilanCom=Artif_Bilan.groupby(by=[\"INSEE_COM\", \"NOM_COMMUNE\",\"SIREN_EPCI\", \"NOM_EPCI\"], as_index=False).agg(\n", + " SURFACE_M2=(\"SURFACE_M2\",\"sum\"),\n", + " Artif2014_m2=(\"Artif2014_m2\",\"sum\"),\n", + " Artif2024_m2=(\"Artif2024_m2\",\"sum\"),\n", + ")\n", + "Artif_BilanCom[\"Part_Artif2014\"]=(Artif_BilanCom[\"Artif2014_m2\"]/Artif_BilanCom[\"SURFACE_M2\"])*100\n", + "Artif_BilanCom[\"Part_Artif2014\"]=Artif_BilanCom[\"Part_Artif2014\"].round(0)\n", + "Artif_BilanCom[\"EvolArtif\"]=(Artif_BilanCom[\"Artif2024_m2\"]/Artif_BilanCom[\"Artif2014_m2\"])*100\n", + "Artif_BilanCom[\"EvolArtif\"]=Artif_BilanCom[\"EvolArtif\"].round(0)\n", + "\n", + "Artif_BilanCom.to_csv(\"Bilan_Artif_BDTopo_Com_2014-2024.csv\")\n", + "Artif_BilanCom.head(10)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "DATAXPLORE", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.19" + }, + "orig_nbformat": 4, + "vscode": { + "interpreter": { + "hash": "375f3d611b5238bc734cda3c649c29caee2849da8d5fb7814243c33fcb6d771d" + } + } + }, + "nbformat": 4, + "nbformat_minor": 2 +}