{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Enclaves" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "%matplotlib widget\n", "import geopandas\n", "import pandas\n", "import starepandas\n", "import pystare\n", "import shapely\n", "import matplotlib.pyplot as plt" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "level = 8" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "world = geopandas.read_file(geopandas.datasets.get_path('naturalearth_lowres'))\n", "rsa = world[world.name=='South Africa']\n", "rsa = starepandas.STAREDataFrame(rsa, add_sids=True, level=level, add_trixels=True)" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| \n", " | pop_est | \n", "continent | \n", "name | \n", "iso_a3 | \n", "gdp_md_est | \n", "geometry | \n", "sids | \n", "trixels | \n", "
|---|---|---|---|---|---|---|---|---|
| 25 | \n", "58558270.0 | \n", "Africa | \n", "South Africa | \n", "ZAF | \n", "351431 | \n", "POLYGON ((16.34498 -28.57671, 16.82402 -28.082... | \n", "[2814749767106567, 2858730232217608, 286752632... | \n", "MULTIPOLYGON (((18.95439 -31.03247, 18.31675 -... | \n", "