{ "cells": [ { "cell_type": "code", "execution_count": 145, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import ee\n", "import geemap\n", "import geopandas as gpd\n", "from shapely.ops import transform\n", "ee.Initialize()" ] }, { "cell_type": "code", "execution_count": 146, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "gdf = gpd.read_file(\"/home/patel_zeel/Mean_NDVI/golvada he 10 2023-24.kml\")\n", "gdf = gdf.to_crs(epsg=4326)\n", "def poly_3d_to_2d(shape):\n", " if shape.has_z:\n", " return transform(lambda x, y, z: (x, y), shape)\n", " else:\n", " return shape\n", "gdf['geometry'] = gdf['geometry'].apply(poly_3d_to_2d)\n", "gdf = gdf.to_crs(epsg=4326)\n", "first_item = gdf.iloc[0:1]\n", "ee_object = geemap.gdf_to_ee(first_item)" ] }, { "cell_type": "code", "execution_count": 120, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "Number of images in the collection: 2\n" ] } ], "source": [ "dataset = ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA').filterBounds(ee_object).filterDate('2023-01-01', '2023-01-31')\n", "true_color_432 = dataset.select(['B4', 'B3', 'B2'])\n", "print(\"Number of images in the collection: \", true_color_432.size().getInfo())" ] }, { "cell_type": "code", "execution_count": 136, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "Image ID: LC08_148044_20230115\n", "New Image ID: LC08_148044_20230115\n" ] } ], "source": [ "# pick the second image in the collection\n", "image = dataset.toList(true_color_432.size()).get(1)\n", "image = ee.Image(image)\n", "# print image id\n", "print(\"Image ID: \", image.id().getInfo())\n", "# replace id with \"anonymous\"\n", "image = image.set('id', 'anonymous')\n", "# print new image id\n", "print(\"New Image ID: \", image.id().getInfo())" ] }, { "cell_type": "code", "execution_count": 74, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "Computing statistics ...\n", "Generating URL ...\n", "Downloading data from https://earthengine.googleapis.com/v1/projects/815228341823/tables/8a81a210a87d3b3a27187b606616f13c-f5c9d2fc785b6f388b63270382c578e4:getFeatures\n", "Please wait ...\n", "Data downloaded to /home/patel_zeel/Mean_NDVI/zonal_stats.csv\n" ] } ], "source": [ "features = geemap.zonal_stats(dataset.qualityMosaic(\"B4\").select(\"B4\"), ee_object, statistics_type='mean', scale=10)" ] }, { "cell_type": "code", "execution_count": 69, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "'20210125'" ] }, "execution_count": 69, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import re\n", "\n", "re.findall(r\"LC08_\\d+_(\\d+)_NDVI\", \"LC08_148043_20210125_NDVI\")[0]" ] }, { "cell_type": "code", "execution_count": 72, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
<ee.image.Image object at 0x7fd10c62b820>
" ], "text/plain": [ "" ] }, "execution_count": 72, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dataset.qualityMosaic('NDVI')" ] }, { "cell_type": "code", "execution_count": 116, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "'2023-01-01'" ] }, "execution_count": 116, "metadata": {}, "output_type": "execute_result" } ], "source": [ "start = '2023-01-01'\n", "start.format(\"YYYY-MM\")" ] }, { "cell_type": "code", "execution_count": 110, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "['2023-01-01', '2023-02-01', '2023-03-01', '2023-04-01', '2023-05-01', '2023-06-01', '2023-07-01', '2023-08-01', '2023-09-01', '2023-10-01', '2023-11-01', '2023-12-01', '2024-01-01']\n" ] } ], "source": [ "import pandas as pd\n", "start_date = '2023-01'\n", "end_date = '2024-01'\n", "\n", "# get 1st day of each month\n", "dates = pd.date_range(start_date, end_date, freq='MS').strftime(\"%Y-%m-%d\").tolist()\n", "print(dates)" ] }, { "cell_type": "code", "execution_count": 138, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\u001b[0;31mSignature:\u001b[0m\n", "\u001b[0mgeemap\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mzonal_stats\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0min_value_raster\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0min_zone_vector\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mout_file_path\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mstat_type\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'MEAN'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mscale\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mcrs\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mtile_scale\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m1.0\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mreturn_fc\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mverbose\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mtimeout\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m300\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mproxies\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;31mSource:\u001b[0m \n", "\u001b[0;32mdef\u001b[0m \u001b[0mzonal_stats\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0min_value_raster\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0min_zone_vector\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mout_file_path\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mstat_type\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"MEAN\"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mscale\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mcrs\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mtile_scale\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m1.0\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mreturn_fc\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mverbose\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mtimeout\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m300\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mproxies\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m\"\"\"Summarizes the values of a raster within the zones of another dataset and exports the results as a csv, shp, json, kml, or kmz.\u001b[0m\n", "\u001b[0;34m\u001b[0m\n", "\u001b[0;34m Args:\u001b[0m\n", "\u001b[0;34m in_value_raster (object): An ee.Image or ee.ImageCollection that contains the values on which to calculate a statistic.\u001b[0m\n", "\u001b[0;34m in_zone_vector (object): An ee.FeatureCollection that defines the zones.\u001b[0m\n", "\u001b[0;34m out_file_path (str): Output file path that will contain the summary of the values in each zone. The file type can be: csv, shp, json, kml, kmz\u001b[0m\n", "\u001b[0;34m stat_type (str, optional): Statistical type to be calculated. Defaults to 'MEAN'. For 'HIST', you can provide three parameters: max_buckets, min_bucket_width, and max_raw. For 'FIXED_HIST', you must provide three parameters: hist_min, hist_max, and hist_steps.\u001b[0m\n", "\u001b[0;34m scale (float, optional): A nominal scale in meters of the projection to work in. Defaults to None.\u001b[0m\n", "\u001b[0;34m crs (str, optional): The projection to work in. If unspecified, the projection of the image's first band is used. If specified in addition to scale, rescaled to the specified scale. Defaults to None.\u001b[0m\n", "\u001b[0;34m tile_scale (float, optional): A scaling factor used to reduce aggregation tile size; using a larger tileScale (e.g. 2 or 4) may enable computations that run out of memory with the default. Defaults to 1.0.\u001b[0m\n", "\u001b[0;34m verbose (bool, optional): Whether to print descriptive text when the programming is running. Default to True.\u001b[0m\n", "\u001b[0;34m return_fc (bool, optional): Whether to return the results as an ee.FeatureCollection. Defaults to False.\u001b[0m\n", "\u001b[0;34m timeout (int, optional): Timeout in seconds. Default to 300.\u001b[0m\n", "\u001b[0;34m proxies (dict, optional): A dictionary of proxy servers to use for the request. Default to None.\u001b[0m\n", "\u001b[0;34m \"\"\"\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0min_value_raster\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mee\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mImageCollection\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0min_value_raster\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0min_value_raster\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtoBands\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0min_value_raster\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mee\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mImage\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"The input raster must be an ee.Image.\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32mreturn\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0min_zone_vector\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mee\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mFeatureCollection\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"The input zone data must be an ee.FeatureCollection.\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32mreturn\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mout_file_path\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mout_file_path\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgetcwd\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"zonal_stats.csv\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;34m\"statistics_type\"\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mstat_type\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpop\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"statistics_type\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mallowed_formats\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m\"csv\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"geojson\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"kml\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"kmz\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"shp\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mfilename\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mabspath\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mout_file_path\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mbasename\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbasename\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfilename\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;31m# name = os.path.splitext(basename)[0]\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mfiletype\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msplitext\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbasename\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlower\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mfiletype\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mallowed_formats\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m\"The file type must be one of the following: {}\"\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mformat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m\", \"\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mallowed_formats\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32mreturn\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;31m# Parameters for histogram\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;31m# The maximum number of buckets to use when building a histogram; will be rounded up to a power of 2.\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mmax_buckets\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;31m# The minimum histogram bucket width, or null to allow any power of 2.\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mmin_bucket_width\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;31m# The number of values to accumulate before building the initial histogram.\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mmax_raw\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mhist_min\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m1.0\u001b[0m \u001b[0;31m# The lower (inclusive) bound of the first bucket.\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mhist_max\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m100.0\u001b[0m \u001b[0;31m# The upper (exclusive) bound of the last bucket.\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mhist_steps\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m10\u001b[0m \u001b[0;31m# The number of buckets to use.\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;34m\"max_buckets\"\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mkeys\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mmax_buckets\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"max_buckets\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;34m\"min_bucket_width\"\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mkeys\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mmin_bucket_width\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"min_bucket\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;34m\"max_raw\"\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mkeys\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mmax_raw\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"max_raw\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mstat_type\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mstat_type\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mupper\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m\"FIXED_HIST\"\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;34m\"hist_min\"\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mkeys\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;34m\"hist_max\"\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mkeys\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;34m\"hist_steps\"\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mkeys\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mhist_min\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"hist_min\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mhist_max\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"hist_max\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mhist_steps\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"hist_steps\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mstat_type\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mupper\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m\"FIXED_HIST\"\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m\"To use fixedHistogram, please provide these three parameters: hist_min, hist_max, and hist_steps.\"\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32mreturn\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mallowed_statistics\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m{\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m\"COUNT\"\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mee\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mReducer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcount\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m\"MEAN\"\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mee\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mReducer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmean\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m\"MEAN_UNWEIGHTED\"\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mee\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mReducer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmean\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0munweighted\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m\"MAXIMUM\"\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mee\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mReducer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmax\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m\"MEDIAN\"\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mee\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mReducer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmedian\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m\"MINIMUM\"\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mee\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mReducer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m\"MODE\"\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mee\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mReducer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmode\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m\"STD\"\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mee\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mReducer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstdDev\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m\"MIN_MAX\"\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mee\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mReducer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mminMax\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m\"SUM\"\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mee\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mReducer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msum\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m\"VARIANCE\"\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mee\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mReducer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mvariance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m\"HIST\"\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mee\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mReducer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhistogram\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mmaxBuckets\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mmax_buckets\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mminBucketWidth\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mmin_bucket_width\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmaxRaw\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mmax_raw\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m\"FIXED_HIST\"\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mee\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mReducer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfixedHistogram\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mhist_min\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mhist_max\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mhist_steps\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m\"COMBINED_COUNT_MEAN\"\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mee\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mReducer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcount\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcombine\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mee\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mReducer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmean\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msharedInputs\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m\"COMBINED_COUNT_MEAN_UNWEIGHTED\"\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mee\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mReducer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcount\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcombine\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mee\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mReducer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmean\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0munweighted\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msharedInputs\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m}\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mstat_type\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mstat_type\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mupper\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mallowed_statistics\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mkeys\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m\"The statistics type must be one of the following: {}\"\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mformat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m\", \"\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlist\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mallowed_statistics\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mkeys\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32mreturn\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mreducer\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mallowed_statistics\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mstat_type\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mupper\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mstat_type\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mee\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mReducer\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mreducer\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mstat_type\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"statistics_type must be either a string or ee.Reducer.\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mscale\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mscale\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0min_value_raster\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mprojection\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mnominalScale\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmultiply\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m10\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mverbose\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Computing statistics ...\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0min_value_raster\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mreduceRegions\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mcollection\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0min_zone_vector\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mreducer\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mreducer\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mscale\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mscale\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mcrs\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mcrs\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mtileScale\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtile_scale\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mreturn_fc\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mresult\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mee_export_vector\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mresult\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfilename\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtimeout\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtimeout\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mproxies\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mproxies\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mException\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32mraise\u001b[0m \u001b[0mException\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0me\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;31mFile:\u001b[0m /opt/anaconda3/envs/zeel_py310/lib/python3.10/site-packages/geemap/common.py\n", "\u001b[0;31mType:\u001b[0m function" ] } ], "source": [ "geemap.zonal_stats??" ] }, { "cell_type": "code", "execution_count": 139, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 140, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\u001b[0;31mSignature:\u001b[0m\n", "\u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmerge\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mleft\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;34m'DataFrame | Series'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mright\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;34m'DataFrame | Series'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mhow\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;34m'MergeHow'\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m'inner'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mon\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;34m'IndexLabel | None'\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mleft_on\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;34m'IndexLabel | None'\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mright_on\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;34m'IndexLabel | None'\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mleft_index\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;34m'bool'\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mright_index\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;34m'bool'\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0msort\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;34m'bool'\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0msuffixes\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;34m'Suffixes'\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;34m'_x'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'_y'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mcopy\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;34m'bool | None'\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mindicator\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;34m'str | bool'\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mvalidate\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;34m'str | None'\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0;34m'DataFrame'\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;31mDocstring:\u001b[0m\n", "Merge DataFrame or named Series objects with a database-style join.\n", "\n", "A named Series object is treated as a DataFrame with a single named column.\n", "\n", "The join is done on columns or indexes. If joining columns on\n", "columns, the DataFrame indexes *will be ignored*. Otherwise if joining indexes\n", "on indexes or indexes on a column or columns, the index will be passed on.\n", "When performing a cross merge, no column specifications to merge on are\n", "allowed.\n", "\n", ".. warning::\n", "\n", " If both key columns contain rows where the key is a null value, those\n", " rows will be matched against each other. This is different from usual SQL\n", " join behaviour and can lead to unexpected results.\n", "\n", "Parameters\n", "----------\n", "left : DataFrame or named Series\n", "right : DataFrame or named Series\n", " Object to merge with.\n", "how : {'left', 'right', 'outer', 'inner', 'cross'}, default 'inner'\n", " Type of merge to be performed.\n", "\n", " * left: use only keys from left frame, similar to a SQL left outer join;\n", " preserve key order.\n", " * right: use only keys from right frame, similar to a SQL right outer join;\n", " preserve key order.\n", " * outer: use union of keys from both frames, similar to a SQL full outer\n", " join; sort keys lexicographically.\n", " * inner: use intersection of keys from both frames, similar to a SQL inner\n", " join; preserve the order of the left keys.\n", " * cross: creates the cartesian product from both frames, preserves the order\n", " of the left keys.\n", "\n", " .. versionadded:: 1.2.0\n", "\n", "on : label or list\n", " Column or index level names to join on. These must be found in both\n", " DataFrames. If `on` is None and not merging on indexes then this defaults\n", " to the intersection of the columns in both DataFrames.\n", "left_on : label or list, or array-like\n", " Column or index level names to join on in the left DataFrame. Can also\n", " be an array or list of arrays of the length of the left DataFrame.\n", " These arrays are treated as if they are columns.\n", "right_on : label or list, or array-like\n", " Column or index level names to join on in the right DataFrame. Can also\n", " be an array or list of arrays of the length of the right DataFrame.\n", " These arrays are treated as if they are columns.\n", "left_index : bool, default False\n", " Use the index from the left DataFrame as the join key(s). If it is a\n", " MultiIndex, the number of keys in the other DataFrame (either the index\n", " or a number of columns) must match the number of levels.\n", "right_index : bool, default False\n", " Use the index from the right DataFrame as the join key. Same caveats as\n", " left_index.\n", "sort : bool, default False\n", " Sort the join keys lexicographically in the result DataFrame. If False,\n", " the order of the join keys depends on the join type (how keyword).\n", "suffixes : list-like, default is (\"_x\", \"_y\")\n", " A length-2 sequence where each element is optionally a string\n", " indicating the suffix to add to overlapping column names in\n", " `left` and `right` respectively. Pass a value of `None` instead\n", " of a string to indicate that the column name from `left` or\n", " `right` should be left as-is, with no suffix. At least one of the\n", " values must not be None.\n", "copy : bool, default True\n", " If False, avoid copy if possible.\n", "indicator : bool or str, default False\n", " If True, adds a column to the output DataFrame called \"_merge\" with\n", " information on the source of each row. The column can be given a different\n", " name by providing a string argument. The column will have a Categorical\n", " type with the value of \"left_only\" for observations whose merge key only\n", " appears in the left DataFrame, \"right_only\" for observations\n", " whose merge key only appears in the right DataFrame, and \"both\"\n", " if the observation's merge key is found in both DataFrames.\n", "\n", "validate : str, optional\n", " If specified, checks if merge is of specified type.\n", "\n", " * \"one_to_one\" or \"1:1\": check if merge keys are unique in both\n", " left and right datasets.\n", " * \"one_to_many\" or \"1:m\": check if merge keys are unique in left\n", " dataset.\n", " * \"many_to_one\" or \"m:1\": check if merge keys are unique in right\n", " dataset.\n", " * \"many_to_many\" or \"m:m\": allowed, but does not result in checks.\n", "\n", "Returns\n", "-------\n", "DataFrame\n", " A DataFrame of the two merged objects.\n", "\n", "See Also\n", "--------\n", "merge_ordered : Merge with optional filling/interpolation.\n", "merge_asof : Merge on nearest keys.\n", "DataFrame.join : Similar method using indices.\n", "\n", "Examples\n", "--------\n", ">>> df1 = pd.DataFrame({'lkey': ['foo', 'bar', 'baz', 'foo'],\n", "... 'value': [1, 2, 3, 5]})\n", ">>> df2 = pd.DataFrame({'rkey': ['foo', 'bar', 'baz', 'foo'],\n", "... 'value': [5, 6, 7, 8]})\n", ">>> df1\n", " lkey value\n", "0 foo 1\n", "1 bar 2\n", "2 baz 3\n", "3 foo 5\n", ">>> df2\n", " rkey value\n", "0 foo 5\n", "1 bar 6\n", "2 baz 7\n", "3 foo 8\n", "\n", "Merge df1 and df2 on the lkey and rkey columns. The value columns have\n", "the default suffixes, _x and _y, appended.\n", "\n", ">>> df1.merge(df2, left_on='lkey', right_on='rkey')\n", " lkey value_x rkey value_y\n", "0 foo 1 foo 5\n", "1 foo 1 foo 8\n", "2 foo 5 foo 5\n", "3 foo 5 foo 8\n", "4 bar 2 bar 6\n", "5 baz 3 baz 7\n", "\n", "Merge DataFrames df1 and df2 with specified left and right suffixes\n", "appended to any overlapping columns.\n", "\n", ">>> df1.merge(df2, left_on='lkey', right_on='rkey',\n", "... suffixes=('_left', '_right'))\n", " lkey value_left rkey value_right\n", "0 foo 1 foo 5\n", "1 foo 1 foo 8\n", "2 foo 5 foo 5\n", "3 foo 5 foo 8\n", "4 bar 2 bar 6\n", "5 baz 3 baz 7\n", "\n", "Merge DataFrames df1 and df2, but raise an exception if the DataFrames have\n", "any overlapping columns.\n", "\n", ">>> df1.merge(df2, left_on='lkey', right_on='rkey', suffixes=(False, False))\n", "Traceback (most recent call last):\n", "...\n", "ValueError: columns overlap but no suffix specified:\n", " Index(['value'], dtype='object')\n", "\n", ">>> df1 = pd.DataFrame({'a': ['foo', 'bar'], 'b': [1, 2]})\n", ">>> df2 = pd.DataFrame({'a': ['foo', 'baz'], 'c': [3, 4]})\n", ">>> df1\n", " a b\n", "0 foo 1\n", "1 bar 2\n", ">>> df2\n", " a c\n", "0 foo 3\n", "1 baz 4\n", "\n", ">>> df1.merge(df2, how='inner', on='a')\n", " a b c\n", "0 foo 1 3\n", "\n", ">>> df1.merge(df2, how='left', on='a')\n", " a b c\n", "0 foo 1 3.0\n", "1 bar 2 NaN\n", "\n", ">>> df1 = pd.DataFrame({'left': ['foo', 'bar']})\n", ">>> df2 = pd.DataFrame({'right': [7, 8]})\n", ">>> df1\n", " left\n", "0 foo\n", "1 bar\n", ">>> df2\n", " right\n", "0 7\n", "1 8\n", "\n", ">>> df1.merge(df2, how='cross')\n", " left right\n", "0 foo 7\n", "1 foo 8\n", "2 bar 7\n", "3 bar 8\n", "\u001b[0;31mSource:\u001b[0m \n", "\u001b[0;34m@\u001b[0m\u001b[0mSubstitution\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"\\nleft : DataFrame or named Series\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m\u001b[0;34m@\u001b[0m\u001b[0mAppender\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0m_merge_doc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mindents\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m\u001b[0;32mdef\u001b[0m \u001b[0mmerge\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mleft\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mDataFrame\u001b[0m \u001b[0;34m|\u001b[0m \u001b[0mSeries\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mright\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mDataFrame\u001b[0m \u001b[0;34m|\u001b[0m \u001b[0mSeries\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mhow\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mMergeHow\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m\"inner\"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mon\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mIndexLabel\u001b[0m \u001b[0;34m|\u001b[0m \u001b[0;32mNone\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mleft_on\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mIndexLabel\u001b[0m \u001b[0;34m|\u001b[0m \u001b[0;32mNone\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mright_on\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mIndexLabel\u001b[0m \u001b[0;34m|\u001b[0m \u001b[0;32mNone\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mleft_index\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mbool\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mright_index\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mbool\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0msort\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mbool\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0msuffixes\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mSuffixes\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;34m\"_x\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"_y\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mcopy\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mbool\u001b[0m \u001b[0;34m|\u001b[0m \u001b[0;32mNone\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mindicator\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mstr\u001b[0m \u001b[0;34m|\u001b[0m \u001b[0mbool\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mvalidate\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mstr\u001b[0m \u001b[0;34m|\u001b[0m \u001b[0;32mNone\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mDataFrame\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mleft_df\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_validate_operand\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mleft\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mright_df\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_validate_operand\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mright\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mhow\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m\"cross\"\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0m_cross_merge\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mleft_df\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mright_df\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mon\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mon\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mleft_on\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mleft_on\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mright_on\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mright_on\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mleft_index\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mleft_index\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mright_index\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mright_index\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0msort\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0msort\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0msuffixes\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0msuffixes\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mindicator\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mindicator\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mvalidate\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mvalidate\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mcopy\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mcopy\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mop\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_MergeOperation\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mleft_df\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mright_df\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mhow\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mhow\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mon\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mon\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mleft_on\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mleft_on\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mright_on\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mright_on\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mleft_index\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mleft_index\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mright_index\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mright_index\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0msort\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0msort\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0msuffixes\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0msuffixes\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mindicator\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mindicator\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0mvalidate\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mvalidate\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\n", "\u001b[0;34m\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mop\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_result\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcopy\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mcopy\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;31mFile:\u001b[0m /opt/anaconda3/envs/zeel_py310/lib/python3.10/site-packages/pandas/core/reshape/merge.py\n", "\u001b[0;31mType:\u001b[0m function" ] } ], "source": [ "pd.merge??" ] }, { "cell_type": "code", "execution_count": 163, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
    • type:Image
    • id:LANDSAT/LC08/C02/T1_TOA/LC08_148044_20230115
    • version:1728577061133366
        • id:B1
        • crs:EPSG:32643
          • 0:30
          • 1:0
          • 2:221685
          • 3:0
          • 4:-30
          • 5:2673915
          • type:PixelType
          • precision:float
          • 0:7671
          • 1:7831
        • id:B2
        • crs:EPSG:32643
          • 0:30
          • 1:0
          • 2:221685
          • 3:0
          • 4:-30
          • 5:2673915
          • type:PixelType
          • precision:float
          • 0:7671
          • 1:7831
        • id:B3
        • crs:EPSG:32643
          • 0:30
          • 1:0
          • 2:221685
          • 3:0
          • 4:-30
          • 5:2673915
          • type:PixelType
          • precision:float
          • 0:7671
          • 1:7831
        • id:B4
        • crs:EPSG:32643
          • 0:30
          • 1:0
          • 2:221685
          • 3:0
          • 4:-30
          • 5:2673915
          • type:PixelType
          • precision:float
          • 0:7671
          • 1:7831
        • id:B5
        • crs:EPSG:32643
          • 0:30
          • 1:0
          • 2:221685
          • 3:0
          • 4:-30
          • 5:2673915
          • type:PixelType
          • precision:float
          • 0:7671
          • 1:7831
        • id:B6
        • crs:EPSG:32643
          • 0:30
          • 1:0
          • 2:221685
          • 3:0
          • 4:-30
          • 5:2673915
          • type:PixelType
          • precision:float
          • 0:7671
          • 1:7831
        • id:B7
        • crs:EPSG:32643
          • 0:30
          • 1:0
          • 2:221685
          • 3:0
          • 4:-30
          • 5:2673915
          • type:PixelType
          • precision:float
          • 0:7671
          • 1:7831
        • id:B8
        • crs:EPSG:32643
          • 0:15
          • 1:0
          • 2:221692.5
          • 3:0
          • 4:-15
          • 5:2673907.5
          • type:PixelType
          • precision:float
          • 0:15341
          • 1:15661
        • id:B9
        • crs:EPSG:32643
          • 0:30
          • 1:0
          • 2:221685
          • 3:0
          • 4:-30
          • 5:2673915
          • type:PixelType
          • precision:float
          • 0:7671
          • 1:7831
        • id:B10
        • crs:EPSG:32643
          • 0:30
          • 1:0
          • 2:221685
          • 3:0
          • 4:-30
          • 5:2673915
          • type:PixelType
          • precision:float
          • 0:7671
          • 1:7831
        • id:B11
        • crs:EPSG:32643
          • 0:30
          • 1:0
          • 2:221685
          • 3:0
          • 4:-30
          • 5:2673915
          • type:PixelType
          • precision:float
          • 0:7671
          • 1:7831
        • id:QA_PIXEL
        • crs:EPSG:32643
          • 0:30
          • 1:0
          • 2:221685
          • 3:0
          • 4:-30
          • 5:2673915
          • type:PixelType
          • max:65535
          • min:0
          • precision:int
          • 0:7671
          • 1:7831
        • id:QA_RADSAT
        • crs:EPSG:32643
          • 0:30
          • 1:0
          • 2:221685
          • 3:0
          • 4:-30
          • 5:2673915
          • type:PixelType
          • max:65535
          • min:0
          • precision:int
          • 0:7671
          • 1:7831
        • id:SAA
        • crs:EPSG:32643
          • 0:30
          • 1:0
          • 2:221685
          • 3:0
          • 4:-30
          • 5:2673915
          • type:PixelType
          • max:32767
          • min:-32768
          • precision:int
          • 0:7671
          • 1:7831
        • id:SZA
        • crs:EPSG:32643
          • 0:30
          • 1:0
          • 2:221685
          • 3:0
          • 4:-30
          • 5:2673915
          • type:PixelType
          • max:32767
          • min:-32768
          • precision:int
          • 0:7671
          • 1:7831
        • id:VAA
        • crs:EPSG:32643
          • 0:30
          • 1:0
          • 2:221685
          • 3:0
          • 4:-30
          • 5:2673915
          • type:PixelType
          • max:32767
          • min:-32768
          • precision:int
          • 0:7671
          • 1:7831
        • id:VZA
        • crs:EPSG:32643
          • 0:30
          • 1:0
          • 2:221685
          • 3:0
          • 4:-30
          • 5:2673915
          • type:PixelType
          • max:32767
          • min:-32768
          • precision:int
          • 0:7671
          • 1:7831
      • CLOUD_COVER:0.04
      • CLOUD_COVER_LAND:0.04
      • COLLECTION_CATEGORY:T1
      • COLLECTION_NUMBER:2
      • DATA_SOURCE_ELEVATION:GLS2000
      • DATA_SOURCE_TIRS_STRAY_LIGHT_CORRECTION:TIRS
      • DATE_ACQUIRED:2023-01-15
      • DATE_PRODUCT_GENERATED:1675122294000
      • DATUM:WGS84
      • EARTH_SUN_DISTANCE:0.9836383
      • ELLIPSOID:WGS84
      • GEOMETRIC_RMSE_MODEL:7.591
      • GEOMETRIC_RMSE_MODEL_X:5.31
      • GEOMETRIC_RMSE_MODEL_Y:5.425
      • GEOMETRIC_RMSE_VERIFY:4.289
      • GRID_CELL_SIZE_PANCHROMATIC:15
      • GRID_CELL_SIZE_REFLECTIVE:30
      • GRID_CELL_SIZE_THERMAL:30
      • GROUND_CONTROL_POINTS_MODEL:685
      • GROUND_CONTROL_POINTS_VERIFY:186
      • GROUND_CONTROL_POINTS_VERSION:5
      • IMAGE_QUALITY_OLI:9
      • IMAGE_QUALITY_TIRS:9
      • K1_CONSTANT_BAND_10:774.8853
      • K1_CONSTANT_BAND_11:480.8883
      • K2_CONSTANT_BAND_10:1321.0789
      • K2_CONSTANT_BAND_11:1201.1442
      • LANDSAT_PRODUCT_ID:LC08_L1TP_148044_20230115_20230130_02_T1
      • LANDSAT_SCENE_ID:LC81480442023015LGN00
      • MAP_PROJECTION:UTM
      • NADIR_OFFNADIR:NADIR
      • ORIENTATION:NORTH_UP
      • PANCHROMATIC_LINES:15661
      • PANCHROMATIC_SAMPLES:15341
      • PROCESSING_LEVEL:L1TP
      • PROCESSING_SOFTWARE_VERSION:LPGS_16.2.0
      • RADIANCE_ADD_BAND_1:-64.88466
      • RADIANCE_ADD_BAND_10:0.1
      • RADIANCE_ADD_BAND_11:0.1
      • RADIANCE_ADD_BAND_2:-66.44268
      • RADIANCE_ADD_BAND_3:-61.22636
      • RADIANCE_ADD_BAND_4:-51.62952
      • RADIANCE_ADD_BAND_5:-31.59469
      • RADIANCE_ADD_BAND_6:-7.85731
      • RADIANCE_ADD_BAND_7:-2.64833
      • RADIANCE_ADD_BAND_8:-58.4304
      • RADIANCE_ADD_BAND_9:-12.34792
      • RADIANCE_MULT_BAND_1:0.012977
      • RADIANCE_MULT_BAND_10:0.0003342
      • RADIANCE_MULT_BAND_11:0.0003342
      • RADIANCE_MULT_BAND_2:0.013289
      • RADIANCE_MULT_BAND_3:0.012245
      • RADIANCE_MULT_BAND_4:0.010326
      • RADIANCE_MULT_BAND_5:0.0063189
      • RADIANCE_MULT_BAND_6:0.0015715
      • RADIANCE_MULT_BAND_7:0.00052967
      • RADIANCE_MULT_BAND_8:0.011686
      • RADIANCE_MULT_BAND_9:0.0024696
      • REFLECTANCE_ADD_BAND_1:-0.1
      • REFLECTANCE_ADD_BAND_2:-0.1
      • REFLECTANCE_ADD_BAND_3:-0.1
      • REFLECTANCE_ADD_BAND_4:-0.1
      • REFLECTANCE_ADD_BAND_5:-0.1
      • REFLECTANCE_ADD_BAND_6:-0.1
      • REFLECTANCE_ADD_BAND_7:-0.1
      • REFLECTANCE_ADD_BAND_8:-0.1
      • REFLECTANCE_ADD_BAND_9:-0.1
      • REFLECTANCE_MULT_BAND_1:2e-05
      • REFLECTANCE_MULT_BAND_2:2e-05
      • REFLECTANCE_MULT_BAND_3:2e-05
      • REFLECTANCE_MULT_BAND_4:2e-05
      • REFLECTANCE_MULT_BAND_5:2e-05
      • REFLECTANCE_MULT_BAND_6:2e-05
      • REFLECTANCE_MULT_BAND_7:2e-05
      • REFLECTANCE_MULT_BAND_8:2e-05
      • REFLECTANCE_MULT_BAND_9:2e-05
      • REFLECTIVE_LINES:7831
      • REFLECTIVE_SAMPLES:7671
      • REQUEST_ID:1631847_00022
      • RESAMPLING_OPTION:CUBIC_CONVOLUTION
      • ROLL_ANGLE:-0.001
      • SATURATION_BAND_1:N
      • SATURATION_BAND_2:N
      • SATURATION_BAND_3:N
      • SATURATION_BAND_4:N
      • SATURATION_BAND_5:N
      • SATURATION_BAND_6:N
      • SATURATION_BAND_7:Y
      • SATURATION_BAND_8:N
      • SATURATION_BAND_9:N
      • SCENE_CENTER_TIME:05:33:07.2544160Z
      • SENSOR_ID:OLI_TIRS
      • SPACECRAFT_ID:LANDSAT_8
      • STATION_ID:LGN
      • SUN_AZIMUTH:148.67360104
      • SUN_ELEVATION:39.17034349
      • TARGET_WRS_PATH:148
      • TARGET_WRS_ROW:44
      • THERMAL_LINES:7831
      • THERMAL_SAMPLES:7671
      • TIRS_SSM_MODEL:FINAL
      • TIRS_SSM_POSITION_STATUS:ESTIMATED
      • TRUNCATION_OLI:UPPER
      • UTM_ZONE:43
      • WRS_PATH:148
      • WRS_ROW:44
      • WRS_TYPE:2
      • system:asset_size:1223935931
        • type:LinearRing
            • 0:72.31883641964504
            • 1:22.52056460806495
            • 0:72.29786773945534
            • 1:22.42936978641094
            • 0:72.29790667636928
            • 1:22.42736139148
            • 0:72.30336790848062
            • 1:22.426188648118245
            • 0:72.91869001515637
            • 1:22.30172835792067
            • 0:73.56730118878409
            • 1:22.167716185850985
            • 0:74.09737210807053
            • 1:22.056060171921665
            • 0:74.0993441010931
            • 1:22.056071041671355
            • 0:74.10397180462448
            • 1:22.07490056623611
            • 0:74.1329028941469
            • 1:22.19375917371582
            • 0:74.338430292183
            • 1:23.033751135411748
            • 0:74.47374505900434
            • 1:23.582190648182443
            • 0:74.52477957148619
            • 1:23.788055785032157
            • 0:74.52361975586437
            • 1:23.788584893320223
            • 0:73.58117794062672
            • 1:23.982739409188408
            • 0:72.7016330176871
            • 1:24.15813876032298
            • 0:72.69921791350811
            • 1:24.158102347091965
            • 0:72.60125718541295
            • 1:23.739508350574084
            • 0:72.50666704989243
            • 1:23.333219126751594
            • 0:72.41253287124782
            • 1:22.926903337749174
            • 0:72.31883641964504
            • 1:22.52056460806495
      • system:index:LC08_148044_20230115
      • system:time_end:1673760787254
      • system:time_start:1673760787254
" ], "text/plain": [ "" ] }, "execution_count": 163, "metadata": {}, "output_type": "execute_result" } ], "source": [ "first_item\n", "ee_object = geemap.gdf_to_ee(first_item)\n", "image = dataset.toList(true_color_432.size()).get(1)\n", "image = ee.Image(image)\n", "image" ] }, { "cell_type": "code", "execution_count": 232, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "d5625c7aabcf4d92a42515ca045ef758", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Map(center=[27.0, 72.0], controls=(WidgetControl(options=['position', 'transparent_bg'], widget=SearchDataGUI(…" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import geemap\n", "Map = geemap.Map(center=(27.0, 72.0), zoom=17)\n", "\n", "wmts_url = \"https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/MapServer/WMTS/1.0.0\"\n", "\n", "Map.add_tile_layer(\"https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/default028mm/MapServer/tile/56450/{z}/{y}/{x}\")\n", "Map" ] }, { "cell_type": "code", "execution_count": 249, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "execution_count": 249, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import geemap.foliumap as geemap\n", "Map = geemap.Map(center=(27.0, 72.0), zoom=17)\n", "\n", "wmts_url = \"https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/MapServer/WMTS/1.0.0\"\n", "\n", "Map.add_tile_layer(\"https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/56450/{z}/{y}/{x}\")\n", "Map" ] }, { "cell_type": "code", "execution_count": 268, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "ad7f77aad13a49ce9cc3518d296d1138", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Map(center=[27.0, 72.0], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_out…" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import leafmap\n", "Map = leafmap.Map(center=(27.0, 72.0), zoom=17)\n", "Map.split_map(\"https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/10/{z}/{y}/{x}\", \"https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/56450/{z}/{y}/{x}\")\n", "Map" ] }, { "cell_type": "code", "execution_count": 277, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "67487913ce194912975217073b4e6912", "version_major": 2, "version_minor": 0 }, "text/plain": [ "GridspecLayout(children=(Output(layout=Layout(grid_area='widget001')), Output(layout=Layout(grid_area='widget0…" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import leafmap.leafmap as leafmap\n", "\n", "layers = [\"ROADMAP\", \"HYBRID\"]\n", "leafmap.linked_maps(rows=1, cols=2, height=\"400px\", layers=layers)" ] }, { "cell_type": "code", "execution_count": 204, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import xml.etree.ElementTree as ET\n", "import requests\n", "\n", "# WMTS capabilities URL\n", "wmts_url = \"https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/MapServer/WMTS/1.0.0/WMTSCapabilities.xml\"\n", "\n", "# Get the XML content\n", "response = requests.get(wmts_url)\n", "root = ET.fromstring(response.content)" ] }, { "cell_type": "code", "execution_count": 208, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "Number of layers: 175\n" ] } ], "source": [ "import xml.etree.ElementTree as ET\n", "import requests\n", "\n", "# WMTS capabilities URL\n", "wmts_url = \"https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/MapServer/WMTS/1.0.0/WMTSCapabilities.xml\"\n", "\n", "# Fetch the XML content\n", "response = requests.get(wmts_url)\n", "root = ET.fromstring(response.content)\n", "\n", "# Define namespaces\n", "namespace = {\n", " 'wmts': 'https://www.opengis.net/wmts/1.0',\n", " 'ows': 'https://www.opengis.net/ows/1.1'\n", "}\n", "\n", "# Extract mapping of layer identifiers to their ResourceURL templates\n", "layer_mapping = {}\n", "\n", "# Find all Layer elements\n", "for layer in root.findall('.//wmts:Layer', namespace):\n", " identifier = layer.find('ows:Identifier', namespace).text\n", " title = layer.find('ows:Title', namespace).text\n", " resource_url_elem = layer.find('wmts:ResourceURL', namespace)\n", "\n", " if resource_url_elem is not None:\n", " resource_template = resource_url_elem.get('template')\n", " layer_mapping[identifier] = {\n", " 'title': title,\n", " 'resource_template': resource_template\n", " }\n", "\n", "# Display the extracted layer mapping\n", "print(f\"Number of layers: {len(layer_mapping)}\")" ] }, { "cell_type": "code", "execution_count": 240, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "b822840dfb914ba7b3b96695f6def7f5", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/175 [00:00\n", " .geemap-dark {\n", " --jp-widgets-color: white;\n", " --jp-widgets-label-color: white;\n", " --jp-ui-font-color1: white;\n", " --jp-layout-color2: #454545;\n", " background-color: #383838;\n", " }\n", "\n", " .geemap-dark .jupyter-button {\n", " --jp-layout-color3: #383838;\n", " }\n", "\n", " .geemap-colab {\n", " background-color: var(--colab-primary-surface-color, white);\n", " }\n", "\n", " .geemap-colab .jupyter-button {\n", " --jp-layout-color3: var(--colab-primary-surface-color, white);\n", " }\n", " \n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "{'2024-10-10': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/56450/{z}/{y}/{x}',\n", " '2024-09-19': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/20337/{z}/{y}/{x}',\n", " '2024-08-15': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/32553/{z}/{y}/{x}',\n", " '2024-06-27': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/39767/{z}/{y}/{x}',\n", " '2024-06-06': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/12428/{z}/{y}/{x}',\n", " '2024-05-09': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/52930/{z}/{y}/{x}',\n", " '2024-03-28': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/13968/{z}/{y}/{x}',\n", " '2024-03-07': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/60013/{z}/{y}/{x}',\n", " '2024-02-08': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/37965/{z}/{y}/{x}',\n", " '2024-01-18': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/41468/{z}/{y}/{x}',\n", " '2023-12-07': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/56102/{z}/{y}/{x}',\n", " '2023-11-01': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/12457/{z}/{y}/{x}',\n", " '2023-10-11': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/1034/{z}/{y}/{x}',\n", " '2023-08-31': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/64776/{z}/{y}/{x}',\n", " '2023-08-10': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/17632/{z}/{y}/{x}',\n", " '2023-06-29': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/47963/{z}/{y}/{x}',\n", " '2023-06-13': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/25982/{z}/{y}/{x}',\n", " '2023-05-03': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/46399/{z}/{y}/{x}',\n", " '2023-04-05': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/37890/{z}/{y}/{x}',\n", " '2023-03-15': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/44873/{z}/{y}/{x}',\n", " '2023-02-23': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/57965/{z}/{y}/{x}',\n", " '2023-01-11': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/11475/{z}/{y}/{x}',\n", " '2022-12-14': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/45134/{z}/{y}/{x}',\n", " '2022-11-02': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/7110/{z}/{y}/{x}',\n", " '2022-10-12': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/44988/{z}/{y}/{x}',\n", " '2022-09-21': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/47471/{z}/{y}/{x}',\n", " '2022-08-31': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/45441/{z}/{y}/{x}',\n", " '2022-08-10': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/17825/{z}/{y}/{x}',\n", " '2022-07-20': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/13851/{z}/{y}/{x}',\n", " '2022-06-29': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/4905/{z}/{y}/{x}',\n", " '2022-06-08': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/44710/{z}/{y}/{x}',\n", " '2022-05-18': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/5314/{z}/{y}/{x}',\n", " '2022-04-27': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/16245/{z}/{y}/{x}',\n", " '2022-04-06': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/48232/{z}/{y}/{x}',\n", " '2022-03-16': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/10321/{z}/{y}/{x}',\n", " '2022-02-24': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/10312/{z}/{y}/{x}',\n", " '2022-02-02': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/26083/{z}/{y}/{x}',\n", " '2022-01-12': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/42663/{z}/{y}/{x}',\n", " '2021-12-21': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/26120/{z}/{y}/{x}',\n", " '2021-11-30': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/48624/{z}/{y}/{x}',\n", " '2021-11-03': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/42403/{z}/{y}/{x}',\n", " '2021-10-13': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/16749/{z}/{y}/{x}',\n", " '2021-09-22': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/51313/{z}/{y}/{x}',\n", " '2021-09-01': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/47568/{z}/{y}/{x}',\n", " '2021-08-11': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/51423/{z}/{y}/{x}',\n", " '2021-07-21': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/8432/{z}/{y}/{x}',\n", " '2021-06-30': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/13534/{z}/{y}/{x}',\n", " '2021-06-09': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/48376/{z}/{y}/{x}',\n", " '2021-05-19': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/15423/{z}/{y}/{x}',\n", " '2021-04-28': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/27659/{z}/{y}/{x}',\n", " '2021-04-08': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/6863/{z}/{y}/{x}',\n", " '2021-03-17': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/5359/{z}/{y}/{x}',\n", " '2021-02-24': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/9812/{z}/{y}/{x}',\n", " '2021-01-13': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/1049/{z}/{y}/{x}',\n", " '2020-12-16': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/29260/{z}/{y}/{x}',\n", " '2020-11-18': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/20753/{z}/{y}/{x}',\n", " '2020-10-14': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/119/{z}/{y}/{x}',\n", " '2020-09-23': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/19187/{z}/{y}/{x}',\n", " '2020-09-02': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/9181/{z}/{y}/{x}',\n", " '2020-08-12': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/6049/{z}/{y}/{x}',\n", " '2020-07-22': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/9549/{z}/{y}/{x}',\n", " '2020-07-01': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/18289/{z}/{y}/{x}',\n", " '2020-06-10': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/11135/{z}/{y}/{x}',\n", " '2020-05-20': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/32645/{z}/{y}/{x}',\n", " '2020-04-29': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/15045/{z}/{y}/{x}',\n", " '2020-04-08': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/26751/{z}/{y}/{x}',\n", " '2020-03-23': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/16062/{z}/{y}/{x}',\n", " '2020-02-20': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/8495/{z}/{y}/{x}',\n", " '2020-01-30': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/21485/{z}/{y}/{x}',\n", " '2020-01-08': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/23001/{z}/{y}/{x}',\n", " '2019-12-12': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/4756/{z}/{y}/{x}',\n", " '2019-10-30': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/11060/{z}/{y}/{x}',\n", " '2019-10-09': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/11351/{z}/{y}/{x}',\n", " '2019-09-18': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/9892/{z}/{y}/{x}',\n", " '2019-08-28': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/30442/{z}/{y}/{x}',\n", " '2019-08-07': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/17216/{z}/{y}/{x}',\n", " '2019-07-17': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/16681/{z}/{y}/{x}',\n", " '2019-06-26': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/645/{z}/{y}/{x}',\n", " '2019-06-05': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/12576/{z}/{y}/{x}',\n", " '2019-05-15': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/9598/{z}/{y}/{x}',\n", " '2019-04-24': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/18063/{z}/{y}/{x}',\n", " '2019-04-03': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/18691/{z}/{y}/{x}',\n", " '2019-03-13': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/4383/{z}/{y}/{x}',\n", " '2019-02-21': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/17677/{z}/{y}/{x}',\n", " '2019-01-31': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/25944/{z}/{y}/{x}',\n", " '2019-01-09': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/6036/{z}/{y}/{x}',\n", " '2018-12-14': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/23448/{z}/{y}/{x}',\n", " '2018-11-29': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/239/{z}/{y}/{x}',\n", " '2018-11-07': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/3201/{z}/{y}/{x}',\n", " '2018-10-17': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/18820/{z}/{y}/{x}',\n", " '2018-09-26': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/14426/{z}/{y}/{x}',\n", " '2018-09-06': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/2168/{z}/{y}/{x}',\n", " '2018-08-15': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/1858/{z}/{y}/{x}',\n", " '2018-07-25': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/14829/{z}/{y}/{x}',\n", " '2018-06-27': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/11334/{z}/{y}/{x}',\n", " '2018-06-06': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/8249/{z}/{y}/{x}',\n", " '2018-05-16': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/32337/{z}/{y}/{x}',\n", " '2018-04-25': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/1296/{z}/{y}/{x}',\n", " '2018-04-11': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/20399/{z}/{y}/{x}',\n", " '2018-03-28': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/7072/{z}/{y}/{x}',\n", " '2018-03-14': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/8255/{z}/{y}/{x}',\n", " '2018-02-23': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/13067/{z}/{y}/{x}',\n", " '2018-01-31': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/10768/{z}/{y}/{x}',\n", " '2018-01-18': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/13045/{z}/{y}/{x}',\n", " '2018-01-08': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/13161/{z}/{y}/{x}',\n", " '2017-11-16': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/25521/{z}/{y}/{x}',\n", " '2017-10-25': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/23264/{z}/{y}/{x}',\n", " '2017-10-04': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/15212/{z}/{y}/{x}',\n", " '2017-09-13': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/18358/{z}/{y}/{x}',\n", " '2017-08-30': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/25379/{z}/{y}/{x}',\n", " '2017-08-10': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/14035/{z}/{y}/{x}',\n", " '2017-07-14': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/3319/{z}/{y}/{x}',\n", " '2017-06-27': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/4073/{z}/{y}/{x}',\n", " '2017-06-14': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/14765/{z}/{y}/{x}',\n", " '2017-05-31': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/14342/{z}/{y}/{x}',\n", " '2017-05-17': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/20365/{z}/{y}/{x}',\n", " '2017-05-03': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/784/{z}/{y}/{x}',\n", " '2017-04-19': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/1052/{z}/{y}/{x}',\n", " '2017-03-29': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/5205/{z}/{y}/{x}',\n", " '2017-03-15': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/29387/{z}/{y}/{x}',\n", " '2017-02-27': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/31026/{z}/{y}/{x}',\n", " '2017-02-08': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/27946/{z}/{y}/{x}',\n", " '2017-01-25': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/9486/{z}/{y}/{x}',\n", " '2017-01-11': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/577/{z}/{y}/{x}',\n", " '2016-12-20': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/18966/{z}/{y}/{x}',\n", " '2016-12-07': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/6678/{z}/{y}/{x}',\n", " '2016-11-16': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/21750/{z}/{y}/{x}',\n", " '2016-10-25': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/4222/{z}/{y}/{x}',\n", " '2016-10-12': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/13770/{z}/{y}/{x}',\n", " '2016-09-14': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/6984/{z}/{y}/{x}',\n", " '2016-08-31': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/9175/{z}/{y}/{x}',\n", " '2016-08-11': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/23601/{z}/{y}/{x}',\n", " '2016-07-20': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/5097/{z}/{y}/{x}',\n", " '2016-07-06': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/13240/{z}/{y}/{x}',\n", " '2016-06-13': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/11509/{z}/{y}/{x}',\n", " '2016-05-11': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/8551/{z}/{y}/{x}',\n", " '2016-04-28': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/5769/{z}/{y}/{x}',\n", " '2016-04-20': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/388/{z}/{y}/{x}',\n", " '2016-03-16': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/19085/{z}/{y}/{x}',\n", " '2016-03-02': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/20443/{z}/{y}/{x}',\n", " '2016-02-17': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/11262/{z}/{y}/{x}',\n", " '2016-02-04': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/6354/{z}/{y}/{x}',\n", " '2016-01-13': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/3515/{z}/{y}/{x}',\n", " '2015-12-16': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/28163/{z}/{y}/{x}',\n", " '2015-11-18': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/8781/{z}/{y}/{x}',\n", " '2015-10-28': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/11092/{z}/{y}/{x}',\n", " '2015-10-14': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/10850/{z}/{y}/{x}',\n", " '2015-09-30': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/3630/{z}/{y}/{x}',\n", " '2015-09-16': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/1431/{z}/{y}/{x}',\n", " '2015-09-02': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/30584/{z}/{y}/{x}',\n", " '2015-08-19': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/28219/{z}/{y}/{x}',\n", " '2015-07-08': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/24007/{z}/{y}/{x}',\n", " '2015-06-24': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/11952/{z}/{y}/{x}',\n", " '2015-05-13': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/19930/{z}/{y}/{x}',\n", " '2015-04-30': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/23880/{z}/{y}/{x}',\n", " '2015-04-15': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/9203/{z}/{y}/{x}',\n", " '2015-03-25': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/2730/{z}/{y}/{x}',\n", " '2015-03-18': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/15084/{z}/{y}/{x}',\n", " '2015-02-18': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/10443/{z}/{y}/{x}',\n", " '2015-01-21': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/20222/{z}/{y}/{x}',\n", " '2014-12-30': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/5844/{z}/{y}/{x}',\n", " '2014-12-18': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/14720/{z}/{y}/{x}',\n", " '2014-12-03': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/23383/{z}/{y}/{x}',\n", " '2014-11-12': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/30195/{z}/{y}/{x}',\n", " '2014-10-29': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/11019/{z}/{y}/{x}',\n", " '2014-10-01': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/22692/{z}/{y}/{x}',\n", " '2014-09-17': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/25586/{z}/{y}/{x}',\n", " '2014-07-30': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/5232/{z}/{y}/{x}',\n", " '2014-07-02': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/3026/{z}/{y}/{x}',\n", " '2014-06-25': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/11033/{z}/{y}/{x}',\n", " '2014-06-11': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/31144/{z}/{y}/{x}',\n", " '2014-05-14': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/16513/{z}/{y}/{x}',\n", " '2014-04-30': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/19819/{z}/{y}/{x}',\n", " '2014-03-26': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/4230/{z}/{y}/{x}',\n", " '2014-02-20': 'https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/GoogleMapsCompatible/MapServer/tile/10/{z}/{y}/{x}'}" ] }, "execution_count": 264, "metadata": {}, "output_type": "execute_result" } ], "source": [ "map_dict" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "6a87c6af055444be8d9f304293e5287f", "version_major": 2, "version_minor": 0 }, "text/plain": [ "GridspecLayout(children=(Output(layout=Layout(grid_area='widget001')), Output(layout=Layout(grid_area='widget0…" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import leafmap.leafmap as leafmap\n", "\n", "layers = [\"Esri.WorldTopoMap\", \"OpenTopoMap\"]\n", "leafmap.linked_maps(rows=1, cols=2, height=\"400px\", layers=layers)" ] } ], "metadata": { "kernelspec": { "display_name": "zeel_py310", "language": "python", "name": "python3" }, "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.10.12" } }, "nbformat": 4, "nbformat_minor": 2 }