{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\"Open\n", "\n", "Uncomment the following line to install [geemap](https://geemap.org) if needed." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# !pip install geemap" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import ee\n", "import geemap" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Add data to the map." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "Map = geemap.Map()\n", "countries = ee.FeatureCollection('users/giswqs/public/countries')\n", "Map.addLayer(countries, {}, 'Countries')\n", "Map" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Display the attribute table." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "geemap.ee_to_df(countries)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Get data to be joined to the attribute table." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "data = 'https://raw.githubusercontent.com/gee-community/geemap/master/examples/data/countries.geojson'" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Join data to the attribute table." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "fc = geemap.ee_join_table(countries, data, src_key='id', dst_key='ISO_A3')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Display the new attribute table." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "geemap.ee_to_df(fc)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Add the new data to the map." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "Map.addLayer(fc, {}, 'Countries New')" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" } }, "nbformat": 4, "nbformat_minor": 5 }