{ "cells": [ { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "import os\n", "import rioxarray" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "'''\n", "Folder\n", "'''\n", "os.chdir(r'C:/Users/jtrum/world_bank/data/')" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "'''\n", "Read raster\n", "'''\n", "\n", "import xarray as xr" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "C:\\Users\\jtrum\\AppData\\Local\\Temp\\ipykernel_18792\\3927092705.py:1: DeprecationWarning: open_rasterio is Deprecated in favor of rioxarray. For information about transitioning, see: https://corteva.github.io/rioxarray/stable/getting_started/getting_started.html\n", " raster = xr.open_rasterio('ago_women_2020.tif')\n" ] } ], "source": [ "raster = xr.open_rasterio('ago_women_2020.tif')" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
<xarray.DataArray (band: 1, y: 54000, x: 50400)>\n",
"[2721600000 values with dtype=float64]\n",
"Coordinates:\n",
" * band (band) int32 1\n",
" * y (y) float64 -4.0 -4.0 -4.001 -4.001 ... -19.0 -19.0 -19.0 -19.0\n",
" * x (x) float64 11.0 11.0 11.0 11.0 11.0 ... 25.0 25.0 25.0 25.0 25.0\n",
"Attributes:\n",
" transform: (0.0002777777777780012, 0.0, 10.999861111264721, 0.0, -0....\n",
" crs: +proj=longlat +datum=WGS84 +no_defs=True\n",
" res: (0.0002777777777780012, 0.0002777777777780012)\n",
" is_tiled: 0\n",
" nodatavals: (nan,)\n",
" scales: (1.0,)\n",
" offsets: (0.0,)\n",
" AREA_OR_POINT: Area| \n", " | NAME_1 | \n", "GID_0 | \n", "COUNTRY | \n", "GID_1 | \n", "NL_NAME_1 | \n", "GID_2 | \n", "NAME_2 | \n", "VARNAME_2 | \n", "NL_NAME_2 | \n", "TYPE_2 | \n", "ENGTYPE_2 | \n", "CC_2 | \n", "HASC_2 | \n", "geometry | \n", "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", "Luanda | \n", "AGO | \n", "Angola | \n", "AGO.11_1 | \n", "NA | \n", "AGO.11.1_1 | \n", "Cacuaco | \n", "NA | \n", "NA | \n", "Município | \n", "Municpality|City Council | \n", "1108 | \n", "AO.LU.CC | \n", "MULTIPOLYGON (((13.01919 -9.02194, 13.02049 -9... | \n", "