forked from edwardchalstrey1/seshat
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from Seshat-Global-History-Databank/fix/7
Fix/7
- Loading branch information
Showing
8 changed files
with
113 additions
and
320 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Cliopatria viewer\n", | ||
"\n", | ||
"1. Download and unzip the Cliopatria dataset.\n", | ||
"2. Update the Cliopatria GeoJSON file with colours and other properties required by Seshat:\n", | ||
" ```\n", | ||
" python cliopatria/convert_data.py /path/to/cliopatria.geojson\n", | ||
" ```\n", | ||
" Note: this will create a new file with the same name but with the suffix \"_seshat_processed.geojson\"\n", | ||
"3. Run the subsequent cells of this notebook\n", | ||
"4. Play around with both the GeoDataFrame (gdf) and the rendered map\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Note: update this path to the location of the cliopatria data\n", | ||
"cliopatria_geojson_path = \"../data/cliopatria_07052024/cliopatria_composite_unique_simplified_seshat_processed.geojson\"" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Import necessary libraries\n", | ||
"from map_functions import display_map\n", | ||
"import geopandas as gpd" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Load the processed Cliopatria data to a GeoDataFrame with geopandas\n", | ||
"gdf = gpd.read_file(cliopatria_geojson_path)\n", | ||
"gdf.head()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Play with the data on the map\n", | ||
"\n", | ||
"**Notes**\n", | ||
"- Use minus numbers for BCE.\n", | ||
"- Click the shapes to reveal the polity display names" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"display_year = 1217\n", | ||
"display_map(gdf, display_year)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python (cliopatria1)", | ||
"language": "python", | ||
"name": "cliopatria1" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.11.4" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.