From 88bf793acf0c5bb245cb85e6d846ff66ce526b01 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Tue, 18 Jun 2024 12:20:55 +0100 Subject: [PATCH] only simplify if you want to --- notebooks/cliopatria.ipynb | 45 +++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/notebooks/cliopatria.ipynb b/notebooks/cliopatria.ipynb index 1448108fb..8d8c8e95b 100644 --- a/notebooks/cliopatria.ipynb +++ b/notebooks/cliopatria.ipynb @@ -14,17 +14,17 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ - "cliopatria_geojson_path = \"../data/cliopatria_05192024/cliopatria.geojson\"\n", - "cliopatria_json_path = \"../data/cliopatria_05192024/name_years.json\"" + "cliopatria_geojson_path = \"../data/cliopatria_composite_unique_nonsimplified.geojson_06052024/cliopatria_composite_unique_nonsimplified.geojson\"\n", + "cliopatria_json_path = \"../data/cliopatria_composite_unique_nonsimplified.geojson_06052024/cliopatria_composite_unique_nonsimplified_name_years.json\"" ] }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ @@ -33,7 +33,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 7, "metadata": {}, "outputs": [], "source": [ @@ -41,6 +41,17 @@ "gdf = cliopatria_gdf(cliopatria_geojson_path, cliopatria_json_path)" ] }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [], + "source": [ + "# Simplify the geometries if you want to (this is optional)\n", + "# gdf_simplified = gdf.copy()\n", + "# gdf_simplified[\"geometry\"] = gdf_simplified[\"geometry\"].simplify(tolerance=0.07)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -56,13 +67,13 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "fa3061f86d3a49b6b61bae11e432de5a", + "model_id": "0a1ca8ed56ca4b289f56007d1186d19a", "version_major": 2, "version_minor": 0 }, @@ -76,7 +87,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "99a5dec1f2754627b1ba036fe845f8b8", + "model_id": "f3d1d6b5caca4553b4822fc5e8e367ac", "version_major": 2, "version_minor": 0 }, @@ -90,7 +101,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "924777c86b174796b9a5beb0bd05e599", + "model_id": "808e7bcab78e48eca2f45df809f1db41", "version_major": 2, "version_minor": 0 }, @@ -100,18 +111,6 @@ }, "metadata": {}, "output_type": "display_data" - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/Users/echalstrey/.pyenv/versions/3.11.4/lib/python3.11/site-packages/geopandas/geodataframe.py:1760: SettingWithCopyWarning: \n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", - " super().__setitem__(key, value)\n" - ] } ], "source": [ @@ -122,9 +121,9 @@ ], "metadata": { "kernelspec": { - "display_name": "Python (cliopatria)", + "display_name": "Python (cliopatria1)", "language": "python", - "name": "cliopatria" + "name": "cliopatria1" }, "language_info": { "codemirror_mode": {