Skip to content

Commit

Permalink
only simplify if you want to
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardchalstrey1 committed Jun 18, 2024
1 parent ba19701 commit 88bf793
Showing 1 changed file with 22 additions and 23 deletions.
45 changes: 22 additions & 23 deletions notebooks/cliopatria.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand All @@ -33,14 +33,25 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"# Load the Cliopatria data to a GeoDataFrame including end years for each shape\n",
"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": {},
Expand All @@ -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
},
Expand All @@ -76,7 +87,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "99a5dec1f2754627b1ba036fe845f8b8",
"model_id": "f3d1d6b5caca4553b4822fc5e8e367ac",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -90,7 +101,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "924777c86b174796b9a5beb0bd05e599",
"model_id": "808e7bcab78e48eca2f45df809f1db41",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -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": [
Expand All @@ -122,9 +121,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python (cliopatria)",
"display_name": "Python (cliopatria1)",
"language": "python",
"name": "cliopatria"
"name": "cliopatria1"
},
"language_info": {
"codemirror_mode": {
Expand Down

0 comments on commit 88bf793

Please sign in to comment.