From c03719e0cca1376fb333852af1b09f96d16cf446 Mon Sep 17 00:00:00 2001 From: Ludovic Moncla <300641+ludovicmoncla@users.noreply.github.com> Date: Thu, 29 Sep 2022 14:03:42 +0200 Subject: [PATCH] Update Tutoriel-geoparsing.ipynb --- Tutoriel-geoparsing.ipynb | 4273 +++++++++++++++++++++++++++++++++++-- 1 file changed, 4097 insertions(+), 176 deletions(-) diff --git a/Tutoriel-geoparsing.ipynb b/Tutoriel-geoparsing.ipynb index 866711c..cb0a5bd 100644 --- a/Tutoriel-geoparsing.ipynb +++ b/Tutoriel-geoparsing.ipynb @@ -46,13 +46,6 @@ "* Si vous exécutez ce notebook depuis Google Colab / Binder, vous devez exécuter la cellule suivante :" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n" - ] - }, { "cell_type": "code", "execution_count": null, @@ -75,7 +68,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ @@ -101,7 +94,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -114,7 +107,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -131,9 +124,17 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "* ARQUES, (Géog.) petite ville de France, en Normandie, au pays de Caux, sur la petite riviere d'Arques. Long. 18. 50. lat. 49. 54.\n" + ] + } + ], "source": [ "print(arques)" ] @@ -160,7 +161,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ @@ -177,9 +178,30 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "<class 'pandas.core.frame.DataFrame'>\n", + "RangeIndex: 3385 entries, 0 to 3384\n", + "Data columns (total 7 columns):\n", + " # Column Non-Null Count Dtype \n", + "--- ------ -------------- ----- \n", + " 0 filename 3385 non-null object\n", + " 1 volume 3385 non-null int64 \n", + " 2 number 3385 non-null int64 \n", + " 3 head 3384 non-null object\n", + " 4 normClass 3384 non-null object\n", + " 5 author 3384 non-null object\n", + " 6 text 3385 non-null object\n", + "dtypes: int64(2), object(5)\n", + "memory usage: 185.2+ KB\n" + ] + } + ], "source": [ "data_artfl.info()" ] @@ -195,7 +217,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": {}, "outputs": [], "source": [ @@ -211,9 +233,30 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "<class 'pandas.core.frame.DataFrame'>\n", + "Int64Index: 3384 entries, 0 to 3384\n", + "Data columns (total 7 columns):\n", + " # Column Non-Null Count Dtype \n", + "--- ------ -------------- ----- \n", + " 0 filename 3384 non-null object\n", + " 1 volume 3384 non-null int64 \n", + " 2 number 3384 non-null int64 \n", + " 3 head 3384 non-null object\n", + " 4 normClass 3384 non-null object\n", + " 5 author 3384 non-null object\n", + " 6 text 3384 non-null object\n", + "dtypes: int64(2), object(5)\n", + "memory usage: 211.5+ KB\n" + ] + } + ], "source": [ "data_artfl.info()" ] @@ -227,9 +270,115 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<div>\n", + "<style scoped>\n", + " .dataframe tbody tr th:only-of-type {\n", + " vertical-align: middle;\n", + " }\n", + "\n", + " .dataframe tbody tr th {\n", + " vertical-align: top;\n", + " }\n", + "\n", + " .dataframe thead th {\n", + " text-align: right;\n", + " }\n", + "</style>\n", + "<table border=\"1\" class=\"dataframe\">\n", + " <thead>\n", + " <tr style=\"text-align: right;\">\n", + " <th></th>\n", + " <th>filename</th>\n", + " <th>volume</th>\n", + " <th>number</th>\n", + " <th>head</th>\n", + " <th>normClass</th>\n", + " <th>author</th>\n", + " <th>text</th>\n", + " </tr>\n", + " </thead>\n", + " <tbody>\n", + " <tr>\n", + " <th>0</th>\n", + " <td>volume07-1.tei</td>\n", + " <td>7</td>\n", + " <td>1</td>\n", + " <td>Title Page</td>\n", + " <td>unclassified</td>\n", + " <td>unsigned</td>\n", + " <td>ENCYCLOPÉDIE, ou DICTIONNAIRE RAISONNÉ DES SCI...</td>\n", + " </tr>\n", + " <tr>\n", + " <th>1</th>\n", + " <td>volume07-10.tei</td>\n", + " <td>7</td>\n", + " <td>10</td>\n", + " <td>FOESNE ou FOUANE</td>\n", + " <td>Marine | Pêche</td>\n", + " <td>Bellin</td>\n", + " <td>FOESNE ou FOUANE, sub. s. (Marine & Pêche.) c'...</td>\n", + " </tr>\n", + " <tr>\n", + " <th>2</th>\n", + " <td>volume07-100.tei</td>\n", + " <td>7</td>\n", + " <td>100</td>\n", + " <td>Fond de la hune</td>\n", + " <td>unclassified</td>\n", + " <td>Bellin</td>\n", + " <td>Fond de la hune ; ce sont les planches qu on p...</td>\n", + " </tr>\n", + " <tr>\n", + " <th>3</th>\n", + " <td>volume07-1000.tei</td>\n", + " <td>7</td>\n", + " <td>1000</td>\n", + " <td>Fronteau</td>\n", + " <td>Bourrelier | Sellier</td>\n", + " <td>Diderot</td>\n", + " <td>* Fronteau, terme de Sellier-Bourrelier ; c'es...</td>\n", + " </tr>\n", + " <tr>\n", + " <th>4</th>\n", + " <td>volume07-1001.tei</td>\n", + " <td>7</td>\n", + " <td>1001</td>\n", + " <td>FRONTIERE</td>\n", + " <td>Géographie</td>\n", + " <td>Diderot</td>\n", + " <td>* FRONTIERE, s. f. (Géog.) se dit des limites,...</td>\n", + " </tr>\n", + " </tbody>\n", + "</table>\n", + "</div>" + ], + "text/plain": [ + " filename volume number head normClass \\\n", + "0 volume07-1.tei 7 1 Title Page unclassified \n", + "1 volume07-10.tei 7 10 FOESNE ou FOUANE Marine | Pêche \n", + "2 volume07-100.tei 7 100 Fond de la hune unclassified \n", + "3 volume07-1000.tei 7 1000 Fronteau Bourrelier | Sellier \n", + "4 volume07-1001.tei 7 1001 FRONTIERE Géographie \n", + "\n", + " author text \n", + "0 unsigned ENCYCLOPÉDIE, ou DICTIONNAIRE RAISONNÉ DES SCI... \n", + "1 Bellin FOESNE ou FOUANE, sub. s. (Marine & Pêche.) c'... \n", + "2 Bellin Fond de la hune ; ce sont les planches qu on p... \n", + "3 Diderot * Fronteau, terme de Sellier-Bourrelier ; c'es... \n", + "4 Diderot * FRONTIERE, s. f. (Géog.) se dit des limites,... " + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "data_artfl.head()" ] @@ -250,9 +399,17 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Il y a 3384 articles dans le jeu de données.\n" + ] + } + ], "source": [ "n = data_artfl.shape[0]\n", "print('Il y a ' + str(n) + ' articles dans le jeu de données.')" @@ -280,9 +437,67 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<div>\n", + "<style scoped>\n", + " .dataframe tbody tr th:only-of-type {\n", + " vertical-align: middle;\n", + " }\n", + "\n", + " .dataframe tbody tr th {\n", + " vertical-align: top;\n", + " }\n", + "\n", + " .dataframe thead th {\n", + " text-align: right;\n", + " }\n", + "</style>\n", + "<table border=\"1\" class=\"dataframe\">\n", + " <thead>\n", + " <tr style=\"text-align: right;\">\n", + " <th></th>\n", + " <th>filename</th>\n", + " <th>volume</th>\n", + " <th>number</th>\n", + " <th>head</th>\n", + " <th>normClass</th>\n", + " <th>author</th>\n", + " <th>text</th>\n", + " </tr>\n", + " </thead>\n", + " <tbody>\n", + " <tr>\n", + " <th>5</th>\n", + " <td>volume07-1002.tei</td>\n", + " <td>7</td>\n", + " <td>1002</td>\n", + " <td>FRONTIGNAN</td>\n", + " <td>Géographie</td>\n", + " <td>Jaucourt</td>\n", + " <td>FRONTIGNAN, (Géog.) petite ville de France. au...</td>\n", + " </tr>\n", + " </tbody>\n", + "</table>\n", + "</div>" + ], + "text/plain": [ + " filename volume number head normClass author \\\n", + "5 volume07-1002.tei 7 1002 FRONTIGNAN Géographie Jaucourt \n", + "\n", + " text \n", + "5 FRONTIGNAN, (Géog.) petite ville de France. au... " + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "frontignan = data_artfl.loc[data_artfl['head'] == 'FRONTIGNAN']\n", "frontignan" @@ -297,9 +512,19 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "volume : 7\n", + "number : 1002\n", + "text : FRONTIGNAN, (Géog.) petite ville de France. au Bas-Languedoc, connue par ses excellens vins muscats, & ses raisins de caisse qu'on appelle passerilles. Quelques savans croyent, sans en donner de preuves, que cette ville est le forum Domitii des Romains. Elle est située sur l'étang de Maguelone, à six lieues N. E. d'Agde, & cinq S. O. de Montpellier. Long. 15d. 24'. lat. 43d. 28'. (D. J.)\n" + ] + } + ], "source": [ "print('volume :', frontignan.volume.item()) # similaire à frontignan['volume'].item()\n", "print('number :', frontignan.number.item())\n", @@ -317,9 +542,17 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "698 articles ont été rédigés par Jaucourt\n" + ] + } + ], "source": [ "req = 'Jaucourt'\n", "d_Jaucourt = data_artfl.loc[data_artfl['author'] == req]\n", @@ -337,9 +570,122 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<div>\n", + "<style scoped>\n", + " .dataframe tbody tr th:only-of-type {\n", + " vertical-align: middle;\n", + " }\n", + "\n", + " .dataframe tbody tr th {\n", + " vertical-align: top;\n", + " }\n", + "\n", + " .dataframe thead th {\n", + " text-align: right;\n", + " }\n", + "</style>\n", + "<table border=\"1\" class=\"dataframe\">\n", + " <thead>\n", + " <tr style=\"text-align: right;\">\n", + " <th></th>\n", + " <th>filename</th>\n", + " <th>volume</th>\n", + " <th>number</th>\n", + " <th>head</th>\n", + " <th>normClass</th>\n", + " <th>author</th>\n", + " <th>text</th>\n", + " </tr>\n", + " </thead>\n", + " <tbody>\n", + " <tr>\n", + " <th>5</th>\n", + " <td>volume07-1002.tei</td>\n", + " <td>7</td>\n", + " <td>1002</td>\n", + " <td>FRONTIGNAN</td>\n", + " <td>Géographie</td>\n", + " <td>Jaucourt</td>\n", + " <td>FRONTIGNAN, (Géog.) petite ville de France. au...</td>\n", + " </tr>\n", + " <tr>\n", + " <th>29</th>\n", + " <td>volume07-1024.tei</td>\n", + " <td>7</td>\n", + " <td>1024</td>\n", + " <td>FROWARD, le cap.</td>\n", + " <td>Géographie</td>\n", + " <td>Jaucourt</td>\n", + " <td>FROWARD, le cap. (Géog.) & par les François le...</td>\n", + " </tr>\n", + " <tr>\n", + " <th>32</th>\n", + " <td>volume07-1027.tei</td>\n", + " <td>7</td>\n", + " <td>1027</td>\n", + " <td>FRUGALITÉ</td>\n", + " <td>Morale</td>\n", + " <td>Jaucourt</td>\n", + " <td>FRUGALITÉ, (Morale.) simplicité de moeurs & de...</td>\n", + " </tr>\n", + " <tr>\n", + " <th>37</th>\n", + " <td>volume07-1031.tei</td>\n", + " <td>7</td>\n", + " <td>1031</td>\n", + " <td>Fruit verreux</td>\n", + " <td>Histoire naturelle</td>\n", + " <td>Jaucourt</td>\n", + " <td>Fruit verreux, (Hist. nat.) c'est le nom qu'on...</td>\n", + " </tr>\n", + " <tr>\n", + " <th>38</th>\n", + " <td>volume07-1032.tei</td>\n", + " <td>7</td>\n", + " <td>1032</td>\n", + " <td>Fruit, (art de conserver le)</td>\n", + " <td>Economie rustique</td>\n", + " <td>Jaucourt</td>\n", + " <td>Fruit, (art de conserver le) Economie rustiq. ...</td>\n", + " </tr>\n", + " </tbody>\n", + "</table>\n", + "</div>" + ], + "text/plain": [ + " filename volume number head \\\n", + "5 volume07-1002.tei 7 1002 FRONTIGNAN \n", + "29 volume07-1024.tei 7 1024 FROWARD, le cap. \n", + "32 volume07-1027.tei 7 1027 FRUGALITÉ \n", + "37 volume07-1031.tei 7 1031 Fruit verreux \n", + "38 volume07-1032.tei 7 1032 Fruit, (art de conserver le) \n", + "\n", + " normClass author \\\n", + "5 Géographie Jaucourt \n", + "29 Géographie Jaucourt \n", + "32 Morale Jaucourt \n", + "37 Histoire naturelle Jaucourt \n", + "38 Economie rustique Jaucourt \n", + "\n", + " text \n", + "5 FRONTIGNAN, (Géog.) petite ville de France. au... \n", + "29 FROWARD, le cap. (Géog.) & par les François le... \n", + "32 FRUGALITÉ, (Morale.) simplicité de moeurs & de... \n", + "37 Fruit verreux, (Hist. nat.) c'est le nom qu'on... \n", + "38 Fruit, (art de conserver le) Economie rustiq. ... " + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "d_Jaucourt.head()" ] @@ -363,9 +709,17 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "496 articles sont classés en Géographie\n" + ] + } + ], "source": [ "req = 'Géographie'\n", "d_geo = data_artfl[data_artfl['normClass'].str.contains(req, case=False)]\n", @@ -376,9 +730,17 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "177 articles contiennent l'expression 'ville de'\n" + ] + } + ], "source": [ "req = 'ville de'\n", "d_geo = data_artfl[data_artfl['text'].str.contains(req, case=False)]\n", @@ -405,9 +767,40 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "author\n", + "Anonymous5 1\n", + "Beauzée & Douchet 1\n", + "Boucher d'Argis 14\n", + "Bouchu 1\n", + "Desmarest 1\n", + "Diderot 2\n", + "Jaucourt 141\n", + "Le Blond 1\n", + "Le Blond & d'Alembert 1\n", + "Le Roy 1\n", + "Lucotte5 1\n", + "Mallet 1\n", + "Quesnay 1\n", + "Robert de Vaugondy 1\n", + "Tressan 1\n", + "Voltaire 2\n", + "d'Alembert 2\n", + "d'Holbach 1\n", + "unsigned 3\n", + "Name: filename, dtype: int64" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "d_geo.groupby(['author'])[\"filename\"].count()" ] @@ -458,7 +851,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 18, "metadata": {}, "outputs": [], "source": [ @@ -474,9 +867,33 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "426f9995072b4323ad02a7da9efaf52c", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Downloading https://raw.githubusercontent.com/stanfordnlp/stanza-resources/main/resources_1.4.1.json: 0%| …" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2022-09-29 13:49:18 INFO: Downloading default packages for language: fr (French) ...\n", + "2022-09-29 13:49:18 INFO: File exists: /Users/lmoncla/stanza_resources/fr/default.zip\n", + "2022-09-29 13:49:20 INFO: Finished downloading models and saved to /Users/lmoncla/stanza_resources.\n" + ] + } + ], "source": [ "stanza.download('fr')" ] @@ -490,9 +907,52 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2022-09-29 13:49:24 INFO: Checking for updates to resources.json in case models have been updated. Note: this behavior can be turned off with download_method=None or download_method=DownloadMethod.REUSE_RESOURCES\n" + ] + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "761c488f3d4945a19e2fcb1df6183934", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Downloading https://raw.githubusercontent.com/stanfordnlp/stanza-resources/main/resources_1.4.1.json: 0%| …" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2022-09-29 13:49:24 WARNING: Language fr package default expects mwt, which has been added\n", + "2022-09-29 13:49:25 INFO: Loading these models for language: fr (French):\n", + "=======================\n", + "| Processor | Package |\n", + "-----------------------\n", + "| tokenize | gsd |\n", + "| mwt | gsd |\n", + "| ner | wikiner |\n", + "=======================\n", + "\n", + "2022-09-29 13:49:25 INFO: Use device: cpu\n", + "2022-09-29 13:49:25 INFO: Loading: tokenize\n", + "2022-09-29 13:49:25 INFO: Loading: mwt\n", + "2022-09-29 13:49:25 INFO: Loading: ner\n", + "2022-09-29 13:49:26 INFO: Done loading processors!\n" + ] + } + ], "source": [ "stanza_parser = stanza.Pipeline(lang='fr', processors='tokenize,ner')" ] @@ -506,9 +966,17 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "* ARQUES, (Géog.) petite ville de France, en Normandie, au pays de Caux, sur la petite riviere d'Arques. Long. 18. 50. lat. 49. 54.\n" + ] + } + ], "source": [ "print(arques)" ] @@ -522,7 +990,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 22, "metadata": {}, "outputs": [], "source": [ @@ -538,7 +1006,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 23, "metadata": {}, "outputs": [], "source": [ @@ -550,9 +1018,22 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 24, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ARQUES LOC\n", + "(Géog LOC\n", + "France LOC\n", + "Normandie LOC\n", + "pays de Caux LOC\n", + "Arques LOC\n" + ] + } + ], "source": [ "# On utilise la fonction précédente pour afficher la liste des entités repérées\n", "show_ents(arques_stanza)" @@ -580,9 +1061,51 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 25, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Collecting fr-core-news-sm==3.4.0\n", + " Downloading https://github.com/explosion/spacy-models/releases/download/fr_core_news_sm-3.4.0/fr_core_news_sm-3.4.0-py3-none-any.whl (16.3 MB)\n", + "\u001b[2K \u001b[38;2;114;156;31mâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”\u001b[0m \u001b[32m16.3/16.3 MB\u001b[0m \u001b[31m10.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0mm eta \u001b[36m0:00:01\u001b[0m0:01\u001b[0m:01\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: spacy<3.5.0,>=3.4.0 in /usr/local/Caskroom/miniforge/base/envs/tdm-geoparsing-py39/lib/python3.9/site-packages (from fr-core-news-sm==3.4.0) (3.4.1)\n", + "Requirement already satisfied: packaging>=20.0 in /usr/local/Caskroom/miniforge/base/envs/tdm-geoparsing-py39/lib/python3.9/site-packages (from spacy<3.5.0,>=3.4.0->fr-core-news-sm==3.4.0) (21.3)\n", + "Requirement already satisfied: numpy>=1.15.0 in /usr/local/Caskroom/miniforge/base/envs/tdm-geoparsing-py39/lib/python3.9/site-packages (from spacy<3.5.0,>=3.4.0->fr-core-news-sm==3.4.0) (1.23.3)\n", + "Requirement already satisfied: cymem<2.1.0,>=2.0.2 in /usr/local/Caskroom/miniforge/base/envs/tdm-geoparsing-py39/lib/python3.9/site-packages (from spacy<3.5.0,>=3.4.0->fr-core-news-sm==3.4.0) (2.0.6)\n", + "Requirement already satisfied: murmurhash<1.1.0,>=0.28.0 in /usr/local/Caskroom/miniforge/base/envs/tdm-geoparsing-py39/lib/python3.9/site-packages (from spacy<3.5.0,>=3.4.0->fr-core-news-sm==3.4.0) (1.0.8)\n", + "Requirement already satisfied: langcodes<4.0.0,>=3.2.0 in /usr/local/Caskroom/miniforge/base/envs/tdm-geoparsing-py39/lib/python3.9/site-packages (from spacy<3.5.0,>=3.4.0->fr-core-news-sm==3.4.0) (3.3.0)\n", + "Requirement already satisfied: thinc<8.2.0,>=8.1.0 in /usr/local/Caskroom/miniforge/base/envs/tdm-geoparsing-py39/lib/python3.9/site-packages (from spacy<3.5.0,>=3.4.0->fr-core-news-sm==3.4.0) (8.1.0)\n", + "Requirement already satisfied: spacy-legacy<3.1.0,>=3.0.9 in /usr/local/Caskroom/miniforge/base/envs/tdm-geoparsing-py39/lib/python3.9/site-packages (from spacy<3.5.0,>=3.4.0->fr-core-news-sm==3.4.0) (3.0.10)\n", + "Requirement already satisfied: requests<3.0.0,>=2.13.0 in /usr/local/Caskroom/miniforge/base/envs/tdm-geoparsing-py39/lib/python3.9/site-packages (from spacy<3.5.0,>=3.4.0->fr-core-news-sm==3.4.0) (2.28.1)\n", + "Requirement already satisfied: pydantic!=1.8,!=1.8.1,<1.10.0,>=1.7.4 in /usr/local/Caskroom/miniforge/base/envs/tdm-geoparsing-py39/lib/python3.9/site-packages (from spacy<3.5.0,>=3.4.0->fr-core-news-sm==3.4.0) (1.9.2)\n", + "Requirement already satisfied: tqdm<5.0.0,>=4.38.0 in /usr/local/Caskroom/miniforge/base/envs/tdm-geoparsing-py39/lib/python3.9/site-packages (from spacy<3.5.0,>=3.4.0->fr-core-news-sm==3.4.0) (4.64.1)\n", + "Requirement already satisfied: catalogue<2.1.0,>=2.0.6 in /usr/local/Caskroom/miniforge/base/envs/tdm-geoparsing-py39/lib/python3.9/site-packages (from spacy<3.5.0,>=3.4.0->fr-core-news-sm==3.4.0) (2.0.8)\n", + "Requirement already satisfied: wasabi<1.1.0,>=0.9.1 in /usr/local/Caskroom/miniforge/base/envs/tdm-geoparsing-py39/lib/python3.9/site-packages (from spacy<3.5.0,>=3.4.0->fr-core-news-sm==3.4.0) (0.10.0)\n", + "Requirement already satisfied: preshed<3.1.0,>=3.0.2 in /usr/local/Caskroom/miniforge/base/envs/tdm-geoparsing-py39/lib/python3.9/site-packages (from spacy<3.5.0,>=3.4.0->fr-core-news-sm==3.4.0) (3.0.7)\n", + "Requirement already satisfied: spacy-loggers<2.0.0,>=1.0.0 in /usr/local/Caskroom/miniforge/base/envs/tdm-geoparsing-py39/lib/python3.9/site-packages (from spacy<3.5.0,>=3.4.0->fr-core-news-sm==3.4.0) (1.0.3)\n", + "Requirement already satisfied: typer<0.5.0,>=0.3.0 in /usr/local/Caskroom/miniforge/base/envs/tdm-geoparsing-py39/lib/python3.9/site-packages (from spacy<3.5.0,>=3.4.0->fr-core-news-sm==3.4.0) (0.4.2)\n", + "Requirement already satisfied: setuptools in /usr/local/Caskroom/miniforge/base/envs/tdm-geoparsing-py39/lib/python3.9/site-packages (from spacy<3.5.0,>=3.4.0->fr-core-news-sm==3.4.0) (65.4.0)\n", + "Requirement already satisfied: srsly<3.0.0,>=2.4.3 in /usr/local/Caskroom/miniforge/base/envs/tdm-geoparsing-py39/lib/python3.9/site-packages (from spacy<3.5.0,>=3.4.0->fr-core-news-sm==3.4.0) (2.4.4)\n", + "Requirement already satisfied: pathy>=0.3.5 in /usr/local/Caskroom/miniforge/base/envs/tdm-geoparsing-py39/lib/python3.9/site-packages (from spacy<3.5.0,>=3.4.0->fr-core-news-sm==3.4.0) (0.6.2)\n", + "Requirement already satisfied: jinja2 in /usr/local/Caskroom/miniforge/base/envs/tdm-geoparsing-py39/lib/python3.9/site-packages (from spacy<3.5.0,>=3.4.0->fr-core-news-sm==3.4.0) (3.1.2)\n", + "Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /usr/local/Caskroom/miniforge/base/envs/tdm-geoparsing-py39/lib/python3.9/site-packages (from packaging>=20.0->spacy<3.5.0,>=3.4.0->fr-core-news-sm==3.4.0) (3.0.9)\n", + "Requirement already satisfied: smart-open<6.0.0,>=5.2.1 in /usr/local/Caskroom/miniforge/base/envs/tdm-geoparsing-py39/lib/python3.9/site-packages (from pathy>=0.3.5->spacy<3.5.0,>=3.4.0->fr-core-news-sm==3.4.0) (5.2.1)\n", + "Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/Caskroom/miniforge/base/envs/tdm-geoparsing-py39/lib/python3.9/site-packages (from pydantic!=1.8,!=1.8.1,<1.10.0,>=1.7.4->spacy<3.5.0,>=3.4.0->fr-core-news-sm==3.4.0) (4.3.0)\n", + "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/Caskroom/miniforge/base/envs/tdm-geoparsing-py39/lib/python3.9/site-packages (from requests<3.0.0,>=2.13.0->spacy<3.5.0,>=3.4.0->fr-core-news-sm==3.4.0) (1.26.11)\n", + "Requirement already satisfied: idna<4,>=2.5 in /usr/local/Caskroom/miniforge/base/envs/tdm-geoparsing-py39/lib/python3.9/site-packages (from requests<3.0.0,>=2.13.0->spacy<3.5.0,>=3.4.0->fr-core-news-sm==3.4.0) (3.4)\n", + "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/Caskroom/miniforge/base/envs/tdm-geoparsing-py39/lib/python3.9/site-packages (from requests<3.0.0,>=2.13.0->spacy<3.5.0,>=3.4.0->fr-core-news-sm==3.4.0) (2022.9.24)\n", + "Requirement already satisfied: charset-normalizer<3,>=2 in /usr/local/Caskroom/miniforge/base/envs/tdm-geoparsing-py39/lib/python3.9/site-packages (from requests<3.0.0,>=2.13.0->spacy<3.5.0,>=3.4.0->fr-core-news-sm==3.4.0) (2.1.1)\n", + "Requirement already satisfied: blis<0.8.0,>=0.7.8 in /usr/local/Caskroom/miniforge/base/envs/tdm-geoparsing-py39/lib/python3.9/site-packages (from thinc<8.2.0,>=8.1.0->spacy<3.5.0,>=3.4.0->fr-core-news-sm==3.4.0) (0.7.8)\n", + "Requirement already satisfied: click<9.0.0,>=7.1.1 in /usr/local/Caskroom/miniforge/base/envs/tdm-geoparsing-py39/lib/python3.9/site-packages (from typer<0.5.0,>=0.3.0->spacy<3.5.0,>=3.4.0->fr-core-news-sm==3.4.0) (8.1.3)\n", + "Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/Caskroom/miniforge/base/envs/tdm-geoparsing-py39/lib/python3.9/site-packages (from jinja2->spacy<3.5.0,>=3.4.0->fr-core-news-sm==3.4.0) (2.1.1)\n", + "\u001b[38;5;2m✔ Download and installation successful\u001b[0m\n", + "You can now load the package via spacy.load('fr_core_news_sm')\n" + ] + } + ], "source": [ "!python -m spacy download fr_core_news_sm" ] @@ -596,7 +1119,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 26, "metadata": {}, "outputs": [], "source": [ @@ -612,7 +1135,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 27, "metadata": {}, "outputs": [], "source": [ @@ -628,7 +1151,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 28, "metadata": {}, "outputs": [], "source": [ @@ -644,9 +1167,21 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 29, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Géog MISC\n", + "de France LOC\n", + "Normandie LOC\n", + "pays de Caux LOC\n", + "Arques LOC\n" + ] + } + ], "source": [ "for ent in arques_spacy.ents:\n", " print(ent.text, ent.label_)" @@ -661,9 +1196,47 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 30, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">* ARQUES, (\n", + "<mark class=\"entity\" style=\"background: #ddd; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Géog\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">MISC</span>\n", + "</mark>\n", + ".) petite ville \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " de France\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + ", en \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Normandie\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + ", au \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " pays de Caux\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + ", sur la petite riviere d'\n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Arques\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + ". Long. 18. 50. lat. 49. 54.</div></span>" + ], + "text/plain": [ + "<IPython.core.display.HTML object>" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "displacy.render(arques_spacy, style=\"ent\", jupyter=True) " ] @@ -698,7 +1271,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 31, "metadata": {}, "outputs": [], "source": [ @@ -714,7 +1287,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 32, "metadata": {}, "outputs": [], "source": [ @@ -737,9 +1310,22 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 33, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ARQUES place\n", + "France place\n", + "Normandie place\n", + "Caux place\n", + "Arques place\n", + "Long . 18 . 50 . lat . 49 . 54 . latlong\n" + ] + } + ], "source": [ "for ent in arques_perdido.named_entities:\n", " print(ent.text, ent.tag)" @@ -754,9 +1340,52 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 34, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">* \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " ARQUES\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " , ( Géog . ) petite ville de \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " France\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " , en \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Normandie\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " , au pays de \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Caux\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " , sur la petite riviere d' \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Arques\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " . \n", + "<mark class=\"entity\" style=\"background: #ddd; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Long . 18 . 50 . lat . 49 . 54 .\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">MISC</span>\n", + "</mark>\n", + " </div></span>" + ], + "text/plain": [ + "<IPython.core.display.HTML object>" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "displacy.render(arques_perdido.to_spacy_doc(), style=\"ent\", jupyter=True)" ] @@ -770,9 +1399,347 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 35, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<span class=\"tex2jax_ignore\"><div class=\"spans\" style=\"line-height: 2.5; direction: ltr\">\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " *\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + " <span style=\"background: #ddd; z-index: 10; color: #000; top: -0.5em; padding: 2px 3px; position: absolute; font-size: 0.6em; font-weight: bold; line-height: 1; border-radius: 3px\">\n", + " MISC\n", + " </span>\n", + "</span>\n", + "\n", + "\n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 77px;\">\n", + " ARQUES\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + "<span style=\"background: #ff9561; top: 57px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "<span style=\"background: #ff9561; top: 57px; height: 4px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + " <span style=\"background: #ff9561; z-index: 10; color: #000; top: -0.5em; padding: 2px 3px; position: absolute; font-size: 0.6em; font-weight: bold; line-height: 1; border-radius: 3px\">\n", + " LOC\n", + " </span>\n", + "</span>\n", + "\n", + "\n", + "</span>\n", + ", ( Géog . ) \n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " petite\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + " <span style=\"background: #ff9561; z-index: 10; color: #000; top: -0.5em; padding: 2px 3px; position: absolute; font-size: 0.6em; font-weight: bold; line-height: 1; border-radius: 3px\">\n", + " LOC\n", + " </span>\n", + "</span>\n", + "\n", + "\n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " ville\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " de\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 77px;\">\n", + " France\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + "<span style=\"background: #ff9561; top: 57px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "<span style=\"background: #ff9561; top: 57px; height: 4px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + " <span style=\"background: #ff9561; z-index: 10; color: #000; top: -0.5em; padding: 2px 3px; position: absolute; font-size: 0.6em; font-weight: bold; line-height: 1; border-radius: 3px\">\n", + " LOC\n", + " </span>\n", + "</span>\n", + "\n", + "\n", + "</span>\n", + ", en \n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " Normandie\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + " <span style=\"background: #ff9561; z-index: 10; color: #000; top: -0.5em; padding: 2px 3px; position: absolute; font-size: 0.6em; font-weight: bold; line-height: 1; border-radius: 3px\">\n", + " LOC\n", + " </span>\n", + "</span>\n", + "\n", + "\n", + "</span>\n", + ", au \n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " pays\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + " <span style=\"background: #ff9561; z-index: 10; color: #000; top: -0.5em; padding: 2px 3px; position: absolute; font-size: 0.6em; font-weight: bold; line-height: 1; border-radius: 3px\">\n", + " LOC\n", + " </span>\n", + "</span>\n", + "\n", + "\n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " de\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 77px;\">\n", + " Caux\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + "<span style=\"background: #ff9561; top: 57px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "<span style=\"background: #ff9561; top: 57px; height: 4px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + " <span style=\"background: #ff9561; z-index: 10; color: #000; top: -0.5em; padding: 2px 3px; position: absolute; font-size: 0.6em; font-weight: bold; line-height: 1; border-radius: 3px\">\n", + " LOC\n", + " </span>\n", + "</span>\n", + "\n", + "\n", + "</span>\n", + ", sur \n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " la\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + " <span style=\"background: #ff9561; z-index: 10; color: #000; top: -0.5em; padding: 2px 3px; position: absolute; font-size: 0.6em; font-weight: bold; line-height: 1; border-radius: 3px\">\n", + " LOC\n", + " </span>\n", + "</span>\n", + "\n", + "\n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " petite\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " riviere\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " d'\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 77px;\">\n", + " Arques\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + "<span style=\"background: #ff9561; top: 57px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "<span style=\"background: #ff9561; top: 57px; height: 4px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + " <span style=\"background: #ff9561; z-index: 10; color: #000; top: -0.5em; padding: 2px 3px; position: absolute; font-size: 0.6em; font-weight: bold; line-height: 1; border-radius: 3px\">\n", + " LOC\n", + " </span>\n", + "</span>\n", + "\n", + "\n", + "</span>\n", + ". \n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " Long\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + " <span style=\"background: #ddd; z-index: 10; color: #000; top: -0.5em; padding: 2px 3px; position: absolute; font-size: 0.6em; font-weight: bold; line-height: 1; border-radius: 3px\">\n", + " MISC\n", + " </span>\n", + "</span>\n", + "\n", + "\n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " .\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " 18\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " .\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " 50\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " .\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " lat\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " .\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " 49\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " .\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " 54\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " .\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "</div></span>" + ], + "text/plain": [ + "<IPython.core.display.HTML object>" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "displacy.render(arques_perdido.to_spacy_doc(), style=\"span\", jupyter=True)" ] @@ -800,9 +1767,18 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 36, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "* Beaufort, (Géog.) ville de Savoie, sur la riviere \n", + "d'Oron. Long. 24. 18. lat. 45. 40.\n" + ] + } + ], "source": [ "beaufort = load_txt('data/edda-volume02-1365.txt')\n", "\n", @@ -818,9 +1794,301 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 37, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">* \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Beaufort\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " , ( Géog . ) ville de \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Savoie\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " , sur la riviere d' \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Oron\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " . \n", + "<mark class=\"entity\" style=\"background: #ddd; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Long . 24 . 18 . lat . 45 . 40 .\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">MISC</span>\n", + "</mark>\n", + " </div></span>" + ], + "text/plain": [ + "<IPython.core.display.HTML object>" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "<span class=\"tex2jax_ignore\"><div class=\"spans\" style=\"line-height: 2.5; direction: ltr\">\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " *\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + " <span style=\"background: #ddd; z-index: 10; color: #000; top: -0.5em; padding: 2px 3px; position: absolute; font-size: 0.6em; font-weight: bold; line-height: 1; border-radius: 3px\">\n", + " MISC\n", + " </span>\n", + "</span>\n", + "\n", + "\n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 77px;\">\n", + " Beaufort\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + "<span style=\"background: #ff9561; top: 57px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "<span style=\"background: #ff9561; top: 57px; height: 4px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + " <span style=\"background: #ff9561; z-index: 10; color: #000; top: -0.5em; padding: 2px 3px; position: absolute; font-size: 0.6em; font-weight: bold; line-height: 1; border-radius: 3px\">\n", + " LOC\n", + " </span>\n", + "</span>\n", + "\n", + "\n", + "</span>\n", + ", ( Géog . ) \n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " ville\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + " <span style=\"background: #ff9561; z-index: 10; color: #000; top: -0.5em; padding: 2px 3px; position: absolute; font-size: 0.6em; font-weight: bold; line-height: 1; border-radius: 3px\">\n", + " LOC\n", + " </span>\n", + "</span>\n", + "\n", + "\n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " de\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 77px;\">\n", + " Savoie\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + "<span style=\"background: #ff9561; top: 57px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "<span style=\"background: #ff9561; top: 57px; height: 4px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + " <span style=\"background: #ff9561; z-index: 10; color: #000; top: -0.5em; padding: 2px 3px; position: absolute; font-size: 0.6em; font-weight: bold; line-height: 1; border-radius: 3px\">\n", + " LOC\n", + " </span>\n", + "</span>\n", + "\n", + "\n", + "</span>\n", + ", sur \n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " la\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + " <span style=\"background: #ff9561; z-index: 10; color: #000; top: -0.5em; padding: 2px 3px; position: absolute; font-size: 0.6em; font-weight: bold; line-height: 1; border-radius: 3px\">\n", + " LOC\n", + " </span>\n", + "</span>\n", + "\n", + "\n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " riviere\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " d'\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 77px;\">\n", + " Oron\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + "<span style=\"background: #ff9561; top: 57px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "<span style=\"background: #ff9561; top: 57px; height: 4px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + " <span style=\"background: #ff9561; z-index: 10; color: #000; top: -0.5em; padding: 2px 3px; position: absolute; font-size: 0.6em; font-weight: bold; line-height: 1; border-radius: 3px\">\n", + " LOC\n", + " </span>\n", + "</span>\n", + "\n", + "\n", + "</span>\n", + ". \n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " Long\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + " <span style=\"background: #ddd; z-index: 10; color: #000; top: -0.5em; padding: 2px 3px; position: absolute; font-size: 0.6em; font-weight: bold; line-height: 1; border-radius: 3px\">\n", + " MISC\n", + " </span>\n", + "</span>\n", + "\n", + "\n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " .\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " 24\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " .\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " 18\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " .\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " lat\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " .\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " 45\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " .\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " 40\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " .\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "</div></span>" + ], + "text/plain": [ + "<IPython.core.display.HTML object>" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "beaufort_perdido = geoparser(beaufort)\n", "displacy.render(beaufort_perdido.to_spacy_doc(), style=\"ent\", jupyter=True)\n", @@ -836,9 +2104,42 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 38, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">* \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Beaufort\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + ", (\n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Géog\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + ".) ville de \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Savoie\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + ", sur la riviere </br>d'\n", + "<mark class=\"entity\" style=\"background: #ddd; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Oron\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">PER</span>\n", + "</mark>\n", + ". Long. 24. 18. lat. 45. 40.</div></span>" + ], + "text/plain": [ + "<IPython.core.display.HTML object>" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "beaufort_spacy = spacy_parser(beaufort)\n", "displacy.render(beaufort_spacy, style=\"ent\", jupyter=True) " @@ -854,9 +2155,37 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 39, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">* \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Beaufort\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + ", (\n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Géog\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + ".) ville de \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Savoie\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + ", sur la rivière </br>d'Oron. Long. 24. 18. lat. 45. 40.</div></span>" + ], + "text/plain": [ + "<IPython.core.display.HTML object>" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "normalized_beaufort = beaufort.replace('riviere', 'rivière')\n", "\n", @@ -882,9 +2211,42 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 40, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">* \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Beaufort\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + ", (\n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Géog\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + ".) ville de \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Savoie\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + ", sur la \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " rivière d'Oron\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + ". Long. 24. 18. lat. 45. 40.</div></span>" + ], + "text/plain": [ + "<IPython.core.display.HTML object>" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "normalized_beaufort = normalized_beaufort.replace('\\n', '')\n", "\n", @@ -911,9 +2273,20 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 41, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Beaufort LOC\n", + "Géog LOC\n", + "Savoie LOC\n", + "Oron LOC\n" + ] + } + ], "source": [ "beaufort_stanza = stanza_parser(beaufort)\n", "show_ents(beaufort_stanza)" @@ -930,9 +2303,29 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 42, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "BEAUFORT ou Beaufort-sur-Doron ou Saint-Maxime-\n", + "de-Bf.aufort. Ch.-l. de cant. du dép. de la Savoie, arr.\n", + "d’Albertville, au débouché de trois vallées dont les tor¬\n", + "rents forment le Doron de Beaufort ; 2,393 hab. Les\n", + "superbes pâturages de la vallée nourrissent de nombreux\n", + "troupeaux ; il se fait à Beaufort un commerce important de\n", + "fromages et de bestiaux. Un assez grand nombre d’habi¬\n", + "tants quittent le pays pendant l’hiver. De l’ancien château\n", + "de la Salle qu’Henri IV habita à deux reprises pendant la\n", + "guerre qu’il soutint contre le duc de Savoie, il subsiste\n", + "trois tours. Ancienne chapelle, reconstruite en 1841,\n", + "qui est le but d’un pèlerinage très fréquenté.\n", + "\n" + ] + } + ], "source": [ "lge_beaufort = load_txt('data/lge-beaufort.txt')\n", "print(lge_beaufort)" @@ -947,7 +2340,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 43, "metadata": {}, "outputs": [], "source": [ @@ -957,9 +2350,20 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 44, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'BEAUFORT ou Beaufort-sur-Doron ou Saint-Maximede-Bf.aufort. Ch.-l. de cant. du dép. de la Savoie, arr. d’Albertville, au débouché de trois vallées dont les torrents forment le Doron de Beaufort ; 2,393 hab. Les superbes pâturages de la vallée nourrissent de nombreux troupeaux ; il se fait à Beaufort un commerce important de fromages et de bestiaux. Un assez grand nombre d’habitants quittent le pays pendant l’hiver. De l’ancien château de la Salle qu’Henri IV habita à deux reprises pendant la guerre qu’il soutint contre le duc de Savoie, il subsiste trois tours. Ancienne chapelle, reconstruite en 1841, qui est le but d’un pèlerinage très fréquenté. '" + ] + }, + "execution_count": 44, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "normalized_lge_beaufort = join_lines(lge_beaufort)\n", "normalized_lge_beaufort" @@ -974,9 +2378,333 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 45, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<span class=\"tex2jax_ignore\"><div class=\"spans\" style=\"line-height: 2.5; direction: ltr\">\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " BEAUFORT\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + " <span style=\"background: #ff9561; z-index: 10; color: #000; top: -0.5em; padding: 2px 3px; position: absolute; font-size: 0.6em; font-weight: bold; line-height: 1; border-radius: 3px\">\n", + " LOC\n", + " </span>\n", + "</span>\n", + "\n", + "\n", + "</span>\n", + "ou \n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " Beaufort-sur-Doron\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + " <span style=\"background: #ff9561; z-index: 10; color: #000; top: -0.5em; padding: 2px 3px; position: absolute; font-size: 0.6em; font-weight: bold; line-height: 1; border-radius: 3px\">\n", + " LOC\n", + " </span>\n", + "</span>\n", + "\n", + "\n", + "</span>\n", + "ou \n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " Saint-Maximede-Bf.aufort\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "<span style=\"background: #ddd; top: 40px; height: 4px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + " <span style=\"background: #ddd; z-index: 10; color: #000; top: -0.5em; padding: 2px 3px; position: absolute; font-size: 0.6em; font-weight: bold; line-height: 1; border-radius: 3px\">\n", + " MISC\n", + " </span>\n", + "</span>\n", + "\n", + "\n", + "</span>\n", + ". \n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " Ch.-l\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + " <span style=\"background: #ff9561; z-index: 10; color: #000; top: -0.5em; padding: 2px 3px; position: absolute; font-size: 0.6em; font-weight: bold; line-height: 1; border-radius: 3px\">\n", + " LOC\n", + " </span>\n", + "</span>\n", + "\n", + "\n", + "</span>\n", + ". de cant . du dép . de la \n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " Savoie\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + " <span style=\"background: #ff9561; z-index: 10; color: #000; top: -0.5em; padding: 2px 3px; position: absolute; font-size: 0.6em; font-weight: bold; line-height: 1; border-radius: 3px\">\n", + " LOC\n", + " </span>\n", + "</span>\n", + "\n", + "\n", + "</span>\n", + ", arr . d' \n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " Albertville\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + " <span style=\"background: #ff9561; z-index: 10; color: #000; top: -0.5em; padding: 2px 3px; position: absolute; font-size: 0.6em; font-weight: bold; line-height: 1; border-radius: 3px\">\n", + " LOC\n", + " </span>\n", + "</span>\n", + "\n", + "\n", + "</span>\n", + ", au débouché de trois vallées dont les torrents forment le \n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " Doron\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + " <span style=\"background: #ff9561; z-index: 10; color: #000; top: -0.5em; padding: 2px 3px; position: absolute; font-size: 0.6em; font-weight: bold; line-height: 1; border-radius: 3px\">\n", + " LOC\n", + " </span>\n", + "</span>\n", + "\n", + "\n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " de\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " Beaufort\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "; 2,393 hab . Les superbes pâturages de la vallée nourrissent de nombreux troupeaux ; il se fait à \n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " Beaufort\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + " <span style=\"background: #ff9561; z-index: 10; color: #000; top: -0.5em; padding: 2px 3px; position: absolute; font-size: 0.6em; font-weight: bold; line-height: 1; border-radius: 3px\">\n", + " LOC\n", + " </span>\n", + "</span>\n", + "\n", + "\n", + "</span>\n", + "un commerce important de fromages et de bestiaux . Un assez grand nombre d' habitants quittent le pays pendant l' hiver . De l' \n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " ancien\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + " <span style=\"background: #ff9561; z-index: 10; color: #000; top: -0.5em; padding: 2px 3px; position: absolute; font-size: 0.6em; font-weight: bold; line-height: 1; border-radius: 3px\">\n", + " LOC\n", + " </span>\n", + "</span>\n", + "\n", + "\n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " château\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " de\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " la\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 77px;\">\n", + " Salle\n", + " \n", + "<span style=\"background: #ff9561; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + "<span style=\"background: #ff9561; top: 57px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "<span style=\"background: #ff9561; top: 57px; height: 4px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + " <span style=\"background: #ff9561; z-index: 10; color: #000; top: -0.5em; padding: 2px 3px; position: absolute; font-size: 0.6em; font-weight: bold; line-height: 1; border-radius: 3px\">\n", + " LOC\n", + " </span>\n", + "</span>\n", + "\n", + "\n", + "</span>\n", + "qu' \n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " Henri\n", + " \n", + "<span style=\"background: #aa9cfc; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "<span style=\"background: #aa9cfc; top: 40px; height: 4px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + " <span style=\"background: #aa9cfc; z-index: 10; color: #000; top: -0.5em; padding: 2px 3px; position: absolute; font-size: 0.6em; font-weight: bold; line-height: 1; border-radius: 3px\">\n", + " PERSON\n", + " </span>\n", + "</span>\n", + "\n", + "\n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " IV\n", + " \n", + "<span style=\"background: #aa9cfc; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "habita à deux reprises pendant la guerre qu' il soutint contre \n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " le\n", + " \n", + "<span style=\"background: #aa9cfc; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "<span style=\"background: #aa9cfc; top: 40px; height: 4px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + " <span style=\"background: #aa9cfc; z-index: 10; color: #000; top: -0.5em; padding: 2px 3px; position: absolute; font-size: 0.6em; font-weight: bold; line-height: 1; border-radius: 3px\">\n", + " PERSON\n", + " </span>\n", + "</span>\n", + "\n", + "\n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " duc\n", + " \n", + "<span style=\"background: #aa9cfc; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " de\n", + " \n", + "<span style=\"background: #aa9cfc; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 77px;\">\n", + " Savoie\n", + " \n", + "<span style=\"background: #aa9cfc; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + "<span style=\"background: #ff9561; top: 57px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "<span style=\"background: #ff9561; top: 57px; height: 4px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + " <span style=\"background: #ff9561; z-index: 10; color: #000; top: -0.5em; padding: 2px 3px; position: absolute; font-size: 0.6em; font-weight: bold; line-height: 1; border-radius: 3px\">\n", + " LOC\n", + " </span>\n", + "</span>\n", + "\n", + "\n", + "</span>\n", + ", il subsiste trois tours . Ancienne chapelle , reconstruite \n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " en\n", + " \n", + "<span style=\"background: #bfe1d9; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "<span style=\"background: #bfe1d9; top: 40px; height: 4px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + " <span style=\"background: #bfe1d9; z-index: 10; color: #000; top: -0.5em; padding: 2px 3px; position: absolute; font-size: 0.6em; font-weight: bold; line-height: 1; border-radius: 3px\">\n", + " DATE\n", + " </span>\n", + "</span>\n", + "\n", + "\n", + "</span>\n", + "\n", + "<span style=\"font-weight: bold; display: inline-block; position: relative; height: 60px;\">\n", + " 1841\n", + " \n", + "<span style=\"background: #bfe1d9; top: 40px; height: 4px; left: -1px; width: calc(100% + 2px); position: absolute;\">\n", + "</span>\n", + "\n", + " \n", + "</span>\n", + ", qui est le but d' un pèlerinage très fréquenté . </div></span>" + ], + "text/plain": [ + "<IPython.core.display.HTML object>" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "lge_beaufort_perdido = geoparser(normalized_lge_beaufort)\n", "displacy.render(lge_beaufort_perdido.to_spacy_doc(), style=\"span\", jupyter=True)" @@ -991,9 +2719,62 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 46, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">\n", + "<mark class=\"entity\" style=\"background: #ddd; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " BEAUFORT\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">MISC</span>\n", + "</mark>\n", + " ou \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Beaufort-sur-Doron\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " ou Saint-Maximede-Bf.aufort. Ch.-l. de cant. du dép. de la \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Savoie\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + ", arr. \n", + "<mark class=\"entity\" style=\"background: #ddd; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " d’Albertville\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">PER</span>\n", + "</mark>\n", + ", au débouché de trois vallées dont les torrents forment le \n", + "<mark class=\"entity\" style=\"background: #7aecec; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Doron de Beaufort\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">ORG</span>\n", + "</mark>\n", + " ; 2,393 hab. Les superbes pâturages de la vallée nourrissent de nombreux troupeaux ; il se fait à \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Beaufort\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " un commerce important de fromages et de bestiaux. Un assez grand nombre d’habitants quittent le pays pendant l’hiver. De l’ancien \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " château de la Salle\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " qu’Henri IV habita à deux reprises pendant la guerre qu’il soutint contre le \n", + "<mark class=\"entity\" style=\"background: #ddd; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " duc de Savoie\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">PER</span>\n", + "</mark>\n", + ", il subsiste trois tours. Ancienne chapelle, reconstruite en 1841, qui est le but d’un pèlerinage très fréquenté. </div></span>" + ], + "text/plain": [ + "<IPython.core.display.HTML object>" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "lge_beaufort_spacy = spacy_parser(normalized_lge_beaufort)\n", "displacy.render(lge_beaufort_spacy, style=\"ent\", jupyter=True)" @@ -1008,9 +2789,26 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 47, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "BEAUFORT LOC\n", + "Beaufort-sur-Doron LOC\n", + "Saint-Maximede-Bf.aufort LOC\n", + "Savoie LOC\n", + "Albertville LOC\n", + "Doron de Beaufort LOC\n", + "Beaufort LOC\n", + "château de la Salle LOC\n", + "Henri IV PER\n", + "duc de Savoie PER\n" + ] + } + ], "source": [ "lge_beaufort_stanza = stanza_parser(normalized_lge_beaufort)\n", "show_ents(lge_beaufort_stanza)" @@ -1051,9 +2849,59 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 48, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "* ARQUES, (Géog.) petite ville de France, en Normandie, au pays de Caux, sur la petite riviere d'Arques. Long. 18. 50. lat. 49. 54.\n" + ] + }, + { + "data": { + "text/html": [ + "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">* \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " ARQUES\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " , ( Géog . ) petite ville de \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " France\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " , en \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Normandie\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " , au pays de \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Caux\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " , sur la petite riviere d' \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Arques\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " . \n", + "<mark class=\"entity\" style=\"background: #ddd; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Long . 18 . 50 . lat . 49 . 54 .\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">MISC</span>\n", + "</mark>\n", + " </div></span>" + ], + "text/plain": [ + "<IPython.core.display.HTML object>" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "print(arques)\n", "displacy.render(arques_perdido.to_spacy_doc(), style=\"ent\", jupyter=True)" @@ -1068,9 +2916,150 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 49, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><span style=\"color:#565656\">Make this Notebook Trusted to load map: File -> Trust Notebook</span><iframe srcdoc=\"<!DOCTYPE html>\n", + "<head> \n", + " <meta http-equiv="content-type" content="text/html; charset=UTF-8" />\n", + " \n", + " <script>\n", + " L_NO_TOUCH = false;\n", + " L_DISABLE_3D = false;\n", + " </script>\n", + " \n", + " <style>html, body {width: 100%;height: 100%;margin: 0;padding: 0;}</style>\n", + " <style>#map {position:absolute;top:0;bottom:0;right:0;left:0;}</style>\n", + " <script src="https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.js"></script>\n", + " <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>\n", + " <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>\n", + " <script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>\n", + " <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css"/>\n", + " <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css"/>\n", + " <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css"/>\n", + " \n", + " <meta name="viewport" content="width=device-width,\n", + " initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n", + " <style>\n", + " #map_47c1c45a907073125927fd03fbed8cd9 {\n", + " position: relative;\n", + " width: 100.0%;\n", + " height: 100.0%;\n", + " left: 0.0%;\n", + " top: 0.0%;\n", + " }\n", + " </style>\n", + " \n", + " \n", + " <style>\n", + " .foliumtooltip {\n", + " \n", + " }\n", + " .foliumtooltip table{\n", + " margin: auto;\n", + " }\n", + " .foliumtooltip tr{\n", + " text-align: left;\n", + " }\n", + " .foliumtooltip th{\n", + " padding: 2px; padding-right: 8px;\n", + " }\n", + " </style>\n", + " \n", + "</head>\n", + "<body> \n", + " \n", + " <div class="folium-map" id="map_47c1c45a907073125927fd03fbed8cd9" ></div>\n", + " \n", + "</body>\n", + "<script> \n", + " \n", + " var map_47c1c45a907073125927fd03fbed8cd9 = L.map(\n", + " "map_47c1c45a907073125927fd03fbed8cd9",\n", + " {\n", + " center: [0, 0],\n", + " crs: L.CRS.EPSG3857,\n", + " zoom: 1,\n", + " zoomControl: true,\n", + " preferCanvas: false,\n", + " }\n", + " );\n", + "\n", + " \n", + "\n", + " \n", + " \n", + " var tile_layer_d3b784a4126cccdc3092bcbda0cc7987 = L.tileLayer(\n", + " "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",\n", + " {"attribution": "Data by \\u0026copy; \\u003ca href=\\"http://openstreetmap.org\\"\\u003eOpenStreetMap\\u003c/a\\u003e, under \\u003ca href=\\"http://www.openstreetmap.org/copyright\\"\\u003eODbL\\u003c/a\\u003e.", "detectRetina": false, "maxNativeZoom": 18, "maxZoom": 18, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false}\n", + " ).addTo(map_47c1c45a907073125927fd03fbed8cd9);\n", + " \n", + " \n", + " map_47c1c45a907073125927fd03fbed8cd9.fitBounds(\n", + " [[43.509654, 0.313853], [50.739664, 3.363576]],\n", + " {}\n", + " );\n", + " \n", + " \n", + "\n", + " function geo_json_a3e4c0b400df5357fc883c970024517f_onEachFeature(feature, layer) {\n", + " layer.on({\n", + " });\n", + " };\n", + " var geo_json_a3e4c0b400df5357fc883c970024517f = L.geoJson(null, {\n", + " onEachFeature: geo_json_a3e4c0b400df5357fc883c970024517f_onEachFeature,\n", + " \n", + " });\n", + "\n", + " function geo_json_a3e4c0b400df5357fc883c970024517f_add (data) {\n", + " geo_json_a3e4c0b400df5357fc883c970024517f\n", + " .addData(data)\n", + " .addTo(map_47c1c45a907073125927fd03fbed8cd9);\n", + " }\n", + " geo_json_a3e4c0b400df5357fc883c970024517f_add({"features": [{"geometry": {"coordinates": [2.306207, 50.739664], "type": "Point"}, "properties": {"country": "France", "id": "en.3", "name": "ARQUES", "source": "nominatim", "sourceName": "Arques, Saint-Omer, Pas-de-Calais, Hauts-de-France, France m\\u00e9tropolitaine, 62510, France", "type": "administrative"}, "type": "Feature"}, {"geometry": {"coordinates": [1.888334, 46.603354], "type": "Point"}, "properties": {"country": "France", "id": "en.7", "name": "France", "source": "nominatim", "sourceName": "France", "type": "administrative"}, "type": "Feature"}, {"geometry": {"coordinates": [0.313853, 49.067771], "type": "Point"}, "properties": {"country": "France", "id": "en.9", "name": "Normandie", "source": "nominatim", "sourceName": "Normandie, France m\\u00e9tropolitaine, France", "type": "administrative"}, "type": "Feature"}, {"geometry": {"coordinates": [3.363576, 43.509654], "type": "Point"}, "properties": {"country": "France", "id": "en.13", "name": "Caux", "source": "nominatim", "sourceName": "Caux, B\\u00e9ziers, H\\u00e9rault, Occitanie, France m\\u00e9tropolitaine, 34720, France", "type": "administrative"}, "type": "Feature"}, {"geometry": {"coordinates": [2.306207, 50.739664], "type": "Point"}, "properties": {"country": "France", "id": "en.17", "name": "Arques", "source": "nominatim", "sourceName": "Arques, Saint-Omer, Pas-de-Calais, Hauts-de-France, France m\\u00e9tropolitaine, 62510, France", "type": "administrative"}, "type": "Feature"}], "type": "FeatureCollection"});\n", + "\n", + " \n", + " \n", + " geo_json_a3e4c0b400df5357fc883c970024517f.bindTooltip(\n", + " function(layer){\n", + " let div = L.DomUtil.create('div');\n", + " \n", + " let handleObject = feature=>typeof(feature)=='object' ? JSON.stringify(feature) : feature;\n", + " let fields = ["name", "source"];\n", + " let aliases = ["name", "source"];\n", + " let table = '<table>' +\n", + " String(\n", + " fields.map(\n", + " (v,i)=>\n", + " `<tr>\n", + " <th>${aliases[i].toLocaleString()}</th>\n", + " \n", + " <td>${handleObject(layer.feature.properties[v]).toLocaleString()}</td>\n", + " </tr>`).join(''))\n", + " +'</table>';\n", + " div.innerHTML=table;\n", + " \n", + " return div\n", + " }\n", + " ,{"className": "foliumtooltip", "sticky": true});\n", + " \n", + "</script>\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>" + ], + "text/plain": [ + "<folium.folium.Map at 0x1630911c0>" + ] + }, + "execution_count": 49, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "# afficher la carte des lieux localisés\n", "arques_perdido.get_folium_map()" @@ -1096,9 +3085,150 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 50, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><span style=\"color:#565656\">Make this Notebook Trusted to load map: File -> Trust Notebook</span><iframe srcdoc=\"<!DOCTYPE html>\n", + "<head> \n", + " <meta http-equiv="content-type" content="text/html; charset=UTF-8" />\n", + " \n", + " <script>\n", + " L_NO_TOUCH = false;\n", + " L_DISABLE_3D = false;\n", + " </script>\n", + " \n", + " <style>html, body {width: 100%;height: 100%;margin: 0;padding: 0;}</style>\n", + " <style>#map {position:absolute;top:0;bottom:0;right:0;left:0;}</style>\n", + " <script src="https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.js"></script>\n", + " <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>\n", + " <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>\n", + " <script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>\n", + " <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css"/>\n", + " <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css"/>\n", + " <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css"/>\n", + " \n", + " <meta name="viewport" content="width=device-width,\n", + " initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n", + " <style>\n", + " #map_31b60ebf88bf45dbd221c6efd6aa1d81 {\n", + " position: relative;\n", + " width: 100.0%;\n", + " height: 100.0%;\n", + " left: 0.0%;\n", + " top: 0.0%;\n", + " }\n", + " </style>\n", + " \n", + " \n", + " <style>\n", + " .foliumtooltip {\n", + " \n", + " }\n", + " .foliumtooltip table{\n", + " margin: auto;\n", + " }\n", + " .foliumtooltip tr{\n", + " text-align: left;\n", + " }\n", + " .foliumtooltip th{\n", + " padding: 2px; padding-right: 8px;\n", + " }\n", + " </style>\n", + " \n", + "</head>\n", + "<body> \n", + " \n", + " <div class="folium-map" id="map_31b60ebf88bf45dbd221c6efd6aa1d81" ></div>\n", + " \n", + "</body>\n", + "<script> \n", + " \n", + " var map_31b60ebf88bf45dbd221c6efd6aa1d81 = L.map(\n", + " "map_31b60ebf88bf45dbd221c6efd6aa1d81",\n", + " {\n", + " center: [0, 0],\n", + " crs: L.CRS.EPSG3857,\n", + " zoom: 1,\n", + " zoomControl: true,\n", + " preferCanvas: false,\n", + " }\n", + " );\n", + "\n", + " \n", + "\n", + " \n", + " \n", + " var tile_layer_cb293adb9e57b7c9ece07508423a6773 = L.tileLayer(\n", + " "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",\n", + " {"attribution": "Data by \\u0026copy; \\u003ca href=\\"http://openstreetmap.org\\"\\u003eOpenStreetMap\\u003c/a\\u003e, under \\u003ca href=\\"http://www.openstreetmap.org/copyright\\"\\u003eODbL\\u003c/a\\u003e.", "detectRetina": false, "maxNativeZoom": 18, "maxZoom": 18, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false}\n", + " ).addTo(map_31b60ebf88bf45dbd221c6efd6aa1d81);\n", + " \n", + " \n", + " map_31b60ebf88bf45dbd221c6efd6aa1d81.fitBounds(\n", + " [[43.509654, 0.313853], [50.739664, 3.363576]],\n", + " {}\n", + " );\n", + " \n", + " \n", + "\n", + " function geo_json_7701b03570227b3b4a851b221ee87116_onEachFeature(feature, layer) {\n", + " layer.on({\n", + " });\n", + " };\n", + " var geo_json_7701b03570227b3b4a851b221ee87116 = L.geoJson(null, {\n", + " onEachFeature: geo_json_7701b03570227b3b4a851b221ee87116_onEachFeature,\n", + " \n", + " });\n", + "\n", + " function geo_json_7701b03570227b3b4a851b221ee87116_add (data) {\n", + " geo_json_7701b03570227b3b4a851b221ee87116\n", + " .addData(data)\n", + " .addTo(map_31b60ebf88bf45dbd221c6efd6aa1d81);\n", + " }\n", + " geo_json_7701b03570227b3b4a851b221ee87116_add({"features": [{"geometry": {"coordinates": [2.306207, 50.739664], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Arques", "source": "nominatim", "sourceName": "Arques, Saint-Omer, Pas-de-Calais, Hauts-de-France, France m\\u00e9tropolitaine, 62510, France", "type": "administrative"}, "type": "Feature"}, {"geometry": {"coordinates": [1.888334, 46.603354], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "France", "source": "nominatim", "sourceName": "France", "type": "administrative"}, "type": "Feature"}, {"geometry": {"coordinates": [0.313853, 49.067771], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Normandie", "source": "nominatim", "sourceName": "Normandie, France m\\u00e9tropolitaine, France", "type": "administrative"}, "type": "Feature"}, {"geometry": {"coordinates": [3.363576, 43.509654], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Caux", "source": "nominatim", "sourceName": "Caux, B\\u00e9ziers, H\\u00e9rault, Occitanie, France m\\u00e9tropolitaine, 34720, France", "type": "administrative"}, "type": "Feature"}], "type": "FeatureCollection"});\n", + "\n", + " \n", + " \n", + " geo_json_7701b03570227b3b4a851b221ee87116.bindTooltip(\n", + " function(layer){\n", + " let div = L.DomUtil.create('div');\n", + " \n", + " let handleObject = feature=>typeof(feature)=='object' ? JSON.stringify(feature) : feature;\n", + " let fields = ["name", "source"];\n", + " let aliases = ["name", "source"];\n", + " let table = '<table>' +\n", + " String(\n", + " fields.map(\n", + " (v,i)=>\n", + " `<tr>\n", + " <th>${aliases[i].toLocaleString()}</th>\n", + " \n", + " <td>${handleObject(layer.feature.properties[v]).toLocaleString()}</td>\n", + " </tr>`).join(''))\n", + " +'</table>';\n", + " div.innerHTML=table;\n", + " \n", + " return div\n", + " }\n", + " ,{"className": "foliumtooltip", "sticky": true});\n", + " \n", + "</script>\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>" + ], + "text/plain": [ + "<folium.folium.Map at 0x16cc3c070>" + ] + }, + "execution_count": 50, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "geocoder = Geocoder()\n", "doc = geocoder(['Arques', 'France', 'Normandie', 'Caux'])\n", @@ -1121,9 +3251,150 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 51, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><span style=\"color:#565656\">Make this Notebook Trusted to load map: File -> Trust Notebook</span><iframe srcdoc=\"<!DOCTYPE html>\n", + "<head> \n", + " <meta http-equiv="content-type" content="text/html; charset=UTF-8" />\n", + " \n", + " <script>\n", + " L_NO_TOUCH = false;\n", + " L_DISABLE_3D = false;\n", + " </script>\n", + " \n", + " <style>html, body {width: 100%;height: 100%;margin: 0;padding: 0;}</style>\n", + " <style>#map {position:absolute;top:0;bottom:0;right:0;left:0;}</style>\n", + " <script src="https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.js"></script>\n", + " <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>\n", + " <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>\n", + " <script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>\n", + " <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css"/>\n", + " <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css"/>\n", + " <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css"/>\n", + " \n", + " <meta name="viewport" content="width=device-width,\n", + " initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n", + " <style>\n", + " #map_ffb023baeedc20cf118cedb9e8ee33d6 {\n", + " position: relative;\n", + " width: 100.0%;\n", + " height: 100.0%;\n", + " left: 0.0%;\n", + " top: 0.0%;\n", + " }\n", + " </style>\n", + " \n", + " \n", + " <style>\n", + " .foliumtooltip {\n", + " \n", + " }\n", + " .foliumtooltip table{\n", + " margin: auto;\n", + " }\n", + " .foliumtooltip tr{\n", + " text-align: left;\n", + " }\n", + " .foliumtooltip th{\n", + " padding: 2px; padding-right: 8px;\n", + " }\n", + " </style>\n", + " \n", + "</head>\n", + "<body> \n", + " \n", + " <div class="folium-map" id="map_ffb023baeedc20cf118cedb9e8ee33d6" ></div>\n", + " \n", + "</body>\n", + "<script> \n", + " \n", + " var map_ffb023baeedc20cf118cedb9e8ee33d6 = L.map(\n", + " "map_ffb023baeedc20cf118cedb9e8ee33d6",\n", + " {\n", + " center: [0, 0],\n", + " crs: L.CRS.EPSG3857,\n", + " zoom: 1,\n", + " zoomControl: true,\n", + " preferCanvas: false,\n", + " }\n", + " );\n", + "\n", + " \n", + "\n", + " \n", + " \n", + " var tile_layer_1e7f6c36ebbb1fbf7996fb3b11dea650 = L.tileLayer(\n", + " "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",\n", + " {"attribution": "Data by \\u0026copy; \\u003ca href=\\"http://openstreetmap.org\\"\\u003eOpenStreetMap\\u003c/a\\u003e, under \\u003ca href=\\"http://www.openstreetmap.org/copyright\\"\\u003eODbL\\u003c/a\\u003e.", "detectRetina": false, "maxNativeZoom": 18, "maxZoom": 18, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false}\n", + " ).addTo(map_ffb023baeedc20cf118cedb9e8ee33d6);\n", + " \n", + " \n", + " map_ffb023baeedc20cf118cedb9e8ee33d6.fitBounds(\n", + " [[50.739664, 2.306207], [50.739664, 2.306207]],\n", + " {}\n", + " );\n", + " \n", + " \n", + "\n", + " function geo_json_e44f36fa372044b310cdbdc8cd177a10_onEachFeature(feature, layer) {\n", + " layer.on({\n", + " });\n", + " };\n", + " var geo_json_e44f36fa372044b310cdbdc8cd177a10 = L.geoJson(null, {\n", + " onEachFeature: geo_json_e44f36fa372044b310cdbdc8cd177a10_onEachFeature,\n", + " \n", + " });\n", + "\n", + " function geo_json_e44f36fa372044b310cdbdc8cd177a10_add (data) {\n", + " geo_json_e44f36fa372044b310cdbdc8cd177a10\n", + " .addData(data)\n", + " .addTo(map_ffb023baeedc20cf118cedb9e8ee33d6);\n", + " }\n", + " geo_json_e44f36fa372044b310cdbdc8cd177a10_add({"features": [{"geometry": {"coordinates": [2.306207, 50.739664], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Arques", "source": "nominatim", "sourceName": "Arques, Saint-Omer, Pas-de-Calais, Hauts-de-France, France m\\u00e9tropolitaine, 62510, France", "type": "administrative"}, "type": "Feature"}], "type": "FeatureCollection"});\n", + "\n", + " \n", + " \n", + " geo_json_e44f36fa372044b310cdbdc8cd177a10.bindTooltip(\n", + " function(layer){\n", + " let div = L.DomUtil.create('div');\n", + " \n", + " let handleObject = feature=>typeof(feature)=='object' ? JSON.stringify(feature) : feature;\n", + " let fields = ["name", "source"];\n", + " let aliases = ["name", "source"];\n", + " let table = '<table>' +\n", + " String(\n", + " fields.map(\n", + " (v,i)=>\n", + " `<tr>\n", + " <th>${aliases[i].toLocaleString()}</th>\n", + " \n", + " <td>${handleObject(layer.feature.properties[v]).toLocaleString()}</td>\n", + " </tr>`).join(''))\n", + " +'</table>';\n", + " div.innerHTML=table;\n", + " \n", + " return div\n", + " }\n", + " ,{"className": "foliumtooltip", "sticky": true});\n", + " \n", + "</script>\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>" + ], + "text/plain": [ + "<folium.folium.Map at 0x163086a60>" + ] + }, + "execution_count": 51, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "geocoder = Geocoder()\n", "doc = geocoder('Arques')\n", @@ -1143,9 +3414,150 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 52, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><span style=\"color:#565656\">Make this Notebook Trusted to load map: File -> Trust Notebook</span><iframe srcdoc=\"<!DOCTYPE html>\n", + "<head> \n", + " <meta http-equiv="content-type" content="text/html; charset=UTF-8" />\n", + " \n", + " <script>\n", + " L_NO_TOUCH = false;\n", + " L_DISABLE_3D = false;\n", + " </script>\n", + " \n", + " <style>html, body {width: 100%;height: 100%;margin: 0;padding: 0;}</style>\n", + " <style>#map {position:absolute;top:0;bottom:0;right:0;left:0;}</style>\n", + " <script src="https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.js"></script>\n", + " <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>\n", + " <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>\n", + " <script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>\n", + " <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css"/>\n", + " <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css"/>\n", + " <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css"/>\n", + " \n", + " <meta name="viewport" content="width=device-width,\n", + " initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n", + " <style>\n", + " #map_451d894b9df3e170139c248313c42568 {\n", + " position: relative;\n", + " width: 100.0%;\n", + " height: 100.0%;\n", + " left: 0.0%;\n", + " top: 0.0%;\n", + " }\n", + " </style>\n", + " \n", + " \n", + " <style>\n", + " .foliumtooltip {\n", + " \n", + " }\n", + " .foliumtooltip table{\n", + " margin: auto;\n", + " }\n", + " .foliumtooltip tr{\n", + " text-align: left;\n", + " }\n", + " .foliumtooltip th{\n", + " padding: 2px; padding-right: 8px;\n", + " }\n", + " </style>\n", + " \n", + "</head>\n", + "<body> \n", + " \n", + " <div class="folium-map" id="map_451d894b9df3e170139c248313c42568" ></div>\n", + " \n", + "</body>\n", + "<script> \n", + " \n", + " var map_451d894b9df3e170139c248313c42568 = L.map(\n", + " "map_451d894b9df3e170139c248313c42568",\n", + " {\n", + " center: [0, 0],\n", + " crs: L.CRS.EPSG3857,\n", + " zoom: 1,\n", + " zoomControl: true,\n", + " preferCanvas: false,\n", + " }\n", + " );\n", + "\n", + " \n", + "\n", + " \n", + " \n", + " var tile_layer_a5f3c5c578bda1d809925e223b5aae9b = L.tileLayer(\n", + " "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",\n", + " {"attribution": "Data by \\u0026copy; \\u003ca href=\\"http://openstreetmap.org\\"\\u003eOpenStreetMap\\u003c/a\\u003e, under \\u003ca href=\\"http://www.openstreetmap.org/copyright\\"\\u003eODbL\\u003c/a\\u003e.", "detectRetina": false, "maxNativeZoom": 18, "maxZoom": 18, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false}\n", + " ).addTo(map_451d894b9df3e170139c248313c42568);\n", + " \n", + " \n", + " map_451d894b9df3e170139c248313c42568.fitBounds(\n", + " [[41.661452, -8.721672], [50.746125, 3.119602]],\n", + " {}\n", + " );\n", + " \n", + " \n", + "\n", + " function geo_json_09e59b957292b7a5b999e789a5e3a1c9_onEachFeature(feature, layer) {\n", + " layer.on({\n", + " });\n", + " };\n", + " var geo_json_09e59b957292b7a5b999e789a5e3a1c9 = L.geoJson(null, {\n", + " onEachFeature: geo_json_09e59b957292b7a5b999e789a5e3a1c9_onEachFeature,\n", + " \n", + " });\n", + "\n", + " function geo_json_09e59b957292b7a5b999e789a5e3a1c9_add (data) {\n", + " geo_json_09e59b957292b7a5b999e789a5e3a1c9\n", + " .addData(data)\n", + " .addTo(map_451d894b9df3e170139c248313c42568);\n", + " }\n", + " geo_json_09e59b957292b7a5b999e789a5e3a1c9_add({"features": [{"geometry": {"coordinates": [2.306207, 50.739664], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Arques", "source": "nominatim", "sourceName": "Arques, Saint-Omer, Pas-de-Calais, Hauts-de-France, France m\\u00e9tropolitaine, 62510, France", "type": "administrative"}, "type": "Feature"}, {"geometry": {"coordinates": [2.374819, 42.952872], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Arques", "source": "nominatim", "sourceName": "Arques, Limoux, Aude, Occitanie, France m\\u00e9tropolitaine, 11190, France", "type": "administrative"}, "type": "Feature"}, {"geometry": {"coordinates": [2.799134, 44.317619], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Arques", "source": "nominatim", "sourceName": "Arques, Millau, Aveyron, Occitanie, France m\\u00e9tropolitaine, 12290, France", "type": "administrative"}, "type": "Feature"}, {"geometry": {"coordinates": [1.648002, 44.968669], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Arques", "source": "nominatim", "sourceName": "Arques, Strenquels, Gourdon, Lot, Occitanie, France m\\u00e9tropolitaine, 46110, France", "type": "hamlet"}, "type": "Feature"}, {"geometry": {"coordinates": [-8.721672, 41.661452], "type": "Point"}, "properties": {"country": "Portugal", "id": 0, "name": "Arques", "source": "nominatim", "sourceName": "Arques, Vila de Punhe, Viana do Castelo, 4905-643, Portugal", "type": "hamlet"}, "type": "Feature"}, {"geometry": {"coordinates": [3.119602, 44.004793], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Arques", "source": "nominatim", "sourceName": "Arques, Lapanouse-de-Cernon, Millau, Aveyron, Occitanie, France m\\u00e9tropolitaine, 12230, France", "type": "isolated_dwelling"}, "type": "Feature"}, {"geometry": {"coordinates": [2.320674, 50.746125], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Arques", "source": "nominatim", "sourceName": "Arques (Parc naturel r\\u00e9gional des caps et marais d\\u0027Opale), Arques, Saint-Omer, Pas-de-Calais, Hauts-de-France, France m\\u00e9tropolitaine, 62510, France", "type": "admin_fraction"}, "type": "Feature"}, {"geometry": {"coordinates": [2.05149, 42.812241], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Arques", "source": "nominatim", "sourceName": "Arques, Galinagues, Limoux, Aude, Occitanie, France m\\u00e9tropolitaine, 11140, France", "type": "locality"}, "type": "Feature"}, {"geometry": {"coordinates": [0.252495, 43.245551], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Arques", "source": "nominatim", "sourceName": "Arqu\\u00e8s, Goudon, Tarbes, Hautes-Pyr\\u00e9n\\u00e9es, Occitanie, France m\\u00e9tropolitaine, 65190, France", "type": "locality"}, "type": "Feature"}, {"geometry": {"coordinates": [2.302074, 50.728092], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Arques", "source": "nominatim", "sourceName": "Arques, Rue de Boulogne, Arques, Saint-Omer, Pas-de-Calais, Hauts-de-France, France m\\u00e9tropolitaine, 62510, France", "type": "station"}, "type": "Feature"}], "type": "FeatureCollection"});\n", + "\n", + " \n", + " \n", + " geo_json_09e59b957292b7a5b999e789a5e3a1c9.bindTooltip(\n", + " function(layer){\n", + " let div = L.DomUtil.create('div');\n", + " \n", + " let handleObject = feature=>typeof(feature)=='object' ? JSON.stringify(feature) : feature;\n", + " let fields = ["name", "source"];\n", + " let aliases = ["name", "source"];\n", + " let table = '<table>' +\n", + " String(\n", + " fields.map(\n", + " (v,i)=>\n", + " `<tr>\n", + " <th>${aliases[i].toLocaleString()}</th>\n", + " \n", + " <td>${handleObject(layer.feature.properties[v]).toLocaleString()}</td>\n", + " </tr>`).join(''))\n", + " +'</table>';\n", + " div.innerHTML=table;\n", + " \n", + " return div\n", + " }\n", + " ,{"className": "foliumtooltip", "sticky": true});\n", + " \n", + "</script>\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>" + ], + "text/plain": [ + "<folium.folium.Map at 0x16cbbc700>" + ] + }, + "execution_count": 52, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "geocoder = Geocoder(max_rows=10)\n", "doc = geocoder('Arques')\n", @@ -1163,9 +3575,150 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 53, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><span style=\"color:#565656\">Make this Notebook Trusted to load map: File -> Trust Notebook</span><iframe srcdoc=\"<!DOCTYPE html>\n", + "<head> \n", + " <meta http-equiv="content-type" content="text/html; charset=UTF-8" />\n", + " \n", + " <script>\n", + " L_NO_TOUCH = false;\n", + " L_DISABLE_3D = false;\n", + " </script>\n", + " \n", + " <style>html, body {width: 100%;height: 100%;margin: 0;padding: 0;}</style>\n", + " <style>#map {position:absolute;top:0;bottom:0;right:0;left:0;}</style>\n", + " <script src="https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.js"></script>\n", + " <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>\n", + " <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>\n", + " <script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>\n", + " <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css"/>\n", + " <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css"/>\n", + " <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css"/>\n", + " \n", + " <meta name="viewport" content="width=device-width,\n", + " initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n", + " <style>\n", + " #map_4fce587934bca14fd4725f3446e1ae4e {\n", + " position: relative;\n", + " width: 100.0%;\n", + " height: 100.0%;\n", + " left: 0.0%;\n", + " top: 0.0%;\n", + " }\n", + " </style>\n", + " \n", + " \n", + " <style>\n", + " .foliumtooltip {\n", + " \n", + " }\n", + " .foliumtooltip table{\n", + " margin: auto;\n", + " }\n", + " .foliumtooltip tr{\n", + " text-align: left;\n", + " }\n", + " .foliumtooltip th{\n", + " padding: 2px; padding-right: 8px;\n", + " }\n", + " </style>\n", + " \n", + "</head>\n", + "<body> \n", + " \n", + " <div class="folium-map" id="map_4fce587934bca14fd4725f3446e1ae4e" ></div>\n", + " \n", + "</body>\n", + "<script> \n", + " \n", + " var map_4fce587934bca14fd4725f3446e1ae4e = L.map(\n", + " "map_4fce587934bca14fd4725f3446e1ae4e",\n", + " {\n", + " center: [0, 0],\n", + " crs: L.CRS.EPSG3857,\n", + " zoom: 1,\n", + " zoomControl: true,\n", + " preferCanvas: false,\n", + " }\n", + " );\n", + "\n", + " \n", + "\n", + " \n", + " \n", + " var tile_layer_7cdc0b6873d6668274efc9c6beab9093 = L.tileLayer(\n", + " "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",\n", + " {"attribution": "Data by \\u0026copy; \\u003ca href=\\"http://openstreetmap.org\\"\\u003eOpenStreetMap\\u003c/a\\u003e, under \\u003ca href=\\"http://www.openstreetmap.org/copyright\\"\\u003eODbL\\u003c/a\\u003e.", "detectRetina": false, "maxNativeZoom": 18, "maxZoom": 18, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false}\n", + " ).addTo(map_4fce587934bca14fd4725f3446e1ae4e);\n", + " \n", + " \n", + " map_4fce587934bca14fd4725f3446e1ae4e.fitBounds(\n", + " [[42.734711, 1.544996], [42.734711, 1.544996]],\n", + " {}\n", + " );\n", + " \n", + " \n", + "\n", + " function geo_json_ca070113cee12cb8f54698319bdbaf4c_onEachFeature(feature, layer) {\n", + " layer.on({\n", + " });\n", + " };\n", + " var geo_json_ca070113cee12cb8f54698319bdbaf4c = L.geoJson(null, {\n", + " onEachFeature: geo_json_ca070113cee12cb8f54698319bdbaf4c_onEachFeature,\n", + " \n", + " });\n", + "\n", + " function geo_json_ca070113cee12cb8f54698319bdbaf4c_add (data) {\n", + " geo_json_ca070113cee12cb8f54698319bdbaf4c\n", + " .addData(data)\n", + " .addTo(map_4fce587934bca14fd4725f3446e1ae4e);\n", + " }\n", + " geo_json_ca070113cee12cb8f54698319bdbaf4c_add({"features": [{"geometry": {"coordinates": [1.544996, 42.734711], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Arques", "source": "ign", "sourceName": "Siguer", "type": "Versant"}, "type": "Feature"}], "type": "FeatureCollection"});\n", + "\n", + " \n", + " \n", + " geo_json_ca070113cee12cb8f54698319bdbaf4c.bindTooltip(\n", + " function(layer){\n", + " let div = L.DomUtil.create('div');\n", + " \n", + " let handleObject = feature=>typeof(feature)=='object' ? JSON.stringify(feature) : feature;\n", + " let fields = ["name", "source"];\n", + " let aliases = ["name", "source"];\n", + " let table = '<table>' +\n", + " String(\n", + " fields.map(\n", + " (v,i)=>\n", + " `<tr>\n", + " <th>${aliases[i].toLocaleString()}</th>\n", + " \n", + " <td>${handleObject(layer.feature.properties[v]).toLocaleString()}</td>\n", + " </tr>`).join(''))\n", + " +'</table>';\n", + " div.innerHTML=table;\n", + " \n", + " return div\n", + " }\n", + " ,{"className": "foliumtooltip", "sticky": true});\n", + " \n", + "</script>\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>" + ], + "text/plain": [ + "<folium.folium.Map at 0x16cd000a0>" + ] + }, + "execution_count": 53, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "geocoder = Geocoder(sources=['ign'])\n", "doc = geocoder('Arques')\n", @@ -1183,9 +3736,150 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 54, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><span style=\"color:#565656\">Make this Notebook Trusted to load map: File -> Trust Notebook</span><iframe srcdoc=\"<!DOCTYPE html>\n", + "<head> \n", + " <meta http-equiv="content-type" content="text/html; charset=UTF-8" />\n", + " \n", + " <script>\n", + " L_NO_TOUCH = false;\n", + " L_DISABLE_3D = false;\n", + " </script>\n", + " \n", + " <style>html, body {width: 100%;height: 100%;margin: 0;padding: 0;}</style>\n", + " <style>#map {position:absolute;top:0;bottom:0;right:0;left:0;}</style>\n", + " <script src="https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.js"></script>\n", + " <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>\n", + " <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>\n", + " <script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>\n", + " <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css"/>\n", + " <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css"/>\n", + " <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css"/>\n", + " \n", + " <meta name="viewport" content="width=device-width,\n", + " initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n", + " <style>\n", + " #map_cc364fd97b2f5dbe480e3049d7e17204 {\n", + " position: relative;\n", + " width: 100.0%;\n", + " height: 100.0%;\n", + " left: 0.0%;\n", + " top: 0.0%;\n", + " }\n", + " </style>\n", + " \n", + " \n", + " <style>\n", + " .foliumtooltip {\n", + " \n", + " }\n", + " .foliumtooltip table{\n", + " margin: auto;\n", + " }\n", + " .foliumtooltip tr{\n", + " text-align: left;\n", + " }\n", + " .foliumtooltip th{\n", + " padding: 2px; padding-right: 8px;\n", + " }\n", + " </style>\n", + " \n", + "</head>\n", + "<body> \n", + " \n", + " <div class="folium-map" id="map_cc364fd97b2f5dbe480e3049d7e17204" ></div>\n", + " \n", + "</body>\n", + "<script> \n", + " \n", + " var map_cc364fd97b2f5dbe480e3049d7e17204 = L.map(\n", + " "map_cc364fd97b2f5dbe480e3049d7e17204",\n", + " {\n", + " center: [0, 0],\n", + " crs: L.CRS.EPSG3857,\n", + " zoom: 1,\n", + " zoomControl: true,\n", + " preferCanvas: false,\n", + " }\n", + " );\n", + "\n", + " \n", + "\n", + " \n", + " \n", + " var tile_layer_84dfd4c7653a693097b04a41115c9e65 = L.tileLayer(\n", + " "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",\n", + " {"attribution": "Data by \\u0026copy; \\u003ca href=\\"http://openstreetmap.org\\"\\u003eOpenStreetMap\\u003c/a\\u003e, under \\u003ca href=\\"http://www.openstreetmap.org/copyright\\"\\u003eODbL\\u003c/a\\u003e.", "detectRetina": false, "maxNativeZoom": 18, "maxZoom": 18, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false}\n", + " ).addTo(map_cc364fd97b2f5dbe480e3049d7e17204);\n", + " \n", + " \n", + " map_cc364fd97b2f5dbe480e3049d7e17204.fitBounds(\n", + " [[42.734711, 0.253068], [50.733882, 2.799876]],\n", + " {}\n", + " );\n", + " \n", + " \n", + "\n", + " function geo_json_9024b1099d68dd6a463d4e8aba72031f_onEachFeature(feature, layer) {\n", + " layer.on({\n", + " });\n", + " };\n", + " var geo_json_9024b1099d68dd6a463d4e8aba72031f = L.geoJson(null, {\n", + " onEachFeature: geo_json_9024b1099d68dd6a463d4e8aba72031f_onEachFeature,\n", + " \n", + " });\n", + "\n", + " function geo_json_9024b1099d68dd6a463d4e8aba72031f_add (data) {\n", + " geo_json_9024b1099d68dd6a463d4e8aba72031f\n", + " .addData(data)\n", + " .addTo(map_cc364fd97b2f5dbe480e3049d7e17204);\n", + " }\n", + " geo_json_9024b1099d68dd6a463d4e8aba72031f_add({"features": [{"geometry": {"coordinates": [1.544996, 42.734711], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Arques", "source": "ign", "sourceName": "Siguer", "type": "Versant"}, "type": "Feature"}, {"geometry": {"coordinates": [2.376764, 42.952434], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Arques", "source": "ign", "sourceName": "Arques", "type": "Commune"}, "type": "Feature"}, {"geometry": {"coordinates": [2.799876, 44.317956], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Arques", "source": "ign", "sourceName": "Arques", "type": "Commune"}, "type": "Feature"}, {"geometry": {"coordinates": [1.250132, 43.293669], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Arques", "source": "ign", "sourceName": "Marquefave", "type": "Lieu-dit habit\\u00e9"}, "type": "Feature"}, {"geometry": {"coordinates": [1.647947, 44.968879], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Arques", "source": "ign", "sourceName": "Strenquels", "type": "Lieu-dit habit\\u00e9"}, "type": "Feature"}, {"geometry": {"coordinates": [2.294824, 50.733882], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Arques", "source": "ign", "sourceName": "Arques", "type": "Commune"}, "type": "Feature"}, {"geometry": {"coordinates": [0.253068, 43.245235], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Arques", "source": "ign", "sourceName": "Goudon", "type": "Lieu-dit non habit\\u00e9"}, "type": "Feature"}, {"geometry": {"coordinates": [2.792246, 44.065762], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Arques", "source": "ign", "sourceName": "Viala-du-Tarn", "type": "Lieu-dit habit\\u00e9"}, "type": "Feature"}, {"geometry": {"coordinates": [2.793915, 44.068551], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Arques", "source": "ign", "sourceName": "Viala-du-Tarn", "type": "Lieu-dit habit\\u00e9"}, "type": "Feature"}, {"geometry": {"coordinates": [1.125078, 49.880248], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Arques", "source": "ign", "sourceName": "Arques-la-Bataille", "type": "Commune"}, "type": "Feature"}], "type": "FeatureCollection"});\n", + "\n", + " \n", + " \n", + " geo_json_9024b1099d68dd6a463d4e8aba72031f.bindTooltip(\n", + " function(layer){\n", + " let div = L.DomUtil.create('div');\n", + " \n", + " let handleObject = feature=>typeof(feature)=='object' ? JSON.stringify(feature) : feature;\n", + " let fields = ["name", "source"];\n", + " let aliases = ["name", "source"];\n", + " let table = '<table>' +\n", + " String(\n", + " fields.map(\n", + " (v,i)=>\n", + " `<tr>\n", + " <th>${aliases[i].toLocaleString()}</th>\n", + " \n", + " <td>${handleObject(layer.feature.properties[v]).toLocaleString()}</td>\n", + " </tr>`).join(''))\n", + " +'</table>';\n", + " div.innerHTML=table;\n", + " \n", + " return div\n", + " }\n", + " ,{"className": "foliumtooltip", "sticky": true});\n", + " \n", + "</script>\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>" + ], + "text/plain": [ + "<folium.folium.Map at 0x16cd00ac0>" + ] + }, + "execution_count": 54, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "geocoder = Geocoder(sources=['ign'], max_rows=10)\n", "doc = geocoder('Arques')\n", @@ -1220,9 +3914,150 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 55, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><span style=\"color:#565656\">Make this Notebook Trusted to load map: File -> Trust Notebook</span><iframe srcdoc=\"<!DOCTYPE html>\n", + "<head> \n", + " <meta http-equiv="content-type" content="text/html; charset=UTF-8" />\n", + " \n", + " <script>\n", + " L_NO_TOUCH = false;\n", + " L_DISABLE_3D = false;\n", + " </script>\n", + " \n", + " <style>html, body {width: 100%;height: 100%;margin: 0;padding: 0;}</style>\n", + " <style>#map {position:absolute;top:0;bottom:0;right:0;left:0;}</style>\n", + " <script src="https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.js"></script>\n", + " <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>\n", + " <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>\n", + " <script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>\n", + " <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css"/>\n", + " <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css"/>\n", + " <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css"/>\n", + " \n", + " <meta name="viewport" content="width=device-width,\n", + " initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n", + " <style>\n", + " #map_2d75079bd7be3f5ff11c5b214f71daf5 {\n", + " position: relative;\n", + " width: 100.0%;\n", + " height: 100.0%;\n", + " left: 0.0%;\n", + " top: 0.0%;\n", + " }\n", + " </style>\n", + " \n", + " \n", + " <style>\n", + " .foliumtooltip {\n", + " \n", + " }\n", + " .foliumtooltip table{\n", + " margin: auto;\n", + " }\n", + " .foliumtooltip tr{\n", + " text-align: left;\n", + " }\n", + " .foliumtooltip th{\n", + " padding: 2px; padding-right: 8px;\n", + " }\n", + " </style>\n", + " \n", + "</head>\n", + "<body> \n", + " \n", + " <div class="folium-map" id="map_2d75079bd7be3f5ff11c5b214f71daf5" ></div>\n", + " \n", + "</body>\n", + "<script> \n", + " \n", + " var map_2d75079bd7be3f5ff11c5b214f71daf5 = L.map(\n", + " "map_2d75079bd7be3f5ff11c5b214f71daf5",\n", + " {\n", + " center: [0, 0],\n", + " crs: L.CRS.EPSG3857,\n", + " zoom: 1,\n", + " zoomControl: true,\n", + " preferCanvas: false,\n", + " }\n", + " );\n", + "\n", + " \n", + "\n", + " \n", + " \n", + " var tile_layer_5d09c7fa8a3eafe3c23fc7616c49f370 = L.tileLayer(\n", + " "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",\n", + " {"attribution": "Data by \\u0026copy; \\u003ca href=\\"http://openstreetmap.org\\"\\u003eOpenStreetMap\\u003c/a\\u003e, under \\u003ca href=\\"http://www.openstreetmap.org/copyright\\"\\u003eODbL\\u003c/a\\u003e.", "detectRetina": false, "maxNativeZoom": 18, "maxZoom": 18, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false}\n", + " ).addTo(map_2d75079bd7be3f5ff11c5b214f71daf5);\n", + " \n", + " \n", + " map_2d75079bd7be3f5ff11c5b214f71daf5.fitBounds(\n", + " [[43.079622, -4.068862], [50.130325, 5.821841]],\n", + " {}\n", + " );\n", + " \n", + " \n", + "\n", + " function geo_json_83aa75e5e44a20bec602f8d403e7f743_onEachFeature(feature, layer) {\n", + " layer.on({\n", + " });\n", + " };\n", + " var geo_json_83aa75e5e44a20bec602f8d403e7f743 = L.geoJson(null, {\n", + " onEachFeature: geo_json_83aa75e5e44a20bec602f8d403e7f743_onEachFeature,\n", + " \n", + " });\n", + "\n", + " function geo_json_83aa75e5e44a20bec602f8d403e7f743_add (data) {\n", + " geo_json_83aa75e5e44a20bec602f8d403e7f743\n", + " .addData(data)\n", + " .addTo(map_2d75079bd7be3f5ff11c5b214f71daf5);\n", + " }\n", + " geo_json_83aa75e5e44a20bec602f8d403e7f743_add({"features": [{"geometry": {"coordinates": [5.096652, 45.869265], "type": "Point"}, "properties": {"country": "France", "id": "en.5", "name": "France", "source": "ign", "sourceName": "Bressolles", "type": "Quartier"}, "type": "Feature"}, {"geometry": {"coordinates": [5.354185, 46.233164], "type": "Point"}, "properties": {"country": "France", "id": "en.5", "name": "France", "source": "ign", "sourceName": "Meillonnas", "type": "Lieu-dit habit\\u00e9"}, "type": "Feature"}, {"geometry": {"coordinates": [5.67897, 44.471041], "type": "Point"}, "properties": {"country": "France", "id": "en.5", "name": "France", "source": "ign", "sourceName": "La Piarre", "type": "Bois"}, "type": "Feature"}, {"geometry": {"coordinates": [2.175565, 43.079622], "type": "Point"}, "properties": {"country": "France", "id": "en.5", "name": "France", "source": "ign", "sourceName": "Gaja-et-Villedieu", "type": "Lieu-dit habit\\u00e9"}, "type": "Feature"}, {"geometry": {"coordinates": [1.789769, 43.233532], "type": "Point"}, "properties": {"country": "France", "id": "en.5", "name": "France", "source": "ign", "sourceName": "Saint-Sernin", "type": "Lieu-dit habit\\u00e9"}, "type": "Feature"}, {"geometry": {"coordinates": [5.577606, 43.570891], "type": "Point"}, "properties": {"country": "France", "id": "en.5", "name": "France", "source": "ign", "sourceName": "Vauvenargues", "type": "Ruines"}, "type": "Feature"}, {"geometry": {"coordinates": [-0.848019, 45.603663], "type": "Point"}, "properties": {"country": "France", "id": "en.5", "name": "France", "source": "ign", "sourceName": "Gr\\u00e9zac", "type": "Lieu-dit habit\\u00e9"}, "type": "Feature"}, {"geometry": {"coordinates": [-0.581724, 45.494817], "type": "Point"}, "properties": {"country": "France", "id": "en.5", "name": "France", "source": "ign", "sourceName": "Bois", "type": "Lieu-dit habit\\u00e9"}, "type": "Feature"}, {"geometry": {"coordinates": [1.617984, 45.368456], "type": "Point"}, "properties": {"country": "France", "id": "en.5", "name": "France", "source": "ign", "sourceName": "Lagrauli\\u00e8re", "type": "Lieu-dit habit\\u00e9"}, "type": "Feature"}, {"geometry": {"coordinates": [0.941046, 43.167396], "type": "Point"}, "properties": {"country": "France", "id": "en.5", "name": "France", "source": "ign", "sourceName": "Mancioux", "type": "Lieu-dit habit\\u00e9"}, "type": "Feature"}, {"geometry": {"coordinates": [4.851823, 50.130325], "type": "Point"}, "properties": {"country": "France", "id": "en.7", "name": "Normandie", "source": "ign", "sourceName": "Givet", "type": "Lieu-dit habit\\u00e9"}, "type": "Feature"}, {"geometry": {"coordinates": [2.447184, 44.723667], "type": "Point"}, "properties": {"country": "France", "id": "en.7", "name": "Normandie", "source": "ign", "sourceName": "Junhac", "type": "Lieu-dit habit\\u00e9"}, "type": "Feature"}, {"geometry": {"coordinates": [-0.855164, 46.246698], "type": "Point"}, "properties": {"country": "France", "id": "en.7", "name": "Normandie", "source": "ign", "sourceName": "Saint-Jean-de-Liversay", "type": "Lieu-dit habit\\u00e9"}, "type": "Feature"}, {"geometry": {"coordinates": [-2.743228, 48.323177], "type": "Point"}, "properties": {"country": "France", "id": "en.7", "name": "Normandie", "source": "ign", "sourceName": "Pl\\u0153uc-L\\u0027Hermitage", "type": "Lieu-dit habit\\u00e9"}, "type": "Feature"}, {"geometry": {"coordinates": [1.102508, 49.443031], "type": "Point"}, "properties": {"country": "France", "id": "en.7", "name": "Normandie", "source": "ign", "sourceName": "Rouen", "type": "R\\u00e9gion"}, "type": "Feature"}, {"geometry": {"coordinates": [-4.068862, 48.297443], "type": "Point"}, "properties": {"country": "France", "id": "en.7", "name": "Normandie", "source": "ign", "sourceName": "Pont-de-Buis-l\\u00e8s-Quimerch", "type": "Lieu-dit non habit\\u00e9"}, "type": "Feature"}, {"geometry": {"coordinates": [-1.64847, 48.231258], "type": "Point"}, "properties": {"country": "France", "id": "en.7", "name": "Normandie", "source": "ign", "sourceName": "Melesse", "type": "Lieu-dit habit\\u00e9"}, "type": "Feature"}, {"geometry": {"coordinates": [5.821841, 47.307332], "type": "Point"}, "properties": {"country": "France", "id": "en.7", "name": "Normandie", "source": "ign", "sourceName": "Brussey", "type": "Lieu-dit non habit\\u00e9"}, "type": "Feature"}, {"geometry": {"coordinates": [2.90554, 48.223278], "type": "Point"}, "properties": {"country": "France", "id": "en.7", "name": "Normandie", "source": "ign", "sourceName": "Lorrez-le-Bocage-Pr\\u00e9aux", "type": "Lieu-dit habit\\u00e9"}, "type": "Feature"}, {"geometry": {"coordinates": [1.240619, 44.159185], "type": "Point"}, "properties": {"country": "France", "id": "en.7", "name": "Normandie", "source": "ign", "sourceName": "Lafran\\u00e7aise", "type": "Lieu-dit habit\\u00e9"}, "type": "Feature"}, {"geometry": {"coordinates": [2.553925, 46.432375], "type": "Point"}, "properties": {"country": "France", "id": "en.11", "name": "Caux", "source": "ign", "sourceName": "La Chapelaude", "type": "Lieu-dit habit\\u00e9"}, "type": "Feature"}, {"geometry": {"coordinates": [2.255493, 43.225454], "type": "Point"}, "properties": {"country": "France", "id": "en.11", "name": "Caux", "source": "ign", "sourceName": "Caux-et-Sauzens", "type": "Commune"}, "type": "Feature"}, {"geometry": {"coordinates": [2.047133, 45.725903], "type": "Point"}, "properties": {"country": "France", "id": "en.11", "name": "Caux", "source": "ign", "sourceName": "Peyrelevade", "type": "Lieu-dit habit\\u00e9"}, "type": "Feature"}, {"geometry": {"coordinates": [2.039653, 45.401722], "type": "Point"}, "properties": {"country": "France", "id": "en.11", "name": "Caux", "source": "ign", "sourceName": "\\u00c9gletons", "type": "Quartier"}, "type": "Feature"}, {"geometry": {"coordinates": [1.888828, 45.30495], "type": "Point"}, "properties": {"country": "France", "id": "en.11", "name": "Caux", "source": "ign", "sourceName": "Saint-Priest-de-Gimel", "type": "Lieu-dit habit\\u00e9"}, "type": "Feature"}, {"geometry": {"coordinates": [1.787262, 46.284578], "type": "Point"}, "properties": {"country": "France", "id": "en.11", "name": "Caux", "source": "ign", "sourceName": "La Celle-Dunoise", "type": "Lieu-dit habit\\u00e9"}, "type": "Feature"}, {"geometry": {"coordinates": [3.368457, 43.50344], "type": "Point"}, "properties": {"country": "France", "id": "en.11", "name": "Caux", "source": "ign", "sourceName": "Caux", "type": "Commune"}, "type": "Feature"}, {"geometry": {"coordinates": [3.448328, 45.208555], "type": "Point"}, "properties": {"country": "France", "id": "en.11", "name": "Caux", "source": "ign", "sourceName": "Saint-Privat-du-Dragon", "type": "Bois"}, "type": "Feature"}, {"geometry": {"coordinates": [1.13549, 44.381744], "type": "Point"}, "properties": {"country": "France", "id": "en.11", "name": "Caux", "source": "ign", "sourceName": "Montcuq-en-Quercy-Blanc", "type": "Lieu-dit habit\\u00e9"}, "type": "Feature"}, {"geometry": {"coordinates": [2.684528, 45.458418], "type": "Point"}, "properties": {"country": "France", "id": "en.11", "name": "Caux", "source": "ign", "sourceName": "Saint-Donat", "type": "Lieu-dit habit\\u00e9"}, "type": "Feature"}], "type": "FeatureCollection"});\n", + "\n", + " \n", + " \n", + " geo_json_83aa75e5e44a20bec602f8d403e7f743.bindTooltip(\n", + " function(layer){\n", + " let div = L.DomUtil.create('div');\n", + " \n", + " let handleObject = feature=>typeof(feature)=='object' ? JSON.stringify(feature) : feature;\n", + " let fields = ["name", "source"];\n", + " let aliases = ["name", "source"];\n", + " let table = '<table>' +\n", + " String(\n", + " fields.map(\n", + " (v,i)=>\n", + " `<tr>\n", + " <th>${aliases[i].toLocaleString()}</th>\n", + " \n", + " <td>${handleObject(layer.feature.properties[v]).toLocaleString()}</td>\n", + " </tr>`).join(''))\n", + " +'</table>';\n", + " div.innerHTML=table;\n", + " \n", + " return div\n", + " }\n", + " ,{"className": "foliumtooltip", "sticky": true});\n", + " \n", + "</script>\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>" + ], + "text/plain": [ + "<folium.folium.Map at 0x17192b1f0>" + ] + }, + "execution_count": 55, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "geoparser = Geoparser(sources=['ign'], max_rows=10)\n", "doc = geoparser(arques)\n", @@ -1262,9 +4097,141 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 56, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<div>\n", + "<style scoped>\n", + " .dataframe tbody tr th:only-of-type {\n", + " vertical-align: middle;\n", + " }\n", + "\n", + " .dataframe tbody tr th {\n", + " vertical-align: top;\n", + " }\n", + "\n", + " .dataframe thead th {\n", + " text-align: right;\n", + " }\n", + "</style>\n", + "<table border=\"1\" class=\"dataframe\">\n", + " <thead>\n", + " <tr style=\"text-align: right;\">\n", + " <th></th>\n", + " <th>name</th>\n", + " <th>text</th>\n", + " <th>geometry</th>\n", + " <th>#_places</th>\n", + " <th>#_person</th>\n", + " <th>#_event</th>\n", + " <th>#_date</th>\n", + " <th>#_misc</th>\n", + " <th>#_locations</th>\n", + " </tr>\n", + " </thead>\n", + " <tbody>\n", + " <tr>\n", + " <th>0</th>\n", + " <td>Chalets de la Fullie</td>\n", + " <td>\\n\\nBoucle des chalets de la Fullie au départ ...</td>\n", + " <td>(LINESTRING (6.11174 45.616041, 6.11174 45.616...</td>\n", + " <td>17</td>\n", + " <td>0</td>\n", + " <td>0</td>\n", + " <td>0</td>\n", + " <td>0</td>\n", + " <td>17</td>\n", + " </tr>\n", + " <tr>\n", + " <th>1</th>\n", + " <td>Traversée cabane de Pravouta à la Plagne</td>\n", + " <td>\\n\\nPartir de la cabane de Pravouta juste de l...</td>\n", + " <td>(LINESTRING (5.832543 45.315222, 5.832444 45.3...</td>\n", + " <td>23</td>\n", + " <td>2</td>\n", + " <td>0</td>\n", + " <td>0</td>\n", + " <td>0</td>\n", + " <td>23</td>\n", + " </tr>\n", + " <tr>\n", + " <th>2</th>\n", + " <td>Refuge Entre Le Lac - Refuge de la Leisse</td>\n", + " <td>\\n\\nDépart du refuge d'Entre le Lac près du la...</td>\n", + " <td>(LINESTRING (6.839184 45.480323, 6.83987 45.47...</td>\n", + " <td>22</td>\n", + " <td>0</td>\n", + " <td>0</td>\n", + " <td>0</td>\n", + " <td>0</td>\n", + " <td>22</td>\n", + " </tr>\n", + " <tr>\n", + " <th>3</th>\n", + " <td>Le lac du Retour</td>\n", + " <td>\\n\\nDu parking de Pierre Giret, suivre la rout...</td>\n", + " <td>(LINESTRING (6.917631 45.619278, 6.917527 45.6...</td>\n", + " <td>6</td>\n", + " <td>1</td>\n", + " <td>0</td>\n", + " <td>0</td>\n", + " <td>0</td>\n", + " <td>6</td>\n", + " </tr>\n", + " <tr>\n", + " <th>4</th>\n", + " <td>Traversée Alpette - Dent de Crolles</td>\n", + " <td>\\n</td>\n", + " <td>(LINESTRING (5.907402 45.440585, 5.907439 45.4...</td>\n", + " <td>0</td>\n", + " <td>0</td>\n", + " <td>0</td>\n", + " <td>0</td>\n", + " <td>0</td>\n", + " <td>0</td>\n", + " </tr>\n", + " </tbody>\n", + "</table>\n", + "</div>" + ], + "text/plain": [ + " name \\\n", + "0 Chalets de la Fullie \n", + "1 Traversée cabane de Pravouta à la Plagne \n", + "2 Refuge Entre Le Lac - Refuge de la Leisse \n", + "3 Le lac du Retour \n", + "4 Traversée Alpette - Dent de Crolles \n", + "\n", + " text \\\n", + "0 \\n\\nBoucle des chalets de la Fullie au départ ... \n", + "1 \\n\\nPartir de la cabane de Pravouta juste de l... \n", + "2 \\n\\nDépart du refuge d'Entre le Lac près du la... \n", + "3 \\n\\nDu parking de Pierre Giret, suivre la rout... \n", + "4 \\n \n", + "\n", + " geometry #_places #_person \\\n", + "0 (LINESTRING (6.11174 45.616041, 6.11174 45.616... 17 0 \n", + "1 (LINESTRING (5.832543 45.315222, 5.832444 45.3... 23 2 \n", + "2 (LINESTRING (6.839184 45.480323, 6.83987 45.47... 22 0 \n", + "3 (LINESTRING (6.917631 45.619278, 6.917527 45.6... 6 1 \n", + "4 (LINESTRING (5.907402 45.440585, 5.907439 45.4... 0 0 \n", + "\n", + " #_event #_date #_misc #_locations \n", + "0 0 0 0 17 \n", + "1 0 0 0 23 \n", + "2 0 0 0 22 \n", + "3 0 0 0 6 \n", + "4 0 0 0 0 " + ] + }, + "execution_count": 56, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "dataset_choucas = load_choucas_perdido()\n", "data_choucas = dataset_choucas['data']\n", @@ -1274,9 +4241,20 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 57, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "30" + ] + }, + "execution_count": 57, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "len(data_choucas)" ] @@ -1290,7 +4268,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 58, "metadata": {}, "outputs": [], "source": [ @@ -1300,27 +4278,341 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 59, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "\"\\n\\nDépart du refuge d'Entre le Lac près du lac de la Plagne.\\nDu refuge Entre le Lac, un sentier remonte les pentes herbeuses et permet de rejoindre le GR5 un peu avant le chalet de la Grassaz (chalet du berger 2335m). Toujours en direction du sud, on remonte le vallon en longeant le ruisseau. On parvient ainsi à l'extrémité ouest du lac de Grattaleu; un peu plus haut, on atteint le refuge du col du Palet (2550m). On admire la beauté de la vallée et le sommet de Bellecote recouvert de glaciers. Le GR descend vers l'Est; le sentier serpente entre des entonnoirs créés dans le gypse par dissolution. Le GR passe sous un 1er télésiège, celui de Grattaleu, et près de l'arrivée d'un second, le Tichot. Au chalet de Lognan (croix) prendre à droite un sentier qui descend à Val Claret (2107m) (station de ski). Poursuivre jusqu'au chalet de la Leisse. Le GR55 s'élève vers le vallon du paquis. On passe en contrebas du chalet du Prariond; un peu plus loin on arrive à la bifurcation du col de Fresse (2531m). Laisser à gauche le sentier montant au col de Fresse (2576m), le GR55 continue sud sud ouest dans un décor sauvage entre le massif de la Grande motte et la pointe du Grand Pré; il grimpe parmi des rochers: les balises peuvent être des cairns; bien être attentif pour bien les suivre jusqu'au col de la Leisse (2758 m). Le GR55 descend dans une zone d'éboulis, bien suivre les cairns, par une piste peu visible. Ensuite, il longe le lac des Nettes dans un univers très minéral sur sa rive et pour en atteindre l'extrémité sud. On retrouve dans les alpages le sentier bien tracé qui parcourt le plan des Nettes sur la rive droite du torrent. Peu après un petit barrage qui est en cours de destruction, on arrive au refuge de la Leisse (2487m).\\n\\n\\n\\n\"" + ] + }, + "execution_count": 59, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "doc.text" ] }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 60, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">Départ du refuge d' Entre le Lac près du lac de la \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Plagne\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " . Du refuge Entre le Lac , un sentier remonte les pentes herbeuses et permet de rejoindre le GR5 un peu avant le chalet de la \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Grassaz\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " ( chalet du \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " berger\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " 2335m ) . Toujours en direction du sud , on remonte le vallon en longeant le ruisseau . On parvient ainsi à l' extrémité ouest du lac de \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Grattaleu\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " ; un peu plus haut , on atteint le refuge du \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " col\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " du \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Palet\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " ( 2550m ) . On admire la beauté de la vallée et le sommet de \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Bellecote\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " recouvert de glaciers . Le \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " GR\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " descend vers l' Est ; le sentier serpente entre des entonnoirs créés dans le gypse par dissolution . Le \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " GR\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " passe sous un 1er télésiège , celui de \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Grattaleu\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " , et près de l' arrivée d' un second , le \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Tichot\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " . Au chalet de \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Lognan\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " ( croix ) prendre à droite un sentier qui descend à Val \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Claret\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " ( 2107m ) ( station de ski ) . Poursuivre jusqu' au chalet de la \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Leisse\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " . Le \n", + "<mark class=\"entity\" style=\"background: #ddd; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " GR55\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">MISC</span>\n", + "</mark>\n", + " s' élève vers le vallon du \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " paquis\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " . On passe en contrebas du chalet du \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Prariond\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " ; un peu plus loin on arrive à la bifurcation du col de \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Fresse\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " ( 2531m ) . Laisser à gauche le sentier montant au col de \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Fresse\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " ( 2576m ) , le \n", + "<mark class=\"entity\" style=\"background: #ddd; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " GR55\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">MISC</span>\n", + "</mark>\n", + " continue sud sud ouest dans un décor sauvage entre le massif de la \n", + "<mark class=\"entity\" style=\"background: #ddd; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Grande\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">MISC</span>\n", + "</mark>\n", + " motte et la pointe du Grand Pré ; il grimpe parmi des rochers : les balises peuvent être des cairns ; bien être attentif pour bien les suivre jusqu' au col de la \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Leisse\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " ( 2758 m ) . Le \n", + "<mark class=\"entity\" style=\"background: #ddd; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " GR55\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">MISC</span>\n", + "</mark>\n", + " descend dans une zone d' éboulis , bien suivre les cairns , par une piste peu visible . Ensuite , il longe le lac des \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Nettes\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " dans un univers très minéral sur sa rive et pour en atteindre l' extrémité sud . On retrouve dans les alpages le sentier bien tracé qui parcourt le plan des \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Nettes\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " sur la rive droite du torrent . Peu après un petit barrage qui est en cours de destruction , on arrive au refuge de la \n", + "<mark class=\"entity\" style=\"background: #ff9561; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n", + " Leisse\n", + " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">LOC</span>\n", + "</mark>\n", + " ( 2487m ) . </div></span>" + ], + "text/plain": [ + "<IPython.core.display.HTML object>" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "displacy.render(doc.to_spacy_doc(), style=\"ent\", jupyter=True) " ] }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 61, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><span style=\"color:#565656\">Make this Notebook Trusted to load map: File -> Trust Notebook</span><iframe srcdoc=\"<!DOCTYPE html>\n", + "<head> \n", + " <meta http-equiv="content-type" content="text/html; charset=UTF-8" />\n", + " \n", + " <script>\n", + " L_NO_TOUCH = false;\n", + " L_DISABLE_3D = false;\n", + " </script>\n", + " \n", + " <style>html, body {width: 100%;height: 100%;margin: 0;padding: 0;}</style>\n", + " <style>#map {position:absolute;top:0;bottom:0;right:0;left:0;}</style>\n", + " <script src="https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.js"></script>\n", + " <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>\n", + " <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>\n", + " <script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>\n", + " <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css"/>\n", + " <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css"/>\n", + " <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css"/>\n", + " \n", + " <meta name="viewport" content="width=device-width,\n", + " initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n", + " <style>\n", + " #map_5ea0ecf64e99d6109ed4d6738e1c40f8 {\n", + " position: relative;\n", + " width: 100.0%;\n", + " height: 100.0%;\n", + " left: 0.0%;\n", + " top: 0.0%;\n", + " }\n", + " </style>\n", + " \n", + " \n", + " <style>\n", + " .foliumtooltip {\n", + " \n", + " }\n", + " .foliumtooltip table{\n", + " margin: auto;\n", + " }\n", + " .foliumtooltip tr{\n", + " text-align: left;\n", + " }\n", + " .foliumtooltip th{\n", + " padding: 2px; padding-right: 8px;\n", + " }\n", + " </style>\n", + " \n", + "</head>\n", + "<body> \n", + " \n", + " <div class="folium-map" id="map_5ea0ecf64e99d6109ed4d6738e1c40f8" ></div>\n", + " \n", + "</body>\n", + "<script> \n", + " \n", + " var map_5ea0ecf64e99d6109ed4d6738e1c40f8 = L.map(\n", + " "map_5ea0ecf64e99d6109ed4d6738e1c40f8",\n", + " {\n", + " center: [0, 0],\n", + " crs: L.CRS.EPSG3857,\n", + " zoom: 1,\n", + " zoomControl: true,\n", + " preferCanvas: false,\n", + " }\n", + " );\n", + "\n", + " \n", + "\n", + " \n", + " \n", + " var tile_layer_c75818c72e8c204da61857fb4f3bb4f3 = L.tileLayer(\n", + " "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",\n", + " {"attribution": "Data by \\u0026copy; \\u003ca href=\\"http://openstreetmap.org\\"\\u003eOpenStreetMap\\u003c/a\\u003e, under \\u003ca href=\\"http://www.openstreetmap.org/copyright\\"\\u003eODbL\\u003c/a\\u003e.", "detectRetina": false, "maxNativeZoom": 18, "maxZoom": 18, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false}\n", + " ).addTo(map_5ea0ecf64e99d6109ed4d6738e1c40f8);\n", + " \n", + " \n", + "\n", + " function geo_json_66881a4b6003bd449acecd7be8469df9_onEachFeature(feature, layer) {\n", + " layer.on({\n", + " });\n", + " };\n", + " var geo_json_66881a4b6003bd449acecd7be8469df9 = L.geoJson(null, {\n", + " onEachFeature: geo_json_66881a4b6003bd449acecd7be8469df9_onEachFeature,\n", + " \n", + " });\n", + "\n", + " function geo_json_66881a4b6003bd449acecd7be8469df9_add (data) {\n", + " geo_json_66881a4b6003bd449acecd7be8469df9\n", + " .addData(data)\n", + " .addTo(map_5ea0ecf64e99d6109ed4d6738e1c40f8);\n", + " }\n", + " geo_json_66881a4b6003bd449acecd7be8469df9_add({"bbox": [6.839184, 45.396851, 6.92214, 45.480323], "features": [{"bbox": [6.839184, 45.396851, 6.92214, 45.480323], "geometry": {"coordinates": [[[6.839184, 45.480323], [6.83987, 45.479299], [6.841973, 45.478562], [6.843969, 45.47857], [6.845235, 45.479931], [6.847187, 45.479675], [6.847766, 45.480112], [6.848368, 45.479932], [6.849569, 45.480172], [6.850213, 45.479029], [6.850685, 45.477254], [6.8509, 45.476306], [6.851114, 45.474425], [6.851758, 45.472889], [6.853217, 45.471626], [6.855106, 45.46982], [6.855534, 45.468766], [6.855191, 45.468014], [6.85605, 45.46684], [6.856092, 45.464914], [6.856049, 45.463891], [6.855663, 45.462356], [6.856093, 45.461679], [6.856822, 45.46137], [6.857122, 45.460038], [6.857166, 45.458864], [6.857724, 45.458021], [6.858754, 45.457765], [6.859698, 45.458503], [6.860513, 45.458097], [6.861564, 45.458676], [6.861575, 45.457732], [6.860641, 45.456396], [6.864246, 45.456245], [6.865748, 45.455944], [6.867508, 45.455763], [6.869139, 45.455884], [6.870942, 45.456034], [6.875319, 45.454649], [6.879224, 45.455432], [6.881391, 45.454996], [6.883816, 45.455463], [6.886091, 45.455613], [6.887936, 45.456004], [6.890725, 45.457841], [6.890789, 45.45608], [6.891379, 45.454687], [6.892742, 45.454379], [6.894287, 45.453084], [6.896261, 45.45191], [6.896733, 45.452663], [6.898192, 45.452602], [6.899759, 45.453009], [6.90184, 45.452392], [6.902398, 45.451308], [6.903771, 45.450827], [6.905102, 45.450525], [6.906303, 45.451308], [6.909179, 45.449742], [6.911582, 45.448568], [6.913986, 45.447755], [6.916839, 45.44619], [6.917944, 45.444971], [6.920036, 45.444083], [6.92214, 45.441493], [6.921732, 45.440138], [6.91921, 45.437713], [6.916174, 45.435741], [6.915831, 45.433859], [6.915701, 45.432067], [6.914092, 45.430877], [6.912398, 45.429567], [6.912054, 45.428845], [6.910767, 45.428423], [6.910209, 45.4277], [6.910423, 45.427038], [6.908664, 45.425321], [6.906861, 45.423603], [6.905509, 45.42261], [6.903985, 45.421586], [6.904544, 45.420486], [6.904587, 45.418784], [6.903986, 45.41779], [6.9039, 45.416254], [6.904393, 45.414838], [6.9042, 45.413301], [6.902741, 45.411855], [6.90081, 45.411524], [6.900123, 45.410636], [6.90111, 45.409476], [6.901003, 45.408707], [6.900349, 45.408564], [6.900064, 45.409095], [6.899343, 45.408773], [6.89742, 45.408511], [6.893514, 45.404624], [6.890639, 45.403811], [6.889116, 45.403374], [6.887592, 45.402576], [6.886176, 45.401822], [6.886262, 45.400858], [6.886444, 45.400128], [6.887142, 45.4], [6.88652, 45.399201], [6.885339, 45.398297], [6.885704, 45.397966], [6.88403, 45.397318], [6.88227, 45.396851]]], "type": "MultiLineString"}, "id": "0", "properties": {}, "type": "Feature"}], "type": "FeatureCollection"});\n", + "\n", + " \n", + " \n", + " map_5ea0ecf64e99d6109ed4d6738e1c40f8.fitBounds(\n", + " [[45.412971, 6.837532], [45.462018, 6.963285]],\n", + " {}\n", + " );\n", + " \n", + " \n", + "\n", + " function geo_json_9f1e2176c6103b08b7b6a8e8c2cecd18_onEachFeature(feature, layer) {\n", + " layer.on({\n", + " });\n", + " };\n", + " var geo_json_9f1e2176c6103b08b7b6a8e8c2cecd18 = L.geoJson(null, {\n", + " onEachFeature: geo_json_9f1e2176c6103b08b7b6a8e8c2cecd18_onEachFeature,\n", + " \n", + " });\n", + "\n", + " function geo_json_9f1e2176c6103b08b7b6a8e8c2cecd18_add (data) {\n", + " geo_json_9f1e2176c6103b08b7b6a8e8c2cecd18\n", + " .addData(data)\n", + " .addTo(map_5ea0ecf64e99d6109ed4d6738e1c40f8);\n", + " }\n", + " geo_json_9f1e2176c6103b08b7b6a8e8c2cecd18_add({"features": [{"geometry": {"coordinates": [6.837532, 45.456069], "type": "Point"}, "properties": {"cluster": 0, "country": "France", "latitude": 45.456069, "longitude": 6.837532, "name": "Grassaz", "source": "nominatim", "sourceName": "Col de la Grassaz, Peisey-Nancroix, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73210, France", "xmlID": "en.7"}, "type": "Feature"}, {"geometry": {"coordinates": [6.858926, 45.461481], "type": "Point"}, "properties": {"cluster": 0, "country": "France", "latitude": 45.461481, "longitude": 6.858926, "name": "Grattaleu", "source": "nominatim", "sourceName": "Lac du Grattaleu, Peisey-Nancroix, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73210, France", "xmlID": "en.15"}, "type": "Feature"}, {"geometry": {"coordinates": [6.863067, 45.451642], "type": "Point"}, "properties": {"cluster": 0, "country": "France", "latitude": 45.451642, "longitude": 6.863067, "name": "Palet", "source": "nominatim", "sourceName": "Signal du Palet, Champagny-en-Vanoise, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73350, France", "xmlID": "en.22"}, "type": "Feature"}, {"geometry": {"coordinates": [6.963285, 45.462018], "type": "Point"}, "properties": {"cluster": 0, "country": "France", "latitude": 45.462018, "longitude": 6.963285, "name": "Bellecote", "source": "nominatim", "sourceName": "Bellecote, Sentier de la Vall\\u00e9e Perdue, Le Cr\\u00eat, La Daille, Val-d\\u0027Is\\u00e8re, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73150, France", "xmlID": "en.26"}, "type": "Feature"}, {"geometry": {"coordinates": [6.858926, 45.461481], "type": "Point"}, "properties": {"cluster": 0, "country": "France", "latitude": 45.461481, "longitude": 6.858926, "name": "Grattaleu", "source": "nominatim", "sourceName": "Lac du Grattaleu, Peisey-Nancroix, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73210, France", "xmlID": "en.32"}, "type": "Feature"}, {"geometry": {"coordinates": [6.896874, 45.454039], "type": "Point"}, "properties": {"cluster": 0, "country": "France", "latitude": 45.454039, "longitude": 6.896874, "name": "Tichot", "source": "nominatim", "sourceName": "Tichot, Tarte \\u00e0 Lognan, Val-Claret, Tignes, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73320, France", "xmlID": "en.34"}, "type": "Feature"}, {"geometry": {"coordinates": [6.898275, 45.419228], "type": "Point"}, "properties": {"cluster": 0, "country": "France", "latitude": 45.419228, "longitude": 6.898275, "name": "Leisse", "source": "nominatim", "sourceName": "Leisse, Chemin de Borsat, Val-d\\u0027Is\\u00e8re, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73150, France", "xmlID": "en.46"}, "type": "Feature"}, {"geometry": {"coordinates": [6.914334, 45.458216], "type": "Point"}, "properties": {"cluster": 0, "country": "France", "latitude": 45.458216, "longitude": 6.914334, "name": "paquis", "source": "nominatim", "sourceName": "Paquis, GunPowder, Tignes, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73320, France", "xmlID": "en.52"}, "type": "Feature"}, {"geometry": {"coordinates": [6.92583, 45.442088], "type": "Point"}, "properties": {"cluster": 0, "country": "France", "latitude": 45.442088, "longitude": 6.92583, "name": "Fresse", "source": "nominatim", "sourceName": "Fresse, Piste du Col de Fresse, Val-d\\u0027Is\\u00e8re, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73150, France", "xmlID": "en.62"}, "type": "Feature"}, {"geometry": {"coordinates": [6.92583, 45.442088], "type": "Point"}, "properties": {"cluster": 0, "country": "France", "latitude": 45.442088, "longitude": 6.92583, "name": "Fresse", "source": "nominatim", "sourceName": "Fresse, Piste du Col de Fresse, Val-d\\u0027Is\\u00e8re, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73150, France", "xmlID": "en.66"}, "type": "Feature"}, {"geometry": {"coordinates": [6.898275, 45.419228], "type": "Point"}, "properties": {"cluster": 0, "country": "France", "latitude": 45.419228, "longitude": 6.898275, "name": "Leisse", "source": "nominatim", "sourceName": "Leisse, Chemin de Borsat, Val-d\\u0027Is\\u00e8re, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73150, France", "xmlID": "en.76"}, "type": "Feature"}, {"geometry": {"coordinates": [6.89952, 45.412971], "type": "Point"}, "properties": {"cluster": 0, "country": "France", "latitude": 45.412971, "longitude": 6.89952, "name": "Nettes", "source": "nominatim", "sourceName": "Lac des Nettes, Termignon, Val-Cenis, Saint-Jean-de-Maurienne, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73500, France", "xmlID": "en.82"}, "type": "Feature"}, {"geometry": {"coordinates": [6.89952, 45.412971], "type": "Point"}, "properties": {"cluster": 0, "country": "France", "latitude": 45.412971, "longitude": 6.89952, "name": "Nettes", "source": "nominatim", "sourceName": "Lac des Nettes, Termignon, Val-Cenis, Saint-Jean-de-Maurienne, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73500, France", "xmlID": "en.86"}, "type": "Feature"}, {"geometry": {"coordinates": [6.898275, 45.419228], "type": "Point"}, "properties": {"cluster": 0, "country": "France", "latitude": 45.419228, "longitude": 6.898275, "name": "Leisse", "source": "nominatim", "sourceName": "Leisse, Chemin de Borsat, Val-d\\u0027Is\\u00e8re, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73150, France", "xmlID": "en.90"}, "type": "Feature"}], "type": "FeatureCollection"});\n", + "\n", + " \n", + " \n", + " geo_json_9f1e2176c6103b08b7b6a8e8c2cecd18.bindTooltip(\n", + " function(layer){\n", + " let div = L.DomUtil.create('div');\n", + " \n", + " let handleObject = feature=>typeof(feature)=='object' ? JSON.stringify(feature) : feature;\n", + " let fields = ["name", "source"];\n", + " let aliases = ["name", "source"];\n", + " let table = '<table>' +\n", + " String(\n", + " fields.map(\n", + " (v,i)=>\n", + " `<tr>\n", + " <th>${aliases[i].toLocaleString()}</th>\n", + " \n", + " <td>${handleObject(layer.feature.properties[v]).toLocaleString()}</td>\n", + " </tr>`).join(''))\n", + " +'</table>';\n", + " div.innerHTML=table;\n", + " \n", + " return div\n", + " }\n", + " ,{"className": "foliumtooltip", "sticky": true});\n", + " \n", + "</script>\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>" + ], + "text/plain": [ + "<folium.folium.Map at 0x16c67a700>" + ] + }, + "execution_count": 61, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "doc.get_folium_map()" ] @@ -1341,7 +4633,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 62, "metadata": {}, "outputs": [], "source": [ @@ -1351,9 +4643,150 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 63, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><span style=\"color:#565656\">Make this Notebook Trusted to load map: File -> Trust Notebook</span><iframe srcdoc=\"<!DOCTYPE html>\n", + "<head> \n", + " <meta http-equiv="content-type" content="text/html; charset=UTF-8" />\n", + " \n", + " <script>\n", + " L_NO_TOUCH = false;\n", + " L_DISABLE_3D = false;\n", + " </script>\n", + " \n", + " <style>html, body {width: 100%;height: 100%;margin: 0;padding: 0;}</style>\n", + " <style>#map {position:absolute;top:0;bottom:0;right:0;left:0;}</style>\n", + " <script src="https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.js"></script>\n", + " <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>\n", + " <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>\n", + " <script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>\n", + " <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css"/>\n", + " <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css"/>\n", + " <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css"/>\n", + " \n", + " <meta name="viewport" content="width=device-width,\n", + " initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n", + " <style>\n", + " #map_21a97acea54abfbe91e9c9994eed4079 {\n", + " position: relative;\n", + " width: 100.0%;\n", + " height: 100.0%;\n", + " left: 0.0%;\n", + " top: 0.0%;\n", + " }\n", + " </style>\n", + " \n", + " \n", + " <style>\n", + " .foliumtooltip {\n", + " \n", + " }\n", + " .foliumtooltip table{\n", + " margin: auto;\n", + " }\n", + " .foliumtooltip tr{\n", + " text-align: left;\n", + " }\n", + " .foliumtooltip th{\n", + " padding: 2px; padding-right: 8px;\n", + " }\n", + " </style>\n", + " \n", + "</head>\n", + "<body> \n", + " \n", + " <div class="folium-map" id="map_21a97acea54abfbe91e9c9994eed4079" ></div>\n", + " \n", + "</body>\n", + "<script> \n", + " \n", + " var map_21a97acea54abfbe91e9c9994eed4079 = L.map(\n", + " "map_21a97acea54abfbe91e9c9994eed4079",\n", + " {\n", + " center: [0, 0],\n", + " crs: L.CRS.EPSG3857,\n", + " zoom: 1,\n", + " zoomControl: true,\n", + " preferCanvas: false,\n", + " }\n", + " );\n", + "\n", + " \n", + "\n", + " \n", + " \n", + " var tile_layer_9b8a24d219a2c034ed07935c40ed8b0b = L.tileLayer(\n", + " "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",\n", + " {"attribution": "Data by \\u0026copy; \\u003ca href=\\"http://openstreetmap.org\\"\\u003eOpenStreetMap\\u003c/a\\u003e, under \\u003ca href=\\"http://www.openstreetmap.org/copyright\\"\\u003eODbL\\u003c/a\\u003e.", "detectRetina": false, "maxNativeZoom": 18, "maxZoom": 18, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false}\n", + " ).addTo(map_21a97acea54abfbe91e9c9994eed4079);\n", + " \n", + " \n", + " map_21a97acea54abfbe91e9c9994eed4079.fitBounds(\n", + " [[38.674213, -91.338769], [53.582329, 21.987713]],\n", + " {}\n", + " );\n", + " \n", + " \n", + "\n", + " function geo_json_8e9b0f759a719e7d42b0ffdbe2b3d617_onEachFeature(feature, layer) {\n", + " layer.on({\n", + " });\n", + " };\n", + " var geo_json_8e9b0f759a719e7d42b0ffdbe2b3d617 = L.geoJson(null, {\n", + " onEachFeature: geo_json_8e9b0f759a719e7d42b0ffdbe2b3d617_onEachFeature,\n", + " \n", + " });\n", + "\n", + " function geo_json_8e9b0f759a719e7d42b0ffdbe2b3d617_add (data) {\n", + " geo_json_8e9b0f759a719e7d42b0ffdbe2b3d617\n", + " .addData(data)\n", + " .addTo(map_21a97acea54abfbe91e9c9994eed4079);\n", + " }\n", + " geo_json_8e9b0f759a719e7d42b0ffdbe2b3d617_add({"features": [{"geometry": {"coordinates": [1.060214, 43.157123], "type": "Point"}, "properties": {"country": "France", "id": "en.3", "name": "Plagne", "source": "nominatim", "sourceName": "Plagne, Muret, Haute-Garonne, Occitanie, France m\\u00e9tropolitaine, 31220, France", "type": "administrative"}, "type": "Feature"}, {"geometry": {"coordinates": [6.837532, 45.456069], "type": "Point"}, "properties": {"country": "France", "id": "en.7", "name": "Grassaz", "source": "nominatim", "sourceName": "Col de la Grassaz, Peisey-Nancroix, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73210, France", "type": "yes"}, "type": "Feature"}, {"geometry": {"coordinates": [-91.338769, 38.674213], "type": "Point"}, "properties": {"country": "United States", "id": "en.11", "name": "berger", "source": "nominatim", "sourceName": "Berger, Franklin County, Missouri, United States", "type": "administrative"}, "type": "Feature"}, {"geometry": {"coordinates": [6.858926, 45.461481], "type": "Point"}, "properties": {"country": "France", "id": "en.15", "name": "Grattaleu", "source": "nominatim", "sourceName": "Lac du Grattaleu, Peisey-Nancroix, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73210, France", "type": "water"}, "type": "Feature"}, {"geometry": {"coordinates": [6.959974, 50.938361], "type": "Point"}, "properties": {"country": "Deutschland", "id": "en.20", "name": "col", "source": "nominatim", "sourceName": "K\\u00f6ln, Nordrhein-Westfalen, Deutschland", "type": "administrative"}, "type": "Feature"}, {"geometry": {"coordinates": [-1.244805, 48.200191], "type": "Point"}, "properties": {"country": "France", "id": "en.22", "name": "Palet", "source": "nominatim", "sourceName": "Palet, Taillis, Foug\\u00e8res-Vitr\\u00e9, Ille-et-Vilaine, Bretagne, France m\\u00e9tropolitaine, 35500, France", "type": "hamlet"}, "type": "Feature"}, {"geometry": {"coordinates": [6.963285, 45.462018], "type": "Point"}, "properties": {"country": "France", "id": "en.26", "name": "Bellecote", "source": "nominatim", "sourceName": "Bellecote, Sentier de la Vall\\u00e9e Perdue, Le Cr\\u00eat, La Daille, Val-d\\u0027Is\\u00e8re, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73150, France", "type": "yes"}, "type": "Feature"}, {"geometry": {"coordinates": [21.987713, 38.995368], "type": "Point"}, "properties": {"country": "\\u0395\\u03bb\\u03bb\\u03ac\\u03c2", "id": "en.28", "name": "GR", "source": "nominatim", "sourceName": "\\u0395\\u03bb\\u03bb\\u03ac\\u03c2", "type": "administrative"}, "type": "Feature"}, {"geometry": {"coordinates": [21.987713, 38.995368], "type": "Point"}, "properties": {"country": "\\u0395\\u03bb\\u03bb\\u03ac\\u03c2", "id": "en.30", "name": "GR", "source": "nominatim", "sourceName": "\\u0395\\u03bb\\u03bb\\u03ac\\u03c2", "type": "administrative"}, "type": "Feature"}, {"geometry": {"coordinates": [6.858926, 45.461481], "type": "Point"}, "properties": {"country": "France", "id": "en.32", "name": "Grattaleu", "source": "nominatim", "sourceName": "Lac du Grattaleu, Peisey-Nancroix, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73210, France", "type": "water"}, "type": "Feature"}, {"geometry": {"coordinates": [6.896874, 45.454039], "type": "Point"}, "properties": {"country": "France", "id": "en.34", "name": "Tichot", "source": "nominatim", "sourceName": "Tichot, Tarte \\u00e0 Lognan, Val-Claret, Tignes, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73320, France", "type": "station"}, "type": "Feature"}, {"geometry": {"coordinates": [6.926505, 45.978552], "type": "Point"}, "properties": {"country": "France", "id": "en.38", "name": "Lognan", "source": "nominatim", "sourceName": "Lognan, Chemin de la Glaci\\u00e8re, Les Chosalets, Argenti\\u00e8re, Chamonix-Mont-Blanc, Bonneville, Haute-Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 74400, France", "type": "station"}, "type": "Feature"}, {"geometry": {"coordinates": [3.905872, 43.862148], "type": "Point"}, "properties": {"country": "France", "id": "en.42", "name": "Claret", "source": "nominatim", "sourceName": "Claret, Lod\\u00e8ve, H\\u00e9rault, Occitanie, France m\\u00e9tropolitaine, 34270, France", "type": "administrative"}, "type": "Feature"}, {"geometry": {"coordinates": [8.303371, 51.188893], "type": "Point"}, "properties": {"country": "Deutschland", "id": "en.46", "name": "Leisse", "source": "nominatim", "sourceName": "Lei\\u00dfe, Bad Fredeburg, Schmallenberg, Hochsauerlandkreis, Nordrhein-Westfalen, 57392, Deutschland", "type": "stream"}, "type": "Feature"}, {"geometry": {"coordinates": [6.147314, 46.219521], "type": "Point"}, "properties": {"country": "Schweiz/Suisse/Svizzera/Svizra", "id": "en.52", "name": "paquis", "source": "nominatim", "sourceName": "P\\u00e2quis, Gen\\u00e8ve, 1202, Schweiz/Suisse/Svizzera/Svizra", "type": "administrative"}, "type": "Feature"}, {"geometry": {"coordinates": [7.072597, 45.650494], "type": "Point"}, "properties": {"country": "Italia", "id": "en.57", "name": "Prariond", "source": "nominatim", "sourceName": "Prariond, Plant\\u00e9, Valgrisenche, Valle d\\u0027Aosta / Vall\\u00e9e d\\u0027Aoste, Italia", "type": "hamlet"}, "type": "Feature"}, {"geometry": {"coordinates": [2.844478, 45.408958], "type": "Point"}, "properties": {"country": "France", "id": "en.62", "name": "Fresse", "source": "nominatim", "sourceName": "Fresse, \\u00c9gliseneuve-d\\u0027Entraigues, Issoire, Puy-de-D\\u00f4me, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 63850, France", "type": "isolated_dwelling"}, "type": "Feature"}, {"geometry": {"coordinates": [2.844478, 45.408958], "type": "Point"}, "properties": {"country": "France", "id": "en.66", "name": "Fresse", "source": "nominatim", "sourceName": "Fresse, \\u00c9gliseneuve-d\\u0027Entraigues, Issoire, Puy-de-D\\u00f4me, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 63850, France", "type": "isolated_dwelling"}, "type": "Feature"}, {"geometry": {"coordinates": [10.38635, 53.582329], "type": "Point"}, "properties": {"country": "Deutschland", "id": "en.72", "name": "Grande", "source": "nominatim", "sourceName": "Grande, Trittau, Stormarn, Schleswig-Holstein, Deutschland", "type": "administrative"}, "type": "Feature"}, {"geometry": {"coordinates": [8.303371, 51.188893], "type": "Point"}, "properties": {"country": "Deutschland", "id": "en.76", "name": "Leisse", "source": "nominatim", "sourceName": "Lei\\u00dfe, Bad Fredeburg, Schmallenberg, Hochsauerlandkreis, Nordrhein-Westfalen, 57392, Deutschland", "type": "stream"}, "type": "Feature"}, {"geometry": {"coordinates": [6.89952, 45.412971], "type": "Point"}, "properties": {"country": "France", "id": "en.82", "name": "Nettes", "source": "nominatim", "sourceName": "Lac des Nettes, Termignon, Val-Cenis, Saint-Jean-de-Maurienne, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73500, France", "type": "water"}, "type": "Feature"}, {"geometry": {"coordinates": [6.89952, 45.412971], "type": "Point"}, "properties": {"country": "France", "id": "en.86", "name": "Nettes", "source": "nominatim", "sourceName": "Lac des Nettes, Termignon, Val-Cenis, Saint-Jean-de-Maurienne, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73500, France", "type": "water"}, "type": "Feature"}, {"geometry": {"coordinates": [8.303371, 51.188893], "type": "Point"}, "properties": {"country": "Deutschland", "id": "en.90", "name": "Leisse", "source": "nominatim", "sourceName": "Lei\\u00dfe, Bad Fredeburg, Schmallenberg, Hochsauerlandkreis, Nordrhein-Westfalen, 57392, Deutschland", "type": "stream"}, "type": "Feature"}], "type": "FeatureCollection"});\n", + "\n", + " \n", + " \n", + " geo_json_8e9b0f759a719e7d42b0ffdbe2b3d617.bindTooltip(\n", + " function(layer){\n", + " let div = L.DomUtil.create('div');\n", + " \n", + " let handleObject = feature=>typeof(feature)=='object' ? JSON.stringify(feature) : feature;\n", + " let fields = ["name", "source"];\n", + " let aliases = ["name", "source"];\n", + " let table = '<table>' +\n", + " String(\n", + " fields.map(\n", + " (v,i)=>\n", + " `<tr>\n", + " <th>${aliases[i].toLocaleString()}</th>\n", + " \n", + " <td>${handleObject(layer.feature.properties[v]).toLocaleString()}</td>\n", + " </tr>`).join(''))\n", + " +'</table>';\n", + " div.innerHTML=table;\n", + " \n", + " return div\n", + " }\n", + " ,{"className": "foliumtooltip", "sticky": true});\n", + " \n", + "</script>\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>" + ], + "text/plain": [ + "<folium.folium.Map at 0x16a7ea2e0>" + ] + }, + "execution_count": 63, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "doc_geoparsed.get_folium_map()" ] @@ -1371,9 +4804,17 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 64, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['Bellecote', 'Palet', 'Prariond', 'Fresse', 'col', 'berger', 'GR', 'Lognan', 'Claret', 'Grande', 'Nettes', 'Tichot', 'Plagne', 'Grassaz', 'Leisse', 'paquis', 'Grattaleu']\n" + ] + } + ], "source": [ "places_list = list(set([ent.text for ent in doc_geoparsed.ne_place]))\n", "print(places_list)" @@ -1388,9 +4829,169 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 65, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><span style=\"color:#565656\">Make this Notebook Trusted to load map: File -> Trust Notebook</span><iframe srcdoc=\"<!DOCTYPE html>\n", + "<head> \n", + " <meta http-equiv="content-type" content="text/html; charset=UTF-8" />\n", + " \n", + " <script>\n", + " L_NO_TOUCH = false;\n", + " L_DISABLE_3D = false;\n", + " </script>\n", + " \n", + " <style>html, body {width: 100%;height: 100%;margin: 0;padding: 0;}</style>\n", + " <style>#map {position:absolute;top:0;bottom:0;right:0;left:0;}</style>\n", + " <script src="https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.js"></script>\n", + " <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>\n", + " <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>\n", + " <script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>\n", + " <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css"/>\n", + " <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css"/>\n", + " <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css"/>\n", + " \n", + " <meta name="viewport" content="width=device-width,\n", + " initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n", + " <style>\n", + " #map_b96edf9aaf803f839f4c51881311f7b4 {\n", + " position: relative;\n", + " width: 100.0%;\n", + " height: 100.0%;\n", + " left: 0.0%;\n", + " top: 0.0%;\n", + " }\n", + " </style>\n", + " \n", + " \n", + " <style>\n", + " .foliumtooltip {\n", + " \n", + " }\n", + " .foliumtooltip table{\n", + " margin: auto;\n", + " }\n", + " .foliumtooltip tr{\n", + " text-align: left;\n", + " }\n", + " .foliumtooltip th{\n", + " padding: 2px; padding-right: 8px;\n", + " }\n", + " </style>\n", + " \n", + "</head>\n", + "<body> \n", + " \n", + " <div class="folium-map" id="map_b96edf9aaf803f839f4c51881311f7b4" ></div>\n", + " \n", + "</body>\n", + "<script> \n", + " \n", + " var map_b96edf9aaf803f839f4c51881311f7b4 = L.map(\n", + " "map_b96edf9aaf803f839f4c51881311f7b4",\n", + " {\n", + " center: [0, 0],\n", + " crs: L.CRS.EPSG3857,\n", + " zoom: 1,\n", + " zoomControl: true,\n", + " preferCanvas: false,\n", + " }\n", + " );\n", + "\n", + " \n", + "\n", + " \n", + " \n", + " var tile_layer_2a7f6de2ebc774a30f5749babecbd755 = L.tileLayer(\n", + " "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",\n", + " {"attribution": "Data by \\u0026copy; \\u003ca href=\\"http://openstreetmap.org\\"\\u003eOpenStreetMap\\u003c/a\\u003e, under \\u003ca href=\\"http://www.openstreetmap.org/copyright\\"\\u003eODbL\\u003c/a\\u003e.", "detectRetina": false, "maxNativeZoom": 18, "maxZoom": 18, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false}\n", + " ).addTo(map_b96edf9aaf803f839f4c51881311f7b4);\n", + " \n", + " \n", + "\n", + " function geo_json_019fc6ae18b2844c4bb07e6bf659848a_onEachFeature(feature, layer) {\n", + " layer.on({\n", + " });\n", + " };\n", + " var geo_json_019fc6ae18b2844c4bb07e6bf659848a = L.geoJson(null, {\n", + " onEachFeature: geo_json_019fc6ae18b2844c4bb07e6bf659848a_onEachFeature,\n", + " \n", + " });\n", + "\n", + " function geo_json_019fc6ae18b2844c4bb07e6bf659848a_add (data) {\n", + " geo_json_019fc6ae18b2844c4bb07e6bf659848a\n", + " .addData(data)\n", + " .addTo(map_b96edf9aaf803f839f4c51881311f7b4);\n", + " }\n", + " geo_json_019fc6ae18b2844c4bb07e6bf659848a_add({"bbox": [6.839184, 45.396851, 6.92214, 45.480323], "features": [{"bbox": [6.839184, 45.396851, 6.92214, 45.480323], "geometry": {"coordinates": [[[6.839184, 45.480323], [6.83987, 45.479299], [6.841973, 45.478562], [6.843969, 45.47857], [6.845235, 45.479931], [6.847187, 45.479675], [6.847766, 45.480112], [6.848368, 45.479932], [6.849569, 45.480172], [6.850213, 45.479029], [6.850685, 45.477254], [6.8509, 45.476306], [6.851114, 45.474425], [6.851758, 45.472889], [6.853217, 45.471626], [6.855106, 45.46982], [6.855534, 45.468766], [6.855191, 45.468014], [6.85605, 45.46684], [6.856092, 45.464914], [6.856049, 45.463891], [6.855663, 45.462356], [6.856093, 45.461679], [6.856822, 45.46137], [6.857122, 45.460038], [6.857166, 45.458864], [6.857724, 45.458021], [6.858754, 45.457765], [6.859698, 45.458503], [6.860513, 45.458097], [6.861564, 45.458676], [6.861575, 45.457732], [6.860641, 45.456396], [6.864246, 45.456245], [6.865748, 45.455944], [6.867508, 45.455763], [6.869139, 45.455884], [6.870942, 45.456034], [6.875319, 45.454649], [6.879224, 45.455432], [6.881391, 45.454996], [6.883816, 45.455463], [6.886091, 45.455613], [6.887936, 45.456004], [6.890725, 45.457841], [6.890789, 45.45608], [6.891379, 45.454687], [6.892742, 45.454379], [6.894287, 45.453084], [6.896261, 45.45191], [6.896733, 45.452663], [6.898192, 45.452602], [6.899759, 45.453009], [6.90184, 45.452392], [6.902398, 45.451308], [6.903771, 45.450827], [6.905102, 45.450525], [6.906303, 45.451308], [6.909179, 45.449742], [6.911582, 45.448568], [6.913986, 45.447755], [6.916839, 45.44619], [6.917944, 45.444971], [6.920036, 45.444083], [6.92214, 45.441493], [6.921732, 45.440138], [6.91921, 45.437713], [6.916174, 45.435741], [6.915831, 45.433859], [6.915701, 45.432067], [6.914092, 45.430877], [6.912398, 45.429567], [6.912054, 45.428845], [6.910767, 45.428423], [6.910209, 45.4277], [6.910423, 45.427038], [6.908664, 45.425321], [6.906861, 45.423603], [6.905509, 45.42261], [6.903985, 45.421586], [6.904544, 45.420486], [6.904587, 45.418784], [6.903986, 45.41779], [6.9039, 45.416254], [6.904393, 45.414838], [6.9042, 45.413301], [6.902741, 45.411855], [6.90081, 45.411524], [6.900123, 45.410636], [6.90111, 45.409476], [6.901003, 45.408707], [6.900349, 45.408564], [6.900064, 45.409095], [6.899343, 45.408773], [6.89742, 45.408511], [6.893514, 45.404624], [6.890639, 45.403811], [6.889116, 45.403374], [6.887592, 45.402576], [6.886176, 45.401822], [6.886262, 45.400858], [6.886444, 45.400128], [6.887142, 45.4], [6.88652, 45.399201], [6.885339, 45.398297], [6.885704, 45.397966], [6.88403, 45.397318], [6.88227, 45.396851]]], "type": "MultiLineString"}, "id": "0", "properties": {}, "type": "Feature"}], "type": "FeatureCollection"});\n", + "\n", + " \n", + " \n", + " map_b96edf9aaf803f839f4c51881311f7b4.fitBounds(\n", + " [[43.157123, -1.244805], [50.823249, 7.211431]],\n", + " {}\n", + " );\n", + " \n", + " \n", + "\n", + " function geo_json_39ddc672cf670aaf11ef9dfebbdcaa6c_onEachFeature(feature, layer) {\n", + " layer.on({\n", + " });\n", + " };\n", + " var geo_json_39ddc672cf670aaf11ef9dfebbdcaa6c = L.geoJson(null, {\n", + " onEachFeature: geo_json_39ddc672cf670aaf11ef9dfebbdcaa6c_onEachFeature,\n", + " \n", + " });\n", + "\n", + " function geo_json_39ddc672cf670aaf11ef9dfebbdcaa6c_add (data) {\n", + " geo_json_39ddc672cf670aaf11ef9dfebbdcaa6c\n", + " .addData(data)\n", + " .addTo(map_b96edf9aaf803f839f4c51881311f7b4);\n", + " }\n", + " geo_json_39ddc672cf670aaf11ef9dfebbdcaa6c_add({"features": [{"geometry": {"coordinates": [6.963285, 45.462018], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Bellecote", "source": "nominatim", "sourceName": "Bellecote, Sentier de la Vall\\u00e9e Perdue, Le Cr\\u00eat, La Daille, Val-d\\u0027Is\\u00e8re, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73150, France", "type": "yes"}, "type": "Feature"}, {"geometry": {"coordinates": [-1.244805, 48.200191], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Palet", "source": "nominatim", "sourceName": "Palet, Taillis, Foug\\u00e8res-Vitr\\u00e9, Ille-et-Vilaine, Bretagne, France m\\u00e9tropolitaine, 35500, France", "type": "hamlet"}, "type": "Feature"}, {"geometry": {"coordinates": [6.43923, 45.445076], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Prariond", "source": "nominatim", "sourceName": "Prariond, Mottet, Les Avanchers-Valmorel, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73260, France", "type": "platter"}, "type": "Feature"}, {"geometry": {"coordinates": [2.844478, 45.408958], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Fresse", "source": "nominatim", "sourceName": "Fresse, \\u00c9gliseneuve-d\\u0027Entraigues, Issoire, Puy-de-D\\u00f4me, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 63850, France", "type": "isolated_dwelling"}, "type": "Feature"}, {"geometry": {"coordinates": [4.467755, 44.831458], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "col", "source": "nominatim", "sourceName": "Col, Saint-Pierreville, Tournon-sur-Rh\\u00f4ne, Ard\\u00e8che, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 07190, France", "type": "hamlet"}, "type": "Feature"}, {"geometry": {"coordinates": [5.060961, 46.105022], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "berger", "source": "nominatim", "sourceName": "Berger, Saint-Andr\\u00e9-le-Bouchoux, Bourg-en-Bresse, Ain, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 01240, France", "type": "hamlet"}, "type": "Feature"}, {"geometry": {"coordinates": [2.014202, 50.823249], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "GR", "source": "nominatim", "sourceName": "Grande Rue, Louches, Calais, Pas-de-Calais, Hauts-de-France, France m\\u00e9tropolitaine, 62610, France", "type": "hamlet"}, "type": "Feature"}, {"geometry": {"coordinates": [6.926505, 45.978552], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Lognan", "source": "nominatim", "sourceName": "Lognan, Chemin de la Glaci\\u00e8re, Les Chosalets, Argenti\\u00e8re, Chamonix-Mont-Blanc, Bonneville, Haute-Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 74400, France", "type": "station"}, "type": "Feature"}, {"geometry": {"coordinates": [3.905872, 43.862148], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Claret", "source": "nominatim", "sourceName": "Claret, Lod\\u00e8ve, H\\u00e9rault, Occitanie, France m\\u00e9tropolitaine, 34270, France", "type": "administrative"}, "type": "Feature"}, {"geometry": {"coordinates": [3.682996, 44.905336], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Grande", "source": "nominatim", "sourceName": "Grande, Alleyras, Le Puy-en-Velay, Haute-Loire, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 43580, France", "type": "residential"}, "type": "Feature"}, {"geometry": {"coordinates": [6.89952, 45.412971], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Nettes", "source": "nominatim", "sourceName": "Lac des Nettes, Termignon, Val-Cenis, Saint-Jean-de-Maurienne, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73500, France", "type": "water"}, "type": "Feature"}, {"geometry": {"coordinates": [6.896874, 45.454039], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Tichot", "source": "nominatim", "sourceName": "Tichot, Tarte \\u00e0 Lognan, Val-Claret, Tignes, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73320, France", "type": "station"}, "type": "Feature"}, {"geometry": {"coordinates": [1.060214, 43.157123], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Plagne", "source": "nominatim", "sourceName": "Plagne, Muret, Haute-Garonne, Occitanie, France m\\u00e9tropolitaine, 31220, France", "type": "administrative"}, "type": "Feature"}, {"geometry": {"coordinates": [6.837532, 45.456069], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Grassaz", "source": "nominatim", "sourceName": "Col de la Grassaz, Peisey-Nancroix, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73210, France", "type": "yes"}, "type": "Feature"}, {"geometry": {"coordinates": [6.898275, 45.419228], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Leisse", "source": "nominatim", "sourceName": "Leisse, Chemin de Borsat, Val-d\\u0027Is\\u00e8re, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73150, France", "type": "station"}, "type": "Feature"}, {"geometry": {"coordinates": [7.211431, 48.207614], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "paquis", "source": "nominatim", "sourceName": "Paquis, Aubure, Colmar-Ribeauvill\\u00e9, Haut-Rhin, Grand Est, France m\\u00e9tropolitaine, 68150, France", "type": "locality"}, "type": "Feature"}, {"geometry": {"coordinates": [6.858926, 45.461481], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Grattaleu", "source": "nominatim", "sourceName": "Lac du Grattaleu, Peisey-Nancroix, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73210, France", "type": "water"}, "type": "Feature"}], "type": "FeatureCollection"});\n", + "\n", + " \n", + " \n", + " geo_json_39ddc672cf670aaf11ef9dfebbdcaa6c.bindTooltip(\n", + " function(layer){\n", + " let div = L.DomUtil.create('div');\n", + " \n", + " let handleObject = feature=>typeof(feature)=='object' ? JSON.stringify(feature) : feature;\n", + " let fields = ["name", "source"];\n", + " let aliases = ["name", "source"];\n", + " let table = '<table>' +\n", + " String(\n", + " fields.map(\n", + " (v,i)=>\n", + " `<tr>\n", + " <th>${aliases[i].toLocaleString()}</th>\n", + " \n", + " <td>${handleObject(layer.feature.properties[v]).toLocaleString()}</td>\n", + " </tr>`).join(''))\n", + " +'</table>';\n", + " div.innerHTML=table;\n", + " \n", + " return div\n", + " }\n", + " ,{"className": "foliumtooltip", "sticky": true});\n", + " \n", + "</script>\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>" + ], + "text/plain": [ + "<folium.folium.Map at 0x16c6f2c10>" + ] + }, + "execution_count": 65, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "# instancier le geocoder avec le code pays\n", "geocoder = Geocoder(country_code = 'fr')\n", @@ -1411,9 +5012,169 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 66, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><span style=\"color:#565656\">Make this Notebook Trusted to load map: File -> Trust Notebook</span><iframe srcdoc=\"<!DOCTYPE html>\n", + "<head> \n", + " <meta http-equiv="content-type" content="text/html; charset=UTF-8" />\n", + " \n", + " <script>\n", + " L_NO_TOUCH = false;\n", + " L_DISABLE_3D = false;\n", + " </script>\n", + " \n", + " <style>html, body {width: 100%;height: 100%;margin: 0;padding: 0;}</style>\n", + " <style>#map {position:absolute;top:0;bottom:0;right:0;left:0;}</style>\n", + " <script src="https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.js"></script>\n", + " <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>\n", + " <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>\n", + " <script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>\n", + " <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css"/>\n", + " <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css"/>\n", + " <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css"/>\n", + " \n", + " <meta name="viewport" content="width=device-width,\n", + " initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n", + " <style>\n", + " #map_4880dc7582ec8e480f3d29533b468495 {\n", + " position: relative;\n", + " width: 100.0%;\n", + " height: 100.0%;\n", + " left: 0.0%;\n", + " top: 0.0%;\n", + " }\n", + " </style>\n", + " \n", + " \n", + " <style>\n", + " .foliumtooltip {\n", + " \n", + " }\n", + " .foliumtooltip table{\n", + " margin: auto;\n", + " }\n", + " .foliumtooltip tr{\n", + " text-align: left;\n", + " }\n", + " .foliumtooltip th{\n", + " padding: 2px; padding-right: 8px;\n", + " }\n", + " </style>\n", + " \n", + "</head>\n", + "<body> \n", + " \n", + " <div class="folium-map" id="map_4880dc7582ec8e480f3d29533b468495" ></div>\n", + " \n", + "</body>\n", + "<script> \n", + " \n", + " var map_4880dc7582ec8e480f3d29533b468495 = L.map(\n", + " "map_4880dc7582ec8e480f3d29533b468495",\n", + " {\n", + " center: [0, 0],\n", + " crs: L.CRS.EPSG3857,\n", + " zoom: 1,\n", + " zoomControl: true,\n", + " preferCanvas: false,\n", + " }\n", + " );\n", + "\n", + " \n", + "\n", + " \n", + " \n", + " var tile_layer_985e5b7367602360f6cb871ada8df532 = L.tileLayer(\n", + " "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",\n", + " {"attribution": "Data by \\u0026copy; \\u003ca href=\\"http://openstreetmap.org\\"\\u003eOpenStreetMap\\u003c/a\\u003e, under \\u003ca href=\\"http://www.openstreetmap.org/copyright\\"\\u003eODbL\\u003c/a\\u003e.", "detectRetina": false, "maxNativeZoom": 18, "maxZoom": 18, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false}\n", + " ).addTo(map_4880dc7582ec8e480f3d29533b468495);\n", + " \n", + " \n", + "\n", + " function geo_json_54adca617bfc7404cbcd709c1e3f7082_onEachFeature(feature, layer) {\n", + " layer.on({\n", + " });\n", + " };\n", + " var geo_json_54adca617bfc7404cbcd709c1e3f7082 = L.geoJson(null, {\n", + " onEachFeature: geo_json_54adca617bfc7404cbcd709c1e3f7082_onEachFeature,\n", + " \n", + " });\n", + "\n", + " function geo_json_54adca617bfc7404cbcd709c1e3f7082_add (data) {\n", + " geo_json_54adca617bfc7404cbcd709c1e3f7082\n", + " .addData(data)\n", + " .addTo(map_4880dc7582ec8e480f3d29533b468495);\n", + " }\n", + " geo_json_54adca617bfc7404cbcd709c1e3f7082_add({"bbox": [6.839184, 45.396851, 6.92214, 45.480323], "features": [{"bbox": [6.839184, 45.396851, 6.92214, 45.480323], "geometry": {"coordinates": [[[6.839184, 45.480323], [6.83987, 45.479299], [6.841973, 45.478562], [6.843969, 45.47857], [6.845235, 45.479931], [6.847187, 45.479675], [6.847766, 45.480112], [6.848368, 45.479932], [6.849569, 45.480172], [6.850213, 45.479029], [6.850685, 45.477254], [6.8509, 45.476306], [6.851114, 45.474425], [6.851758, 45.472889], [6.853217, 45.471626], [6.855106, 45.46982], [6.855534, 45.468766], [6.855191, 45.468014], [6.85605, 45.46684], [6.856092, 45.464914], [6.856049, 45.463891], [6.855663, 45.462356], [6.856093, 45.461679], [6.856822, 45.46137], [6.857122, 45.460038], [6.857166, 45.458864], [6.857724, 45.458021], [6.858754, 45.457765], [6.859698, 45.458503], [6.860513, 45.458097], [6.861564, 45.458676], [6.861575, 45.457732], [6.860641, 45.456396], [6.864246, 45.456245], [6.865748, 45.455944], [6.867508, 45.455763], [6.869139, 45.455884], [6.870942, 45.456034], [6.875319, 45.454649], [6.879224, 45.455432], [6.881391, 45.454996], [6.883816, 45.455463], [6.886091, 45.455613], [6.887936, 45.456004], [6.890725, 45.457841], [6.890789, 45.45608], [6.891379, 45.454687], [6.892742, 45.454379], [6.894287, 45.453084], [6.896261, 45.45191], [6.896733, 45.452663], [6.898192, 45.452602], [6.899759, 45.453009], [6.90184, 45.452392], [6.902398, 45.451308], [6.903771, 45.450827], [6.905102, 45.450525], [6.906303, 45.451308], [6.909179, 45.449742], [6.911582, 45.448568], [6.913986, 45.447755], [6.916839, 45.44619], [6.917944, 45.444971], [6.920036, 45.444083], [6.92214, 45.441493], [6.921732, 45.440138], [6.91921, 45.437713], [6.916174, 45.435741], [6.915831, 45.433859], [6.915701, 45.432067], [6.914092, 45.430877], [6.912398, 45.429567], [6.912054, 45.428845], [6.910767, 45.428423], [6.910209, 45.4277], [6.910423, 45.427038], [6.908664, 45.425321], [6.906861, 45.423603], [6.905509, 45.42261], [6.903985, 45.421586], [6.904544, 45.420486], [6.904587, 45.418784], [6.903986, 45.41779], [6.9039, 45.416254], [6.904393, 45.414838], [6.9042, 45.413301], [6.902741, 45.411855], [6.90081, 45.411524], [6.900123, 45.410636], [6.90111, 45.409476], [6.901003, 45.408707], [6.900349, 45.408564], [6.900064, 45.409095], [6.899343, 45.408773], [6.89742, 45.408511], [6.893514, 45.404624], [6.890639, 45.403811], [6.889116, 45.403374], [6.887592, 45.402576], [6.886176, 45.401822], [6.886262, 45.400858], [6.886444, 45.400128], [6.887142, 45.4], [6.88652, 45.399201], [6.885339, 45.398297], [6.885704, 45.397966], [6.88403, 45.397318], [6.88227, 45.396851]]], "type": "MultiLineString"}, "id": "0", "properties": {}, "type": "Feature"}], "type": "FeatureCollection"});\n", + "\n", + " \n", + " \n", + " map_4880dc7582ec8e480f3d29533b468495.fitBounds(\n", + " [[45.207191, 5.867346], [45.462018, 6.963285]],\n", + " {}\n", + " );\n", + " \n", + " \n", + "\n", + " function geo_json_79549281d3608581e7def31653427ecb_onEachFeature(feature, layer) {\n", + " layer.on({\n", + " });\n", + " };\n", + " var geo_json_79549281d3608581e7def31653427ecb = L.geoJson(null, {\n", + " onEachFeature: geo_json_79549281d3608581e7def31653427ecb_onEachFeature,\n", + " \n", + " });\n", + "\n", + " function geo_json_79549281d3608581e7def31653427ecb_add (data) {\n", + " geo_json_79549281d3608581e7def31653427ecb\n", + " .addData(data)\n", + " .addTo(map_4880dc7582ec8e480f3d29533b468495);\n", + " }\n", + " geo_json_79549281d3608581e7def31653427ecb_add({"features": [{"geometry": {"coordinates": [6.963285, 45.462018], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Bellecote", "source": "nominatim", "sourceName": "Bellecote, Sentier de la Vall\\u00e9e Perdue, Le Cr\\u00eat, La Daille, Val-d\\u0027Is\\u00e8re, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73150, France", "type": "yes"}, "type": "Feature"}, {"geometry": {"coordinates": [6.863067, 45.451642], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Palet", "source": "nominatim", "sourceName": "Signal du Palet, Champagny-en-Vanoise, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73350, France", "type": "peak"}, "type": "Feature"}, {"geometry": {"coordinates": [6.43923, 45.445076], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Prariond", "source": "nominatim", "sourceName": "Prariond, Mottet, Les Avanchers-Valmorel, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73260, France", "type": "platter"}, "type": "Feature"}, {"geometry": {"coordinates": [6.92583, 45.442088], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Fresse", "source": "nominatim", "sourceName": "Fresse, Piste du Col de Fresse, Val-d\\u0027Is\\u00e8re, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73150, France", "type": "station"}, "type": "Feature"}, {"geometry": {"coordinates": [6.60536, 45.273046], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "col", "source": "nominatim", "sourceName": "Col, Boulevard Lauzes, Slalom, Saint-Martin-de-Belleville, Les Belleville, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73440, France", "type": "station"}, "type": "Feature"}, {"geometry": {"coordinates": [5.867346, 45.308667], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "berger", "source": "nominatim", "sourceName": "Berger, Saint-Hilaire, Plateau-des-Petites-Roches, Grenoble, Is\\u00e8re, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 38660, France", "type": "footway"}, "type": "Feature"}, {"geometry": {"coordinates": [6.579058, 45.298166], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "GR", "source": "nominatim", "sourceName": "Grande Rue, Saint-Martin-de-Belleville, Les Belleville, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73440, France", "type": "quarter"}, "type": "Feature"}, {"geometry": {"coordinates": [6.395829, 45.350595], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Lognan", "source": "nominatim", "sourceName": "Cr\\u00eat Lognan, Les Belleville, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, France", "type": "peak"}, "type": "Feature"}, {"geometry": {"coordinates": [6.422623, 45.255481], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Claret", "source": "nominatim", "sourceName": "Claret, Saint-Julien-Mont-Denis, Saint-Jean-de-Maurienne, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73870, France", "type": "hamlet"}, "type": "Feature"}, {"geometry": {"coordinates": [6.89952, 45.412971], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Nettes", "source": "nominatim", "sourceName": "Lac des Nettes, Termignon, Val-Cenis, Saint-Jean-de-Maurienne, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73500, France", "type": "water"}, "type": "Feature"}, {"geometry": {"coordinates": [6.896874, 45.454039], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Tichot", "source": "nominatim", "sourceName": "Tichot, Tarte \\u00e0 Lognan, Val-Claret, Tignes, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73320, France", "type": "station"}, "type": "Feature"}, {"geometry": {"coordinates": [6.392506, 45.207191], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Plagne", "source": "nominatim", "sourceName": "Plagne, Copies, La Plagne, Albanne, Montricher-Albanne, Saint-Jean-de-Maurienne, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73870, France", "type": "platter"}, "type": "Feature"}, {"geometry": {"coordinates": [6.837532, 45.456069], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Grassaz", "source": "nominatim", "sourceName": "Col de la Grassaz, Peisey-Nancroix, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73210, France", "type": "yes"}, "type": "Feature"}, {"geometry": {"coordinates": [6.898275, 45.419228], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Leisse", "source": "nominatim", "sourceName": "Leisse, Chemin de Borsat, Val-d\\u0027Is\\u00e8re, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73150, France", "type": "station"}, "type": "Feature"}, {"geometry": {"coordinates": [6.914334, 45.458216], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "paquis", "source": "nominatim", "sourceName": "Paquis, GunPowder, Tignes, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73320, France", "type": "station"}, "type": "Feature"}, {"geometry": {"coordinates": [6.858926, 45.461481], "type": "Point"}, "properties": {"country": "France", "id": 0, "name": "Grattaleu", "source": "nominatim", "sourceName": "Lac du Grattaleu, Peisey-Nancroix, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73210, France", "type": "water"}, "type": "Feature"}], "type": "FeatureCollection"});\n", + "\n", + " \n", + " \n", + " geo_json_79549281d3608581e7def31653427ecb.bindTooltip(\n", + " function(layer){\n", + " let div = L.DomUtil.create('div');\n", + " \n", + " let handleObject = feature=>typeof(feature)=='object' ? JSON.stringify(feature) : feature;\n", + " let fields = ["name", "source"];\n", + " let aliases = ["name", "source"];\n", + " let table = '<table>' +\n", + " String(\n", + " fields.map(\n", + " (v,i)=>\n", + " `<tr>\n", + " <th>${aliases[i].toLocaleString()}</th>\n", + " \n", + " <td>${handleObject(layer.feature.properties[v]).toLocaleString()}</td>\n", + " </tr>`).join(''))\n", + " +'</table>';\n", + " div.innerHTML=table;\n", + " \n", + " return div\n", + " }\n", + " ,{"className": "foliumtooltip", "sticky": true});\n", + " \n", + "</script>\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>" + ], + "text/plain": [ + "<folium.folium.Map at 0x16acb5dc0>" + ] + }, + "execution_count": 66, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "bbox = [5.62216508714297, 45.051683489057, 7.18563279407213, 45.9384576816403] # zone d'intervention du PGHM Isère\n", "\n", @@ -1437,9 +5198,169 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 67, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><span style=\"color:#565656\">Make this Notebook Trusted to load map: File -> Trust Notebook</span><iframe srcdoc=\"<!DOCTYPE html>\n", + "<head> \n", + " <meta http-equiv="content-type" content="text/html; charset=UTF-8" />\n", + " \n", + " <script>\n", + " L_NO_TOUCH = false;\n", + " L_DISABLE_3D = false;\n", + " </script>\n", + " \n", + " <style>html, body {width: 100%;height: 100%;margin: 0;padding: 0;}</style>\n", + " <style>#map {position:absolute;top:0;bottom:0;right:0;left:0;}</style>\n", + " <script src="https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.js"></script>\n", + " <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>\n", + " <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>\n", + " <script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>\n", + " <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"/>\n", + " <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css"/>\n", + " <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css"/>\n", + " <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css"/>\n", + " \n", + " <meta name="viewport" content="width=device-width,\n", + " initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n", + " <style>\n", + " #map_16da498d11917f3f8ea4a73c52cd7bf1 {\n", + " position: relative;\n", + " width: 100.0%;\n", + " height: 100.0%;\n", + " left: 0.0%;\n", + " top: 0.0%;\n", + " }\n", + " </style>\n", + " \n", + " \n", + " <style>\n", + " .foliumtooltip {\n", + " \n", + " }\n", + " .foliumtooltip table{\n", + " margin: auto;\n", + " }\n", + " .foliumtooltip tr{\n", + " text-align: left;\n", + " }\n", + " .foliumtooltip th{\n", + " padding: 2px; padding-right: 8px;\n", + " }\n", + " </style>\n", + " \n", + "</head>\n", + "<body> \n", + " \n", + " <div class="folium-map" id="map_16da498d11917f3f8ea4a73c52cd7bf1" ></div>\n", + " \n", + "</body>\n", + "<script> \n", + " \n", + " var map_16da498d11917f3f8ea4a73c52cd7bf1 = L.map(\n", + " "map_16da498d11917f3f8ea4a73c52cd7bf1",\n", + " {\n", + " center: [0, 0],\n", + " crs: L.CRS.EPSG3857,\n", + " zoom: 1,\n", + " zoomControl: true,\n", + " preferCanvas: false,\n", + " }\n", + " );\n", + "\n", + " \n", + "\n", + " \n", + " \n", + " var tile_layer_b57d9d344cedf4591a63862639f50b3f = L.tileLayer(\n", + " "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",\n", + " {"attribution": "Data by \\u0026copy; \\u003ca href=\\"http://openstreetmap.org\\"\\u003eOpenStreetMap\\u003c/a\\u003e, under \\u003ca href=\\"http://www.openstreetmap.org/copyright\\"\\u003eODbL\\u003c/a\\u003e.", "detectRetina": false, "maxNativeZoom": 18, "maxZoom": 18, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false}\n", + " ).addTo(map_16da498d11917f3f8ea4a73c52cd7bf1);\n", + " \n", + " \n", + "\n", + " function geo_json_45e768f5ba12bfc7c902b102bcbb4297_onEachFeature(feature, layer) {\n", + " layer.on({\n", + " });\n", + " };\n", + " var geo_json_45e768f5ba12bfc7c902b102bcbb4297 = L.geoJson(null, {\n", + " onEachFeature: geo_json_45e768f5ba12bfc7c902b102bcbb4297_onEachFeature,\n", + " \n", + " });\n", + "\n", + " function geo_json_45e768f5ba12bfc7c902b102bcbb4297_add (data) {\n", + " geo_json_45e768f5ba12bfc7c902b102bcbb4297\n", + " .addData(data)\n", + " .addTo(map_16da498d11917f3f8ea4a73c52cd7bf1);\n", + " }\n", + " geo_json_45e768f5ba12bfc7c902b102bcbb4297_add({"bbox": [6.839184, 45.396851, 6.92214, 45.480323], "features": [{"bbox": [6.839184, 45.396851, 6.92214, 45.480323], "geometry": {"coordinates": [[[6.839184, 45.480323], [6.83987, 45.479299], [6.841973, 45.478562], [6.843969, 45.47857], [6.845235, 45.479931], [6.847187, 45.479675], [6.847766, 45.480112], [6.848368, 45.479932], [6.849569, 45.480172], [6.850213, 45.479029], [6.850685, 45.477254], [6.8509, 45.476306], [6.851114, 45.474425], [6.851758, 45.472889], [6.853217, 45.471626], [6.855106, 45.46982], [6.855534, 45.468766], [6.855191, 45.468014], [6.85605, 45.46684], [6.856092, 45.464914], [6.856049, 45.463891], [6.855663, 45.462356], [6.856093, 45.461679], [6.856822, 45.46137], [6.857122, 45.460038], [6.857166, 45.458864], [6.857724, 45.458021], [6.858754, 45.457765], [6.859698, 45.458503], [6.860513, 45.458097], [6.861564, 45.458676], [6.861575, 45.457732], [6.860641, 45.456396], [6.864246, 45.456245], [6.865748, 45.455944], [6.867508, 45.455763], [6.869139, 45.455884], [6.870942, 45.456034], [6.875319, 45.454649], [6.879224, 45.455432], [6.881391, 45.454996], [6.883816, 45.455463], [6.886091, 45.455613], [6.887936, 45.456004], [6.890725, 45.457841], [6.890789, 45.45608], [6.891379, 45.454687], [6.892742, 45.454379], [6.894287, 45.453084], [6.896261, 45.45191], [6.896733, 45.452663], [6.898192, 45.452602], [6.899759, 45.453009], [6.90184, 45.452392], [6.902398, 45.451308], [6.903771, 45.450827], [6.905102, 45.450525], [6.906303, 45.451308], [6.909179, 45.449742], [6.911582, 45.448568], [6.913986, 45.447755], [6.916839, 45.44619], [6.917944, 45.444971], [6.920036, 45.444083], [6.92214, 45.441493], [6.921732, 45.440138], [6.91921, 45.437713], [6.916174, 45.435741], [6.915831, 45.433859], [6.915701, 45.432067], [6.914092, 45.430877], [6.912398, 45.429567], [6.912054, 45.428845], [6.910767, 45.428423], [6.910209, 45.4277], [6.910423, 45.427038], [6.908664, 45.425321], [6.906861, 45.423603], [6.905509, 45.42261], [6.903985, 45.421586], [6.904544, 45.420486], [6.904587, 45.418784], [6.903986, 45.41779], [6.9039, 45.416254], [6.904393, 45.414838], [6.9042, 45.413301], [6.902741, 45.411855], [6.90081, 45.411524], [6.900123, 45.410636], [6.90111, 45.409476], [6.901003, 45.408707], [6.900349, 45.408564], [6.900064, 45.409095], [6.899343, 45.408773], [6.89742, 45.408511], [6.893514, 45.404624], [6.890639, 45.403811], [6.889116, 45.403374], [6.887592, 45.402576], [6.886176, 45.401822], [6.886262, 45.400858], [6.886444, 45.400128], [6.887142, 45.4], [6.88652, 45.399201], [6.885339, 45.398297], [6.885704, 45.397966], [6.88403, 45.397318], [6.88227, 45.396851]]], "type": "MultiLineString"}, "id": "0", "properties": {}, "type": "Feature"}], "type": "FeatureCollection"});\n", + "\n", + " \n", + " \n", + " map_16da498d11917f3f8ea4a73c52cd7bf1.fitBounds(\n", + " [[45.412971, 6.837532], [45.462018, 6.963285]],\n", + " {}\n", + " );\n", + " \n", + " \n", + "\n", + " function geo_json_29cc78b2a51a8a413ceed49cd65e3b79_onEachFeature(feature, layer) {\n", + " layer.on({\n", + " });\n", + " };\n", + " var geo_json_29cc78b2a51a8a413ceed49cd65e3b79 = L.geoJson(null, {\n", + " onEachFeature: geo_json_29cc78b2a51a8a413ceed49cd65e3b79_onEachFeature,\n", + " \n", + " });\n", + "\n", + " function geo_json_29cc78b2a51a8a413ceed49cd65e3b79_add (data) {\n", + " geo_json_29cc78b2a51a8a413ceed49cd65e3b79\n", + " .addData(data)\n", + " .addTo(map_16da498d11917f3f8ea4a73c52cd7bf1);\n", + " }\n", + " geo_json_29cc78b2a51a8a413ceed49cd65e3b79_add({"features": [{"geometry": {"coordinates": [6.963285, 45.462018], "type": "Point"}, "properties": {"cluster": 0, "country": "France", "latitude": 45.462018, "longitude": 6.963285, "name": "Bellecote", "source": "nominatim", "sourceName": "Bellecote, Sentier de la Vall\\u00e9e Perdue, Le Cr\\u00eat, La Daille, Val-d\\u0027Is\\u00e8re, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73150, France", "xmlID": 0}, "type": "Feature"}, {"geometry": {"coordinates": [6.863067, 45.451642], "type": "Point"}, "properties": {"cluster": 0, "country": "France", "latitude": 45.451642, "longitude": 6.863067, "name": "Palet", "source": "nominatim", "sourceName": "Signal du Palet, Champagny-en-Vanoise, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73350, France", "xmlID": 0}, "type": "Feature"}, {"geometry": {"coordinates": [6.92583, 45.442088], "type": "Point"}, "properties": {"cluster": 0, "country": "France", "latitude": 45.442088, "longitude": 6.92583, "name": "Fresse", "source": "nominatim", "sourceName": "Fresse, Piste du Col de Fresse, Val-d\\u0027Is\\u00e8re, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73150, France", "xmlID": 0}, "type": "Feature"}, {"geometry": {"coordinates": [6.89952, 45.412971], "type": "Point"}, "properties": {"cluster": 0, "country": "France", "latitude": 45.412971, "longitude": 6.89952, "name": "Nettes", "source": "nominatim", "sourceName": "Lac des Nettes, Termignon, Val-Cenis, Saint-Jean-de-Maurienne, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73500, France", "xmlID": 0}, "type": "Feature"}, {"geometry": {"coordinates": [6.896874, 45.454039], "type": "Point"}, "properties": {"cluster": 0, "country": "France", "latitude": 45.454039, "longitude": 6.896874, "name": "Tichot", "source": "nominatim", "sourceName": "Tichot, Tarte \\u00e0 Lognan, Val-Claret, Tignes, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73320, France", "xmlID": 0}, "type": "Feature"}, {"geometry": {"coordinates": [6.837532, 45.456069], "type": "Point"}, "properties": {"cluster": 0, "country": "France", "latitude": 45.456069, "longitude": 6.837532, "name": "Grassaz", "source": "nominatim", "sourceName": "Col de la Grassaz, Peisey-Nancroix, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73210, France", "xmlID": 0}, "type": "Feature"}, {"geometry": {"coordinates": [6.898275, 45.419228], "type": "Point"}, "properties": {"cluster": 0, "country": "France", "latitude": 45.419228, "longitude": 6.898275, "name": "Leisse", "source": "nominatim", "sourceName": "Leisse, Chemin de Borsat, Val-d\\u0027Is\\u00e8re, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73150, France", "xmlID": 0}, "type": "Feature"}, {"geometry": {"coordinates": [6.914334, 45.458216], "type": "Point"}, "properties": {"cluster": 0, "country": "France", "latitude": 45.458216, "longitude": 6.914334, "name": "paquis", "source": "nominatim", "sourceName": "Paquis, GunPowder, Tignes, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73320, France", "xmlID": 0}, "type": "Feature"}, {"geometry": {"coordinates": [6.858926, 45.461481], "type": "Point"}, "properties": {"cluster": 0, "country": "France", "latitude": 45.461481, "longitude": 6.858926, "name": "Grattaleu", "source": "nominatim", "sourceName": "Lac du Grattaleu, Peisey-Nancroix, Albertville, Savoie, Auvergne-Rh\\u00f4ne-Alpes, France m\\u00e9tropolitaine, 73210, France", "xmlID": 0}, "type": "Feature"}], "type": "FeatureCollection"});\n", + "\n", + " \n", + " \n", + " geo_json_29cc78b2a51a8a413ceed49cd65e3b79.bindTooltip(\n", + " function(layer){\n", + " let div = L.DomUtil.create('div');\n", + " \n", + " let handleObject = feature=>typeof(feature)=='object' ? JSON.stringify(feature) : feature;\n", + " let fields = ["name", "source"];\n", + " let aliases = ["name", "source"];\n", + " let table = '<table>' +\n", + " String(\n", + " fields.map(\n", + " (v,i)=>\n", + " `<tr>\n", + " <th>${aliases[i].toLocaleString()}</th>\n", + " \n", + " <td>${handleObject(layer.feature.properties[v]).toLocaleString()}</td>\n", + " </tr>`).join(''))\n", + " +'</table>';\n", + " div.innerHTML=table;\n", + " \n", + " return div\n", + " }\n", + " ,{"className": "foliumtooltip", "sticky": true});\n", + " \n", + "</script>\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>" + ], + "text/plain": [ + "<folium.folium.Map at 0x16cd0adc0>" + ] + }, + "execution_count": 67, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "# appliquer la désambiguïsation \n", "doc_geocoded.cluster_disambiguation()\n", -- GitLab