{ "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": "markdown", "metadata": {}, "source": [ "Import libraries." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import ee\n", "import geemap" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "Map = geemap.Map()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Create a latitude grid." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "lat_grid = geemap.latitude_grid(step=5.0, west=-180, east=180, south=-85, north=85)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "Map.addLayer(lat_grid, {}, 'Latitude Grid')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "Map" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Convert `ee.FeatureCollection` to `pandas.DataFrame`." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "df = geemap.ee_to_df(lat_grid)\n", "df" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Create a longitude grid." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "lon_grid = geemap.longitude_grid(step=5.0, west=-180, east=180, south=-85, north=85)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "Map = geemap.Map()\n", "Map.addLayer(lon_grid, {}, 'Longitude Grid')\n", "Map" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Create a rectangular grid." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "grid = geemap.latlon_grid(\n", " lat_step=10, lon_step=10, west=-180, east=180, south=-85, north=85\n", ")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "Map = geemap.Map()\n", "Map.addLayer(grid, {}, 'Coordinate Grid')\n", "Map" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "![](https://i.imgur.com/FvRe3Lu.png)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" } }, "nbformat": 4, "nbformat_minor": 5 }