{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Quciklooks mapping\n", "\n", "- Choose an area for checking available pleiades imagary. \n", "- Search the area via catalog search.\n", "- Download quicklooks for images that cover the selected area.\n", "- Visualize the results via map_quicklooks function." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import up42" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "2020-09-11 11:18:17,245 - up42.auth - INFO - Authentication with UP42 successful!\n" ] } ], "source": [ "up42.authenticate(project_id=\"1234\", project_api_key=\"ABCD\")\n", "catalog = up42.initialize_catalog()" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "aoi = up42.read_vector_file(\"dakar.geojson\", as_dataframe=False)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "2020-09-11 11:18:23,881 - up42.catalog - INFO - Searching catalog with search_parameters: {'datetime': '2018-01-01T00:00:00Z/2020-12-31T00:00:00Z', 'intersects': {'type': 'Polygon', 'coordinates': (((-17.529857, 14.741202), (-17.528703, 14.748847), (-17.52686, 14.751031), (-17.522855, 14.748707), (-17.519673, 14.748374), (-17.518791, 14.750683), (-17.517314, 14.750686), (-17.516981, 14.751799), (-17.510855, 14.750763), (-17.509799, 14.751426), (-17.509903, 14.753229), (-17.508237, 14.754202), (-17.503933, 14.754674), (-17.503399, 14.756024), (-17.496004, 14.755294), (-17.492911, 14.756651), (-17.491767, 14.758595), (-17.489119, 14.758018), (-17.487241, 14.76154), (-17.485135, 14.761315), (-17.483361, 14.764372), (-17.48083, 14.76595), (-17.478857, 14.765801), (-17.473266, 14.762048), (-17.461401, 14.762555), (-17.440347, 14.766725), (-17.429603, 14.77182), (-17.412524, 14.777208), (-17.41046, 14.77862), (-17.343999, 14.804732), (-17.343829, 14.805709), (-17.310555, 14.818605), (-17.255434, 14.845886), (-17.254439, 14.845243), (-17.248441, 14.832004), (-17.240612, 14.830767), (-17.239068, 14.829787), (-17.235797, 14.826557), (-17.232959, 14.819383), (-17.226866, 14.810643), (-17.219122, 14.808075), (-17.216676, 14.806354), (-17.214365, 14.807102), (-17.207416, 14.824354), (-17.200816, 14.830315), (-17.196088, 14.831584), (-17.190219, 14.830581), (-17.178819, 14.834769), (-17.175198, 14.834709), (-17.171926, 14.833118), (-17.166685, 14.839382), (-17.158144, 14.843267), (-17.154579, 14.843201), (-17.148855, 14.840737), (-17.141668, 14.840113), (-17.138938, 14.838773), (-17.134266, 14.833396), (-17.132867, 14.827086), (-17.133597, 14.820229), (-17.137929, 14.810701), (-17.143664, 14.805293), (-17.153636, 14.801379), (-17.149757, 14.796664), (-17.148465, 14.791971), (-17.148735, 14.788806), (-17.153869, 14.777451), (-17.159334, 14.772907), (-17.164054, 14.771688), (-17.171164, 14.772886), (-17.177877, 14.777262), (-17.182848, 14.774767), (-17.194034, 14.774889), (-17.200946, 14.772362), (-17.20641, 14.768068), (-17.21\n", "2020-09-11 11:18:24,633 - up42.catalog - INFO - 10 results returned.\n" ] } ], "source": [ "search_parameters = catalog.construct_parameters(geometry=aoi, \n", " start_date=\"2018-01-01\",\n", " end_date=\"2020-12-31\",\n", " sensors=[\"pleiades\"],\n", " max_cloudcover=20,\n", " sortby=\"cloudCoverage\", \n", " limit=10)\n", "search_results = catalog.search(search_parameters=search_parameters)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "2020-09-11 11:18:26,211 - up42.catalog - INFO - Getting quicklooks from provider oneatlas for image_ids: ['2a581680-17e4-4a61-8aa9-9e47e1bf36bb', 'e02b9c94-12ab-4c8a-851d-72716f92fc66', 'c33d3001-5068-4469-bf8e-9b4bc4429ac8', '5a0ef1b8-47d3-4185-adb7-cfd1f1919ab4', '4e635fe1-fe59-46ca-b4ec-a89be5d760f2', 'b23f1aee-2f9d-42f7-9289-5d1869ddb419', 'f8c03432-cec1-41b7-a203-4d871a03290f', 'eb0247e6-caf3-437d-9d58-593c8e2a08f8', '16e18e15-c941-4aae-97cd-d67b18dc9f6e']\n", "2020-09-11 11:18:26,213 - up42.catalog - INFO - Download directory: /Users/nikoo.ekhtiari/Documents/up42-py/examples/project_8da6a795-d3ee-4175-a202-932a52e385e4/catalog\n", "100%|██████████| 9/9 [00:05<00:00, 1.66it/s]\n" ] }, { "data": { "text/plain": [ "['/Users/nikoo.ekhtiari/Documents/up42-py/examples/project_8da6a795-d3ee-4175-a202-932a52e385e4/catalog/quicklook_2a581680-17e4-4a61-8aa9-9e47e1bf36bb.jpg',\n", " '/Users/nikoo.ekhtiari/Documents/up42-py/examples/project_8da6a795-d3ee-4175-a202-932a52e385e4/catalog/quicklook_e02b9c94-12ab-4c8a-851d-72716f92fc66.jpg',\n", " '/Users/nikoo.ekhtiari/Documents/up42-py/examples/project_8da6a795-d3ee-4175-a202-932a52e385e4/catalog/quicklook_c33d3001-5068-4469-bf8e-9b4bc4429ac8.jpg',\n", " '/Users/nikoo.ekhtiari/Documents/up42-py/examples/project_8da6a795-d3ee-4175-a202-932a52e385e4/catalog/quicklook_5a0ef1b8-47d3-4185-adb7-cfd1f1919ab4.jpg',\n", " '/Users/nikoo.ekhtiari/Documents/up42-py/examples/project_8da6a795-d3ee-4175-a202-932a52e385e4/catalog/quicklook_4e635fe1-fe59-46ca-b4ec-a89be5d760f2.jpg',\n", " '/Users/nikoo.ekhtiari/Documents/up42-py/examples/project_8da6a795-d3ee-4175-a202-932a52e385e4/catalog/quicklook_b23f1aee-2f9d-42f7-9289-5d1869ddb419.jpg',\n", " '/Users/nikoo.ekhtiari/Documents/up42-py/examples/project_8da6a795-d3ee-4175-a202-932a52e385e4/catalog/quicklook_f8c03432-cec1-41b7-a203-4d871a03290f.jpg',\n", " '/Users/nikoo.ekhtiari/Documents/up42-py/examples/project_8da6a795-d3ee-4175-a202-932a52e385e4/catalog/quicklook_eb0247e6-caf3-437d-9d58-593c8e2a08f8.jpg',\n", " '/Users/nikoo.ekhtiari/Documents/up42-py/examples/project_8da6a795-d3ee-4175-a202-932a52e385e4/catalog/quicklook_16e18e15-c941-4aae-97cd-d67b18dc9f6e.jpg']" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "catalog.download_quicklooks(image_ids=search_results.id.to_list(), \n", " sensor=\"pleiades\")" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "a = catalog.map_quicklooks(scenes=search_results, aoi=aoi, save_html=\".\")" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
Make this Notebook Trusted to load map: File -> Trust Notebook
" ], "text/plain": [ "" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "up42-pyapi-dev", "language": "python", "name": "up42-pyapi-dev" }, "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.7.7" } }, "nbformat": 4, "nbformat_minor": 4 }