{ "cells": [ { "cell_type": "markdown", "id": "3af8de29-2783-43a8-bdd7-07aab82c1347", "metadata": {}, "source": [ "# MAAP AWS Access in R\n", "\n", "Authors: Sheyenne Kirkland (UAH), Harshini Girish (UAH), Alex Mandel (Development Seed), Chuck Daniels (Development Seed), Henry Rodman (Development Seed), Zac Deziel (Development Seed)\n", "\n", "Updated: July 17, 2025\n", "\n", "Description: In this tutorial, we walk through accessing MAAP data in S3 buckets (maap-ops-workspace and nasa-maap-data-store) in R. We'll also demonstrate opening a raster, vector, and text file." ] }, { "cell_type": "markdown", "id": "1d4ed65b-55ac-4d7e-ac87-12acb4564587", "metadata": {}, "source": [ "## Run This Notebook\n", "\n", "To access and run this tutorial within MAAP's Algorithm Development Environment (ADE), please refer to the [\"Getting started with the MAAP\"](https://docs.maap-project.org/en/latest/getting_started/getting_started.html) section of our documentation.\n", "\n", "Disclaimer: it is highly recommended to run a tutorial within MAAP's ADE, which already includes packages specific to MAAP, such as maap-py. Running the tutorial outside of the MAAP ADE may lead to errors. Users should work within an \"R/Python\" workspace." ] }, { "cell_type": "markdown", "id": "ba419856-dd5f-4a44-80cc-3acd1ab60f22", "metadata": {}, "source": [ "## Additional Resources\n", "- [paws s3.R example](https://github.com/paws-r/paws/blob/main/examples/s3.R)\n", " - A file in the `paws` Github with examples on how to use `paws` in R.\n", "- [earthdata: Python-R Handoff](https://nasa-openscapes.github.io/earthdata-cloud-cookbook/in-development/earthdata-python-r-handoff.html)\n", " - A notebook in NASA Openscapes that also shows users how to access data from S3 links." ] }, { "cell_type": "markdown", "id": "a42fcbb4-cd05-472f-856f-bc3d204e7c85", "metadata": {}, "source": [ "## Install/Load Packages\n", "\n", "Let's install and load packages needed for this tutorial." ] }, { "cell_type": "code", "execution_count": 1, "id": "0ddbc754-0db2-4780-a370-776f5aa81bd7", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Updating HTML index of packages in '.Library'\n", "\n", "Making 'packages.html' ...\n", " done\n", "\n", "Linking to GEOS 3.12.1, GDAL 3.8.5, PROJ 9.4.0; sf_use_s2() is TRUE\n", "\n" ] } ], "source": [ "install.packages(\"rstac\")\n", "\n", "library(\"rstac\")\n", "library(\"sf\")\n", "library(\"reticulate\")\n", "library(\"paws\")" ] }, { "cell_type": "markdown", "id": "24b6b8c5-b331-470f-977e-e57c526109d2", "metadata": {}, "source": [ "## Set up Access\n", "\n", "While we don't need the code to get temporary credentials (the `paws` package handles this for us), the default region needs to be set to \"us-west-2\"." ] }, { "cell_type": "code", "execution_count": 2, "id": "27aa3e83-5337-4ec3-8528-473b8fbf8dc9", "metadata": {}, "outputs": [], "source": [ "s3 <- paws::s3(region = \"us-west-2\")" ] }, { "cell_type": "markdown", "id": "ecc1bb72-7975-4631-93a2-8f9a74b8038b", "metadata": {}, "source": [ "Let's also set up `maap-py` since this will be used to get our username." ] }, { "cell_type": "code", "execution_count": 3, "id": "4892b982-9ab3-4b4d-87b3-e31443168076", "metadata": {}, "outputs": [], "source": [ "maap_py <- import(\"maap.maap\")\n", "maap <- maap_py$MAAP()" ] }, { "cell_type": "markdown", "id": "88b2a80d-0e23-4acf-9660-8ef5651974a9", "metadata": {}, "source": [ "## Explore Buckets\n", "\n", "Now that we have access to MAAP buckets, we can get data available in AWS. Users will potentially use two buckets:\n", "\n", "1. maap-ops-workspace\n", "2. nasa-maap-data-store\n", "\n", "\"maap-ops-workspace\" holds user shared and private buckets, while \"nasa-maap-data-store\" holds our datasets that are ingested into the MAAP STAC.\n", "\n", "### User Shared Buckets\n", "\n", "To access objects stored within a shared bucket, run the following cell. Update the prefix path following `shared/` as necessary." ] }, { "cell_type": "code", "execution_count": 4, "id": "d0234692-65ad-4518-b829-079f70cb3105", "metadata": {}, "outputs": [], "source": [ "bucket <- \"maap-ops-workspace\"" ] }, { "cell_type": "code", "execution_count": 5, "id": "f8c1f274-de33-4d16-b1cb-efd2b331a27f", "metadata": {}, "outputs": [], "source": [ "s3_response <- s3$list_objects_v2(Bucket = bucket, Prefix = \"shared/alexdevseed/cog-tests/\")" ] }, { "cell_type": "markdown", "id": "c5100a02-8a79-40a4-881b-660a721b3e06", "metadata": {}, "source": [ "To grab the identifier for each object within your bucket, run the following cell." ] }, { "cell_type": "code", "execution_count": 6, "id": "7c4a0cab-e51a-4c81-9565-c51e52861ddd", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
  1. 'shared/alexdevseed/cog-tests/Landsat8_275_comp_cog_2015-2020_dps.tif'
  2. 'shared/alexdevseed/cog-tests/boreal_agb_20211015_0249_cog-ovr3.tif'
  3. 'shared/alexdevseed/cog-tests/boreal_agb_20211015_0249_cog-ovr4.tif'
  4. 'shared/alexdevseed/cog-tests/boreal_agb_20211015_0249_cog-ovr6.tif'
  5. 'shared/alexdevseed/cog-tests/boreal_agb_20211015_0249_cog-ovr8.tif'
  6. 'shared/alexdevseed/cog-tests/boreal_agb_20211015_0249_cog-s3o8.tif'
  7. 'shared/alexdevseed/cog-tests/boreal_agb_20211015_0249_cog.tif'
\n" ], "text/latex": [ "\\begin{enumerate*}\n", "\\item 'shared/alexdevseed/cog-tests/Landsat8\\_275\\_comp\\_cog\\_2015-2020\\_dps.tif'\n", "\\item 'shared/alexdevseed/cog-tests/boreal\\_agb\\_20211015\\_0249\\_cog-ovr3.tif'\n", "\\item 'shared/alexdevseed/cog-tests/boreal\\_agb\\_20211015\\_0249\\_cog-ovr4.tif'\n", "\\item 'shared/alexdevseed/cog-tests/boreal\\_agb\\_20211015\\_0249\\_cog-ovr6.tif'\n", "\\item 'shared/alexdevseed/cog-tests/boreal\\_agb\\_20211015\\_0249\\_cog-ovr8.tif'\n", "\\item 'shared/alexdevseed/cog-tests/boreal\\_agb\\_20211015\\_0249\\_cog-s3o8.tif'\n", "\\item 'shared/alexdevseed/cog-tests/boreal\\_agb\\_20211015\\_0249\\_cog.tif'\n", "\\end{enumerate*}\n" ], "text/markdown": [ "1. 'shared/alexdevseed/cog-tests/Landsat8_275_comp_cog_2015-2020_dps.tif'\n", "2. 'shared/alexdevseed/cog-tests/boreal_agb_20211015_0249_cog-ovr3.tif'\n", "3. 'shared/alexdevseed/cog-tests/boreal_agb_20211015_0249_cog-ovr4.tif'\n", "4. 'shared/alexdevseed/cog-tests/boreal_agb_20211015_0249_cog-ovr6.tif'\n", "5. 'shared/alexdevseed/cog-tests/boreal_agb_20211015_0249_cog-ovr8.tif'\n", "6. 'shared/alexdevseed/cog-tests/boreal_agb_20211015_0249_cog-s3o8.tif'\n", "7. 'shared/alexdevseed/cog-tests/boreal_agb_20211015_0249_cog.tif'\n", "\n", "\n" ], "text/plain": [ "[1] \"shared/alexdevseed/cog-tests/Landsat8_275_comp_cog_2015-2020_dps.tif\"\n", "[2] \"shared/alexdevseed/cog-tests/boreal_agb_20211015_0249_cog-ovr3.tif\" \n", "[3] \"shared/alexdevseed/cog-tests/boreal_agb_20211015_0249_cog-ovr4.tif\" \n", "[4] \"shared/alexdevseed/cog-tests/boreal_agb_20211015_0249_cog-ovr6.tif\" \n", "[5] \"shared/alexdevseed/cog-tests/boreal_agb_20211015_0249_cog-ovr8.tif\" \n", "[6] \"shared/alexdevseed/cog-tests/boreal_agb_20211015_0249_cog-s3o8.tif\" \n", "[7] \"shared/alexdevseed/cog-tests/boreal_agb_20211015_0249_cog.tif\" " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "shared_objects <- sapply(s3_response$Contents, function(s3_object) s3_object$Key)\n", "shared_objects <- shared_objects[grep(\"\\\\.tif$\", shared_objects)] #list tiff files\n", "shared_objects" ] }, { "cell_type": "markdown", "id": "a7ff3d54-314f-4dbc-aeca-7b30db69b8d1", "metadata": {}, "source": [ "### User Private Buckets" ] }, { "cell_type": "markdown", "id": "2eda6c2d-e3da-4682-b015-c32d02a73b69", "metadata": {}, "source": [ "To access data within your private bucket, we'll use code similar to above but update the prefix. Before updating our prefix, we'll get our username." ] }, { "cell_type": "code", "execution_count": 7, "id": "b93a8e4b-0205-4070-80cb-6863d38c56a5", "metadata": {}, "outputs": [ { "data": { "text/html": [ "'smk0033'" ], "text/latex": [ "'smk0033'" ], "text/markdown": [ "'smk0033'" ], "text/plain": [ "[1] \"smk0033\"" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "username <- maap$profile$account_info()$username\n", "username" ] }, { "cell_type": "markdown", "id": "72389621-1847-46f7-806b-36a7a2761005", "metadata": {}, "source": [ "Now we can use the username variable in our prefix. Be sure to update the path as necessary to access the files within your desired bucket." ] }, { "cell_type": "code", "execution_count": 8, "id": "3a816c2f-e7f2-4a0a-8fd5-84d378e60614", "metadata": {}, "outputs": [], "source": [ "s3_response <- s3$list_objects_v2(Bucket = bucket, Prefix = paste(username, \"CONUSbiohex2020\", sep = \"/\"))" ] }, { "cell_type": "code", "execution_count": 9, "id": "a3c6d029-d692-49dd-924b-5715967e021d", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
  1. 'smk0033/CONUSbiohex2020/'
  2. 'smk0033/CONUSbiohex2020/.ipynb_checkpoints/'
  3. 'smk0033/CONUSbiohex2020/CONUSbiohex2020.dbf'
  4. 'smk0033/CONUSbiohex2020/CONUSbiohex2020.prj'
  5. 'smk0033/CONUSbiohex2020/CONUSbiohex2020.sbn'
  6. 'smk0033/CONUSbiohex2020/CONUSbiohex2020.sbx'
  7. 'smk0033/CONUSbiohex2020/CONUSbiohex2020.shp'
  8. 'smk0033/CONUSbiohex2020/CONUSbiohex2020.shx'
  9. 'smk0033/CONUSbiohex2020/biohex.gpkg'
\n" ], "text/latex": [ "\\begin{enumerate*}\n", "\\item 'smk0033/CONUSbiohex2020/'\n", "\\item 'smk0033/CONUSbiohex2020/.ipynb\\_checkpoints/'\n", "\\item 'smk0033/CONUSbiohex2020/CONUSbiohex2020.dbf'\n", "\\item 'smk0033/CONUSbiohex2020/CONUSbiohex2020.prj'\n", "\\item 'smk0033/CONUSbiohex2020/CONUSbiohex2020.sbn'\n", "\\item 'smk0033/CONUSbiohex2020/CONUSbiohex2020.sbx'\n", "\\item 'smk0033/CONUSbiohex2020/CONUSbiohex2020.shp'\n", "\\item 'smk0033/CONUSbiohex2020/CONUSbiohex2020.shx'\n", "\\item 'smk0033/CONUSbiohex2020/biohex.gpkg'\n", "\\end{enumerate*}\n" ], "text/markdown": [ "1. 'smk0033/CONUSbiohex2020/'\n", "2. 'smk0033/CONUSbiohex2020/.ipynb_checkpoints/'\n", "3. 'smk0033/CONUSbiohex2020/CONUSbiohex2020.dbf'\n", "4. 'smk0033/CONUSbiohex2020/CONUSbiohex2020.prj'\n", "5. 'smk0033/CONUSbiohex2020/CONUSbiohex2020.sbn'\n", "6. 'smk0033/CONUSbiohex2020/CONUSbiohex2020.sbx'\n", "7. 'smk0033/CONUSbiohex2020/CONUSbiohex2020.shp'\n", "8. 'smk0033/CONUSbiohex2020/CONUSbiohex2020.shx'\n", "9. 'smk0033/CONUSbiohex2020/biohex.gpkg'\n", "\n", "\n" ], "text/plain": [ "[1] \"smk0033/CONUSbiohex2020/\" \n", "[2] \"smk0033/CONUSbiohex2020/.ipynb_checkpoints/\"\n", "[3] \"smk0033/CONUSbiohex2020/CONUSbiohex2020.dbf\"\n", "[4] \"smk0033/CONUSbiohex2020/CONUSbiohex2020.prj\"\n", "[5] \"smk0033/CONUSbiohex2020/CONUSbiohex2020.sbn\"\n", "[6] \"smk0033/CONUSbiohex2020/CONUSbiohex2020.sbx\"\n", "[7] \"smk0033/CONUSbiohex2020/CONUSbiohex2020.shp\"\n", "[8] \"smk0033/CONUSbiohex2020/CONUSbiohex2020.shx\"\n", "[9] \"smk0033/CONUSbiohex2020/biohex.gpkg\" " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "s3_object_keys <- sapply(s3_response$Contents, function(s3_object) s3_object$Key)\n", "s3_object_keys" ] }, { "cell_type": "markdown", "id": "2579be9c-fbbb-4761-8a5b-c5c66249ee13", "metadata": {}, "source": [ "**Note**: while we do not demonstrate accessing data from a private bucket in the following examples, accessing data in a private bucket works the same as accessing data in a shared bucket - the only difference will be the paths." ] }, { "cell_type": "markdown", "id": "e10c8097-ca16-4ab9-b146-d081d0a24b8e", "metadata": {}, "source": [ "### nasa-maap-data-store Buckets\n", "\n", "To get access to the nasa-maap-data-store bucket, we'll do an `rstac` query to get a path to items we need. Users can then pass that path into the tool needed to open it.\n", "\n", "For this example, we'll use the \"icesat2-boreal\" dataset." ] }, { "cell_type": "code", "execution_count": 10, "id": "45c48433-c8a6-414f-8701-46db6ce36db7", "metadata": {}, "outputs": [], "source": [ "# Define the MAAP STAC endpoint\n", "stac_endpoint <- stac(\"https://stac.maap-project.org/\")" ] }, { "cell_type": "code", "execution_count": 11, "id": "ebc7c910-5ba9-4490-8b47-7f44e19ad8e4", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1m###Items\u001b[22m\n", "- \u001b[1mfeatures\u001b[22m (10 item(s)):\n", " - boreal_agb_202302151676439579_1326\n", " - boreal_agb_202302151676435792_3402\n", " - boreal_agb_202302151676435665_3417\n", " - boreal_agb_202302151676434536_3215\n", " - boreal_agb_202302151676434460_3035\n", " - boreal_agb_202302151676432986_2782\n", " - boreal_agb_202302151676430990_1278\n", " - boreal_agb_202302151676430794_26340\n", " - boreal_agb_202302151676430633_40664\n", " - boreal_agb_202302151676430594_0611\n", "- \u001b[1massets:\u001b[22m csv, tif\n", "- \u001b[1mitem's fields:\u001b[22m \n", "assets, bbox, collection, geometry, id, links, properties, stac_extensions, stac_version, type\n" ] } ], "source": [ "# Define the collection\n", "collection <- \"icesat2-boreal\"\n", "\n", "# Fetch items\n", "stac_url <- stac_endpoint[[2]]\n", "\n", "stac_items <- stac(stac_url) |>\n", " stac_search(collections = collection) |>\n", " get_request()\n", "\n", "print(stac_items)" ] }, { "cell_type": "markdown", "id": "578038a8-abf8-428d-b6fa-acdfc04bf85f", "metadata": {}, "source": [ "Now that we have defined our collection and retrieved some items, let's get the S3 URL associated with the first item." ] }, { "cell_type": "code", "execution_count": 12, "id": "d59b1234-991b-4cbf-a0cf-972524754830", "metadata": {}, "outputs": [ { "data": { "text/html": [ "'s3://nasa-maap-data-store/file-staging/nasa-map/icesat2-boreal/boreal_agb_202302151676439579_1326_train_data.csv'" ], "text/latex": [ "'s3://nasa-maap-data-store/file-staging/nasa-map/icesat2-boreal/boreal\\_agb\\_202302151676439579\\_1326\\_train\\_data.csv'" ], "text/markdown": [ "'s3://nasa-maap-data-store/file-staging/nasa-map/icesat2-boreal/boreal_agb_202302151676439579_1326_train_data.csv'" ], "text/plain": [ "[1] \"s3://nasa-maap-data-store/file-staging/nasa-map/icesat2-boreal/boreal_agb_202302151676439579_1326_train_data.csv\"" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "item = stac_items$features[[1]]$assets[[1]]$href\n", "item" ] }, { "cell_type": "markdown", "id": "dd608f3d-8bb4-4e39-a278-159a16745f4d", "metadata": {}, "source": [ "## Accessing an Item" ] }, { "cell_type": "markdown", "id": "d3084a40-3c07-49ff-ba1b-e365ac608e68", "metadata": {}, "source": [ "### TIFF" ] }, { "cell_type": "markdown", "id": "0ed8ae4c-30e8-45a8-8386-d70f15b47349", "metadata": {}, "source": [ "For this example, we'll access a TIFF file from the shared bucket query using the `sf` package. To read an item from S3 directly, `/vsis3/` needs to precede the path. To do this with an object from our shared bucket query, we'll use `paste` to combine `vsis3` with our bucket and our key. " ] }, { "cell_type": "code", "execution_count": 13, "id": "09872ef4-5eba-4a95-ba0c-abb3d88f7c4a", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[1] \"/vsis3/maap-ops-workspace/shared/alexdevseed/cog-tests/boreal_agb_20211015_0249_cog.tif\"\n" ] } ], "source": [ "tiff_path <- paste(\"/vsis3\", bucket, shared_objects[7], sep = \"/\")\n", "print(tiff_path)" ] }, { "cell_type": "markdown", "id": "2afcca76-5b79-4c16-9705-cd286a3d2982", "metadata": {}, "source": [ "As a best practice, drivers should be used for speed. There are specific drivers for different data formats. To list drivers for raster data, run the following cell. For vector data, update \"raster\" to \"vector\". For a full list, remove \"head\" or see the [GDAL Documentation site](https://gdal.org/en/latest/index.html). " ] }, { "cell_type": "code", "execution_count": 14, "id": "bffabea8-89ec-4a91-9f32-5e5c6eccf49b", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\t\n", "\t\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\n", "
A data.frame: 6 × 7
namelong_namewritecopyis_rasteris_vectorvsi
<chr><chr><lgl><lgl><lgl><lgl><lgl>
VRTVRT Virtual Raster TRUE TRUETRUEFALSE TRUE
DERIVEDDERIVEDDerived datasets using VRT pixel functionsFALSEFALSETRUEFALSEFALSE
GTiffGTiff GeoTIFF TRUE TRUETRUEFALSE TRUE
COGCOG Cloud optimized GeoTIFF generator FALSE TRUETRUEFALSE TRUE
NITFNITF National Imagery Transmission Format TRUE TRUETRUEFALSE TRUE
RPFTOCRPFTOC Raster Product Format TOC format FALSEFALSETRUEFALSE TRUE
\n" ], "text/latex": [ "A data.frame: 6 × 7\n", "\\begin{tabular}{r|lllllll}\n", " & name & long\\_name & write & copy & is\\_raster & is\\_vector & vsi\\\\\n", " & & & & & & & \\\\\n", "\\hline\n", "\tVRT & VRT & Virtual Raster & TRUE & TRUE & TRUE & FALSE & TRUE\\\\\n", "\tDERIVED & DERIVED & Derived datasets using VRT pixel functions & FALSE & FALSE & TRUE & FALSE & FALSE\\\\\n", "\tGTiff & GTiff & GeoTIFF & TRUE & TRUE & TRUE & FALSE & TRUE\\\\\n", "\tCOG & COG & Cloud optimized GeoTIFF generator & FALSE & TRUE & TRUE & FALSE & TRUE\\\\\n", "\tNITF & NITF & National Imagery Transmission Format & TRUE & TRUE & TRUE & FALSE & TRUE\\\\\n", "\tRPFTOC & RPFTOC & Raster Product Format TOC format & FALSE & FALSE & TRUE & FALSE & TRUE\\\\\n", "\\end{tabular}\n" ], "text/markdown": [ "\n", "A data.frame: 6 × 7\n", "\n", "| | name <chr> | long_name <chr> | write <lgl> | copy <lgl> | is_raster <lgl> | is_vector <lgl> | vsi <lgl> |\n", "|---|---|---|---|---|---|---|---|\n", "| VRT | VRT | Virtual Raster | TRUE | TRUE | TRUE | FALSE | TRUE |\n", "| DERIVED | DERIVED | Derived datasets using VRT pixel functions | FALSE | FALSE | TRUE | FALSE | FALSE |\n", "| GTiff | GTiff | GeoTIFF | TRUE | TRUE | TRUE | FALSE | TRUE |\n", "| COG | COG | Cloud optimized GeoTIFF generator | FALSE | TRUE | TRUE | FALSE | TRUE |\n", "| NITF | NITF | National Imagery Transmission Format | TRUE | TRUE | TRUE | FALSE | TRUE |\n", "| RPFTOC | RPFTOC | Raster Product Format TOC format | FALSE | FALSE | TRUE | FALSE | TRUE |\n", "\n" ], "text/plain": [ " name long_name write copy \n", "VRT VRT Virtual Raster TRUE TRUE\n", "DERIVED DERIVED Derived datasets using VRT pixel functions FALSE FALSE\n", "GTiff GTiff GeoTIFF TRUE TRUE\n", "COG COG Cloud optimized GeoTIFF generator FALSE TRUE\n", "NITF NITF National Imagery Transmission Format TRUE TRUE\n", "RPFTOC RPFTOC Raster Product Format TOC format FALSE FALSE\n", " is_raster is_vector vsi \n", "VRT TRUE FALSE TRUE\n", "DERIVED TRUE FALSE FALSE\n", "GTiff TRUE FALSE TRUE\n", "COG TRUE FALSE TRUE\n", "NITF TRUE FALSE TRUE\n", "RPFTOC TRUE FALSE TRUE" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "head(st_drivers(what = \"raster\"))" ] }, { "cell_type": "markdown", "id": "45ee7896-f0e9-4294-bf94-51c431d2d96d", "metadata": {}, "source": [ "Now lets read our data." ] }, { "cell_type": "code", "execution_count": 15, "id": "306d1667-74d2-4ff4-a1ed-7923cc65ffcc", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Driver: GTiff/GeoTIFF\n", "Files: /vsis3/maap-ops-workspace/shared/alexdevseed/cog-tests/boreal_agb_20211015_0249_cog.tif\n", "Size is 3000, 3000\n", "Coordinate System is:\n", "PROJCRS[\"unknown\",\n", " BASEGEOGCRS[\"NAD83\",\n", " DATUM[\"North American Datum 1983\",\n", " ELLIPSOID[\"GRS 1980\",6378137,298.257222101004,\n", " LENGTHUNIT[\"metre\",1]]],\n", " PRIMEM[\"Greenwich\",0,\n", " ANGLEUNIT[\"degree\",0.0174532925199433]],\n", " ID[\"EPSG\",4269]],\n", " CONVERSION[\"Albers Equal Area\",\n", " METHOD[\"Albers Equal Area\",\n", " ID[\"EPSG\",9822]],\n", " PARAMETER[\"Latitude of false origin\",40,\n", " ANGLEUNIT[\"degree\",0.0174532925199433],\n", " ID[\"EPSG\",8821]],\n", " PARAMETER[\"Longitude of false origin\",180,\n", " ANGLEUNIT[\"degree\",0.0174532925199433],\n", " ID[\"EPSG\",8822]],\n", " PARAMETER[\"Latitude of 1st standard parallel\",50,\n", " ANGLEUNIT[\"degree\",0.0174532925199433],\n", " ID[\"EPSG\",8823]],\n", " PARAMETER[\"Latitude of 2nd standard parallel\",70,\n", " ANGLEUNIT[\"degree\",0.0174532925199433],\n", " ID[\"EPSG\",8824]],\n", " PARAMETER[\"Easting at false origin\",0,\n", " LENGTHUNIT[\"metre\",1],\n", " ID[\"EPSG\",8826]],\n", " PARAMETER[\"Northing at false origin\",0,\n", " LENGTHUNIT[\"metre\",1],\n", " ID[\"EPSG\",8827]]],\n", " CS[Cartesian,2],\n", " AXIS[\"easting\",east,\n", " ORDER[1],\n", " LENGTHUNIT[\"metre\",1,\n", " ID[\"EPSG\",9001]]],\n", " AXIS[\"northing\",north,\n", " ORDER[2],\n", " LENGTHUNIT[\"metre\",1,\n", " ID[\"EPSG\",9001]]]]\n", "Data axis to CRS axis mapping: 1,2\n", "Origin = (-1791478.000000000000000,7983304.000000000000000)\n", "Pixel Size = (30.000000000000000,-30.000000000000000)\n", "Metadata:\n", " AREA_OR_POINT=Area\n", "Image Structure Metadata:\n", " INTERLEAVE=PIXEL\n", " LAYOUT=COG\n", "Corner Coordinates:\n", "Upper Left (-1791478.000, 7983304.000) ( 16d51'54.04\"E, 68d27' 4.96\"N)\n", "Lower Left (-1791478.000, 7893304.000) ( 18d20'45.02\"E, 69d 3'10.36\"N)\n", "Upper Right (-1701478.000, 7983304.000) ( 15d 9'32.11\"E, 68d58' 7.91\"N)\n", "Lower Right (-1701478.000, 7893304.000) ( 16d37'42.72\"E, 69d35' 5.45\"N)\n", "Center (-1746478.000, 7938304.000) ( 16d44'58.48\"E, 69d 1' 3.32\"N)\n", "Band 1 Block=512x512 Type=Float32, ColorInterp=Gray\n", " Min=4.259 Max=642.621 \n", " Minimum=4.259, Maximum=642.621, Mean=54.163, StdDev=41.175\n", " NoData Value=-3.4e+38\n", " Overviews: 1500x1500, 750x750, 375x375\n", " Metadata:\n", " STATISTICS_MAXIMUM=642.62117058029\n", " STATISTICS_MEAN=54.162682191363\n", " STATISTICS_MINIMUM=4.258820251973\n", " STATISTICS_STDDEV=41.175124882695\n", "Band 2 Block=512x512 Type=Float32, ColorInterp=Undefined\n", " Min=0.630 Max=334.889 \n", " Minimum=0.630, Maximum=334.889, Mean=10.525, StdDev=10.752\n", " NoData Value=-3.4e+38\n", " Overviews: 1500x1500, 750x750, 375x375\n", " Metadata:\n", " STATISTICS_MAXIMUM=334.88861093713\n", " STATISTICS_MEAN=10.524834878905\n", " STATISTICS_MINIMUM=0.62954892025643\n", " STATISTICS_STDDEV=10.751815070336\n", "Band 3 Block=512x512 Type=Float32, ColorInterp=Undefined\n", " Min=3.409 Max=178.328 \n", " Minimum=3.409, Maximum=178.328, Mean=41.354, StdDev=31.934\n", " NoData Value=-3.4e+38\n", " Overviews: 1500x1500, 750x750, 375x375\n", " Metadata:\n", " STATISTICS_MAXIMUM=178.32760325572\n", " STATISTICS_MEAN=41.353653830476\n", " STATISTICS_MINIMUM=3.408856940596\n", " STATISTICS_STDDEV=31.934002621158\n", "Band 4 Block=512x512 Type=Float32, ColorInterp=Undefined\n", " Min=6.503 Max=850.186 \n", " Minimum=6.503, Maximum=850.186, Mean=72.227, StdDev=52.055\n", " NoData Value=-3.4e+38\n", " Overviews: 1500x1500, 750x750, 375x375\n", " Metadata:\n", " STATISTICS_MAXIMUM=850.18554567087\n", " STATISTICS_MEAN=72.227219607842\n", " STATISTICS_MINIMUM=6.5033239743444\n", " STATISTICS_STDDEV=52.055061765112\n" ] }, { "data": { "text/html": [ "'Driver: GTiff/GeoTIFF\\nFiles: /vsis3/maap-ops-workspace/shared/alexdevseed/cog-tests/boreal_agb_20211015_0249_cog.tif\\nSize is 3000, 3000\\nCoordinate System is:\\nPROJCRS[\"unknown\",\\n BASEGEOGCRS[\"NAD83\",\\n DATUM[\"North American Datum 1983\",\\n ELLIPSOID[\"GRS 1980\",6378137,298.257222101004,\\n LENGTHUNIT[\"metre\",1]]],\\n PRIMEM[\"Greenwich\",0,\\n ANGLEUNIT[\"degree\",0.0174532925199433]],\\n ID[\"EPSG\",4269]],\\n CONVERSION[\"Albers Equal Area\",\\n METHOD[\"Albers Equal Area\",\\n ID[\"EPSG\",9822]],\\n PARAMETER[\"Latitude of false origin\",40,\\n ANGLEUNIT[\"degree\",0.0174532925199433],\\n ID[\"EPSG\",8821]],\\n PARAMETER[\"Longitude of false origin\",180,\\n ANGLEUNIT[\"degree\",0.0174532925199433],\\n ID[\"EPSG\",8822]],\\n PARAMETER[\"Latitude of 1st standard parallel\",50,\\n ANGLEUNIT[\"degree\",0.0174532925199433],\\n ID[\"EPSG\",8823]],\\n PARAMETER[\"Latitude of 2nd standard parallel\",70,\\n ANGLEUNIT[\"degree\",0.0174532925199433],\\n ID[\"EPSG\",8824]],\\n PARAMETER[\"Easting at false origin\",0,\\n LENGTHUNIT[\"metre\",1],\\n ID[\"EPSG\",8826]],\\n PARAMETER[\"Northing at false origin\",0,\\n LENGTHUNIT[\"metre\",1],\\n ID[\"EPSG\",8827]]],\\n CS[Cartesian,2],\\n AXIS[\"easting\",east,\\n ORDER[1],\\n LENGTHUNIT[\"metre\",1,\\n ID[\"EPSG\",9001]]],\\n AXIS[\"northing\",north,\\n ORDER[2],\\n LENGTHUNIT[\"metre\",1,\\n ID[\"EPSG\",9001]]]]\\nData axis to CRS axis mapping: 1,2\\nOrigin = (-1791478.000000000000000,7983304.000000000000000)\\nPixel Size = (30.000000000000000,-30.000000000000000)\\nMetadata:\\n AREA_OR_POINT=Area\\nImage Structure Metadata:\\n INTERLEAVE=PIXEL\\n LAYOUT=COG\\nCorner Coordinates:\\nUpper Left (-1791478.000, 7983304.000) ( 16d51\\'54.04\"E, 68d27\\' 4.96\"N)\\nLower Left (-1791478.000, 7893304.000) ( 18d20\\'45.02\"E, 69d 3\\'10.36\"N)\\nUpper Right (-1701478.000, 7983304.000) ( 15d 9\\'32.11\"E, 68d58\\' 7.91\"N)\\nLower Right (-1701478.000, 7893304.000) ( 16d37\\'42.72\"E, 69d35\\' 5.45\"N)\\nCenter (-1746478.000, 7938304.000) ( 16d44\\'58.48\"E, 69d 1\\' 3.32\"N)\\nBand 1 Block=512x512 Type=Float32, ColorInterp=Gray\\n Min=4.259 Max=642.621 \\n Minimum=4.259, Maximum=642.621, Mean=54.163, StdDev=41.175\\n NoData Value=-3.4e+38\\n Overviews: 1500x1500, 750x750, 375x375\\n Metadata:\\n STATISTICS_MAXIMUM=642.62117058029\\n STATISTICS_MEAN=54.162682191363\\n STATISTICS_MINIMUM=4.258820251973\\n STATISTICS_STDDEV=41.175124882695\\nBand 2 Block=512x512 Type=Float32, ColorInterp=Undefined\\n Min=0.630 Max=334.889 \\n Minimum=0.630, Maximum=334.889, Mean=10.525, StdDev=10.752\\n NoData Value=-3.4e+38\\n Overviews: 1500x1500, 750x750, 375x375\\n Metadata:\\n STATISTICS_MAXIMUM=334.88861093713\\n STATISTICS_MEAN=10.524834878905\\n STATISTICS_MINIMUM=0.62954892025643\\n STATISTICS_STDDEV=10.751815070336\\nBand 3 Block=512x512 Type=Float32, ColorInterp=Undefined\\n Min=3.409 Max=178.328 \\n Minimum=3.409, Maximum=178.328, Mean=41.354, StdDev=31.934\\n NoData Value=-3.4e+38\\n Overviews: 1500x1500, 750x750, 375x375\\n Metadata:\\n STATISTICS_MAXIMUM=178.32760325572\\n STATISTICS_MEAN=41.353653830476\\n STATISTICS_MINIMUM=3.408856940596\\n STATISTICS_STDDEV=31.934002621158\\nBand 4 Block=512x512 Type=Float32, ColorInterp=Undefined\\n Min=6.503 Max=850.186 \\n Minimum=6.503, Maximum=850.186, Mean=72.227, StdDev=52.055\\n NoData Value=-3.4e+38\\n Overviews: 1500x1500, 750x750, 375x375\\n Metadata:\\n STATISTICS_MAXIMUM=850.18554567087\\n STATISTICS_MEAN=72.227219607842\\n STATISTICS_MINIMUM=6.5033239743444\\n STATISTICS_STDDEV=52.055061765112\\n'" ], "text/latex": [ "'Driver: GTiff/GeoTIFF\\textbackslash{}nFiles: /vsis3/maap-ops-workspace/shared/alexdevseed/cog-tests/boreal\\_agb\\_20211015\\_0249\\_cog.tif\\textbackslash{}nSize is 3000, 3000\\textbackslash{}nCoordinate System is:\\textbackslash{}nPROJCRS{[}\"unknown\",\\textbackslash{}n BASEGEOGCRS{[}\"NAD83\",\\textbackslash{}n DATUM{[}\"North American Datum 1983\",\\textbackslash{}n ELLIPSOID{[}\"GRS 1980\",6378137,298.257222101004,\\textbackslash{}n LENGTHUNIT{[}\"metre\",1{]}{]}{]},\\textbackslash{}n PRIMEM{[}\"Greenwich\",0,\\textbackslash{}n ANGLEUNIT{[}\"degree\",0.0174532925199433{]}{]},\\textbackslash{}n ID{[}\"EPSG\",4269{]}{]},\\textbackslash{}n CONVERSION{[}\"Albers Equal Area\",\\textbackslash{}n METHOD{[}\"Albers Equal Area\",\\textbackslash{}n ID{[}\"EPSG\",9822{]}{]},\\textbackslash{}n PARAMETER{[}\"Latitude of false origin\",40,\\textbackslash{}n ANGLEUNIT{[}\"degree\",0.0174532925199433{]},\\textbackslash{}n ID{[}\"EPSG\",8821{]}{]},\\textbackslash{}n PARAMETER{[}\"Longitude of false origin\",180,\\textbackslash{}n ANGLEUNIT{[}\"degree\",0.0174532925199433{]},\\textbackslash{}n ID{[}\"EPSG\",8822{]}{]},\\textbackslash{}n PARAMETER{[}\"Latitude of 1st standard parallel\",50,\\textbackslash{}n ANGLEUNIT{[}\"degree\",0.0174532925199433{]},\\textbackslash{}n ID{[}\"EPSG\",8823{]}{]},\\textbackslash{}n PARAMETER{[}\"Latitude of 2nd standard parallel\",70,\\textbackslash{}n ANGLEUNIT{[}\"degree\",0.0174532925199433{]},\\textbackslash{}n ID{[}\"EPSG\",8824{]}{]},\\textbackslash{}n PARAMETER{[}\"Easting at false origin\",0,\\textbackslash{}n LENGTHUNIT{[}\"metre\",1{]},\\textbackslash{}n ID{[}\"EPSG\",8826{]}{]},\\textbackslash{}n PARAMETER{[}\"Northing at false origin\",0,\\textbackslash{}n LENGTHUNIT{[}\"metre\",1{]},\\textbackslash{}n ID{[}\"EPSG\",8827{]}{]}{]},\\textbackslash{}n CS{[}Cartesian,2{]},\\textbackslash{}n AXIS{[}\"easting\",east,\\textbackslash{}n ORDER{[}1{]},\\textbackslash{}n LENGTHUNIT{[}\"metre\",1,\\textbackslash{}n ID{[}\"EPSG\",9001{]}{]}{]},\\textbackslash{}n AXIS{[}\"northing\",north,\\textbackslash{}n ORDER{[}2{]},\\textbackslash{}n LENGTHUNIT{[}\"metre\",1,\\textbackslash{}n ID{[}\"EPSG\",9001{]}{]}{]}{]}\\textbackslash{}nData axis to CRS axis mapping: 1,2\\textbackslash{}nOrigin = (-1791478.000000000000000,7983304.000000000000000)\\textbackslash{}nPixel Size = (30.000000000000000,-30.000000000000000)\\textbackslash{}nMetadata:\\textbackslash{}n AREA\\_OR\\_POINT=Area\\textbackslash{}nImage Structure Metadata:\\textbackslash{}n INTERLEAVE=PIXEL\\textbackslash{}n LAYOUT=COG\\textbackslash{}nCorner Coordinates:\\textbackslash{}nUpper Left (-1791478.000, 7983304.000) ( 16d51\\textbackslash{}'54.04\"E, 68d27\\textbackslash{}' 4.96\"N)\\textbackslash{}nLower Left (-1791478.000, 7893304.000) ( 18d20\\textbackslash{}'45.02\"E, 69d 3\\textbackslash{}'10.36\"N)\\textbackslash{}nUpper Right (-1701478.000, 7983304.000) ( 15d 9\\textbackslash{}'32.11\"E, 68d58\\textbackslash{}' 7.91\"N)\\textbackslash{}nLower Right (-1701478.000, 7893304.000) ( 16d37\\textbackslash{}'42.72\"E, 69d35\\textbackslash{}' 5.45\"N)\\textbackslash{}nCenter (-1746478.000, 7938304.000) ( 16d44\\textbackslash{}'58.48\"E, 69d 1\\textbackslash{}' 3.32\"N)\\textbackslash{}nBand 1 Block=512x512 Type=Float32, ColorInterp=Gray\\textbackslash{}n Min=4.259 Max=642.621 \\textbackslash{}n Minimum=4.259, Maximum=642.621, Mean=54.163, StdDev=41.175\\textbackslash{}n NoData Value=-3.4e+38\\textbackslash{}n Overviews: 1500x1500, 750x750, 375x375\\textbackslash{}n Metadata:\\textbackslash{}n STATISTICS\\_MAXIMUM=642.62117058029\\textbackslash{}n STATISTICS\\_MEAN=54.162682191363\\textbackslash{}n STATISTICS\\_MINIMUM=4.258820251973\\textbackslash{}n STATISTICS\\_STDDEV=41.175124882695\\textbackslash{}nBand 2 Block=512x512 Type=Float32, ColorInterp=Undefined\\textbackslash{}n Min=0.630 Max=334.889 \\textbackslash{}n Minimum=0.630, Maximum=334.889, Mean=10.525, StdDev=10.752\\textbackslash{}n NoData Value=-3.4e+38\\textbackslash{}n Overviews: 1500x1500, 750x750, 375x375\\textbackslash{}n Metadata:\\textbackslash{}n STATISTICS\\_MAXIMUM=334.88861093713\\textbackslash{}n STATISTICS\\_MEAN=10.524834878905\\textbackslash{}n STATISTICS\\_MINIMUM=0.62954892025643\\textbackslash{}n STATISTICS\\_STDDEV=10.751815070336\\textbackslash{}nBand 3 Block=512x512 Type=Float32, ColorInterp=Undefined\\textbackslash{}n Min=3.409 Max=178.328 \\textbackslash{}n Minimum=3.409, Maximum=178.328, Mean=41.354, StdDev=31.934\\textbackslash{}n NoData Value=-3.4e+38\\textbackslash{}n Overviews: 1500x1500, 750x750, 375x375\\textbackslash{}n Metadata:\\textbackslash{}n STATISTICS\\_MAXIMUM=178.32760325572\\textbackslash{}n STATISTICS\\_MEAN=41.353653830476\\textbackslash{}n STATISTICS\\_MINIMUM=3.408856940596\\textbackslash{}n STATISTICS\\_STDDEV=31.934002621158\\textbackslash{}nBand 4 Block=512x512 Type=Float32, ColorInterp=Undefined\\textbackslash{}n Min=6.503 Max=850.186 \\textbackslash{}n Minimum=6.503, Maximum=850.186, Mean=72.227, StdDev=52.055\\textbackslash{}n NoData Value=-3.4e+38\\textbackslash{}n Overviews: 1500x1500, 750x750, 375x375\\textbackslash{}n Metadata:\\textbackslash{}n STATISTICS\\_MAXIMUM=850.18554567087\\textbackslash{}n STATISTICS\\_MEAN=72.227219607842\\textbackslash{}n STATISTICS\\_MINIMUM=6.5033239743444\\textbackslash{}n STATISTICS\\_STDDEV=52.055061765112\\textbackslash{}n'" ], "text/markdown": [ "'Driver: GTiff/GeoTIFF\\nFiles: /vsis3/maap-ops-workspace/shared/alexdevseed/cog-tests/boreal_agb_20211015_0249_cog.tif\\nSize is 3000, 3000\\nCoordinate System is:\\nPROJCRS[\"unknown\",\\n BASEGEOGCRS[\"NAD83\",\\n DATUM[\"North American Datum 1983\",\\n ELLIPSOID[\"GRS 1980\",6378137,298.257222101004,\\n LENGTHUNIT[\"metre\",1]]],\\n PRIMEM[\"Greenwich\",0,\\n ANGLEUNIT[\"degree\",0.0174532925199433]],\\n ID[\"EPSG\",4269]],\\n CONVERSION[\"Albers Equal Area\",\\n METHOD[\"Albers Equal Area\",\\n ID[\"EPSG\",9822]],\\n PARAMETER[\"Latitude of false origin\",40,\\n ANGLEUNIT[\"degree\",0.0174532925199433],\\n ID[\"EPSG\",8821]],\\n PARAMETER[\"Longitude of false origin\",180,\\n ANGLEUNIT[\"degree\",0.0174532925199433],\\n ID[\"EPSG\",8822]],\\n PARAMETER[\"Latitude of 1st standard parallel\",50,\\n ANGLEUNIT[\"degree\",0.0174532925199433],\\n ID[\"EPSG\",8823]],\\n PARAMETER[\"Latitude of 2nd standard parallel\",70,\\n ANGLEUNIT[\"degree\",0.0174532925199433],\\n ID[\"EPSG\",8824]],\\n PARAMETER[\"Easting at false origin\",0,\\n LENGTHUNIT[\"metre\",1],\\n ID[\"EPSG\",8826]],\\n PARAMETER[\"Northing at false origin\",0,\\n LENGTHUNIT[\"metre\",1],\\n ID[\"EPSG\",8827]]],\\n CS[Cartesian,2],\\n AXIS[\"easting\",east,\\n ORDER[1],\\n LENGTHUNIT[\"metre\",1,\\n ID[\"EPSG\",9001]]],\\n AXIS[\"northing\",north,\\n ORDER[2],\\n LENGTHUNIT[\"metre\",1,\\n ID[\"EPSG\",9001]]]]\\nData axis to CRS axis mapping: 1,2\\nOrigin = (-1791478.000000000000000,7983304.000000000000000)\\nPixel Size = (30.000000000000000,-30.000000000000000)\\nMetadata:\\n AREA_OR_POINT=Area\\nImage Structure Metadata:\\n INTERLEAVE=PIXEL\\n LAYOUT=COG\\nCorner Coordinates:\\nUpper Left (-1791478.000, 7983304.000) ( 16d51\\'54.04\"E, 68d27\\' 4.96\"N)\\nLower Left (-1791478.000, 7893304.000) ( 18d20\\'45.02\"E, 69d 3\\'10.36\"N)\\nUpper Right (-1701478.000, 7983304.000) ( 15d 9\\'32.11\"E, 68d58\\' 7.91\"N)\\nLower Right (-1701478.000, 7893304.000) ( 16d37\\'42.72\"E, 69d35\\' 5.45\"N)\\nCenter (-1746478.000, 7938304.000) ( 16d44\\'58.48\"E, 69d 1\\' 3.32\"N)\\nBand 1 Block=512x512 Type=Float32, ColorInterp=Gray\\n Min=4.259 Max=642.621 \\n Minimum=4.259, Maximum=642.621, Mean=54.163, StdDev=41.175\\n NoData Value=-3.4e+38\\n Overviews: 1500x1500, 750x750, 375x375\\n Metadata:\\n STATISTICS_MAXIMUM=642.62117058029\\n STATISTICS_MEAN=54.162682191363\\n STATISTICS_MINIMUM=4.258820251973\\n STATISTICS_STDDEV=41.175124882695\\nBand 2 Block=512x512 Type=Float32, ColorInterp=Undefined\\n Min=0.630 Max=334.889 \\n Minimum=0.630, Maximum=334.889, Mean=10.525, StdDev=10.752\\n NoData Value=-3.4e+38\\n Overviews: 1500x1500, 750x750, 375x375\\n Metadata:\\n STATISTICS_MAXIMUM=334.88861093713\\n STATISTICS_MEAN=10.524834878905\\n STATISTICS_MINIMUM=0.62954892025643\\n STATISTICS_STDDEV=10.751815070336\\nBand 3 Block=512x512 Type=Float32, ColorInterp=Undefined\\n Min=3.409 Max=178.328 \\n Minimum=3.409, Maximum=178.328, Mean=41.354, StdDev=31.934\\n NoData Value=-3.4e+38\\n Overviews: 1500x1500, 750x750, 375x375\\n Metadata:\\n STATISTICS_MAXIMUM=178.32760325572\\n STATISTICS_MEAN=41.353653830476\\n STATISTICS_MINIMUM=3.408856940596\\n STATISTICS_STDDEV=31.934002621158\\nBand 4 Block=512x512 Type=Float32, ColorInterp=Undefined\\n Min=6.503 Max=850.186 \\n Minimum=6.503, Maximum=850.186, Mean=72.227, StdDev=52.055\\n NoData Value=-3.4e+38\\n Overviews: 1500x1500, 750x750, 375x375\\n Metadata:\\n STATISTICS_MAXIMUM=850.18554567087\\n STATISTICS_MEAN=72.227219607842\\n STATISTICS_MINIMUM=6.5033239743444\\n STATISTICS_STDDEV=52.055061765112\\n'" ], "text/plain": [ "[1] \"Driver: GTiff/GeoTIFF\\nFiles: /vsis3/maap-ops-workspace/shared/alexdevseed/cog-tests/boreal_agb_20211015_0249_cog.tif\\nSize is 3000, 3000\\nCoordinate System is:\\nPROJCRS[\\\"unknown\\\",\\n BASEGEOGCRS[\\\"NAD83\\\",\\n DATUM[\\\"North American Datum 1983\\\",\\n ELLIPSOID[\\\"GRS 1980\\\",6378137,298.257222101004,\\n LENGTHUNIT[\\\"metre\\\",1]]],\\n PRIMEM[\\\"Greenwich\\\",0,\\n ANGLEUNIT[\\\"degree\\\",0.0174532925199433]],\\n ID[\\\"EPSG\\\",4269]],\\n CONVERSION[\\\"Albers Equal Area\\\",\\n METHOD[\\\"Albers Equal Area\\\",\\n ID[\\\"EPSG\\\",9822]],\\n PARAMETER[\\\"Latitude of false origin\\\",40,\\n ANGLEUNIT[\\\"degree\\\",0.0174532925199433],\\n ID[\\\"EPSG\\\",8821]],\\n PARAMETER[\\\"Longitude of false origin\\\",180,\\n ANGLEUNIT[\\\"degree\\\",0.0174532925199433],\\n ID[\\\"EPSG\\\",8822]],\\n PARAMETER[\\\"Latitude of 1st standard parallel\\\",50,\\n ANGLEUNIT[\\\"degree\\\",0.0174532925199433],\\n ID[\\\"EPSG\\\",8823]],\\n PARAMETER[\\\"Latitude of 2nd standard parallel\\\",70,\\n ANGLEUNIT[\\\"degree\\\",0.0174532925199433],\\n ID[\\\"EPSG\\\",8824]],\\n PARAMETER[\\\"Easting at false origin\\\",0,\\n LENGTHUNIT[\\\"metre\\\",1],\\n ID[\\\"EPSG\\\",8826]],\\n PARAMETER[\\\"Northing at false origin\\\",0,\\n LENGTHUNIT[\\\"metre\\\",1],\\n ID[\\\"EPSG\\\",8827]]],\\n CS[Cartesian,2],\\n AXIS[\\\"easting\\\",east,\\n ORDER[1],\\n LENGTHUNIT[\\\"metre\\\",1,\\n ID[\\\"EPSG\\\",9001]]],\\n AXIS[\\\"northing\\\",north,\\n ORDER[2],\\n LENGTHUNIT[\\\"metre\\\",1,\\n ID[\\\"EPSG\\\",9001]]]]\\nData axis to CRS axis mapping: 1,2\\nOrigin = (-1791478.000000000000000,7983304.000000000000000)\\nPixel Size = (30.000000000000000,-30.000000000000000)\\nMetadata:\\n AREA_OR_POINT=Area\\nImage Structure Metadata:\\n INTERLEAVE=PIXEL\\n LAYOUT=COG\\nCorner Coordinates:\\nUpper Left (-1791478.000, 7983304.000) ( 16d51'54.04\\\"E, 68d27' 4.96\\\"N)\\nLower Left (-1791478.000, 7893304.000) ( 18d20'45.02\\\"E, 69d 3'10.36\\\"N)\\nUpper Right (-1701478.000, 7983304.000) ( 15d 9'32.11\\\"E, 68d58' 7.91\\\"N)\\nLower Right (-1701478.000, 7893304.000) ( 16d37'42.72\\\"E, 69d35' 5.45\\\"N)\\nCenter (-1746478.000, 7938304.000) ( 16d44'58.48\\\"E, 69d 1' 3.32\\\"N)\\nBand 1 Block=512x512 Type=Float32, ColorInterp=Gray\\n Min=4.259 Max=642.621 \\n Minimum=4.259, Maximum=642.621, Mean=54.163, StdDev=41.175\\n NoData Value=-3.4e+38\\n Overviews: 1500x1500, 750x750, 375x375\\n Metadata:\\n STATISTICS_MAXIMUM=642.62117058029\\n STATISTICS_MEAN=54.162682191363\\n STATISTICS_MINIMUM=4.258820251973\\n STATISTICS_STDDEV=41.175124882695\\nBand 2 Block=512x512 Type=Float32, ColorInterp=Undefined\\n Min=0.630 Max=334.889 \\n Minimum=0.630, Maximum=334.889, Mean=10.525, StdDev=10.752\\n NoData Value=-3.4e+38\\n Overviews: 1500x1500, 750x750, 375x375\\n Metadata:\\n STATISTICS_MAXIMUM=334.88861093713\\n STATISTICS_MEAN=10.524834878905\\n STATISTICS_MINIMUM=0.62954892025643\\n STATISTICS_STDDEV=10.751815070336\\nBand 3 Block=512x512 Type=Float32, ColorInterp=Undefined\\n Min=3.409 Max=178.328 \\n Minimum=3.409, Maximum=178.328, Mean=41.354, StdDev=31.934\\n NoData Value=-3.4e+38\\n Overviews: 1500x1500, 750x750, 375x375\\n Metadata:\\n STATISTICS_MAXIMUM=178.32760325572\\n STATISTICS_MEAN=41.353653830476\\n STATISTICS_MINIMUM=3.408856940596\\n STATISTICS_STDDEV=31.934002621158\\nBand 4 Block=512x512 Type=Float32, ColorInterp=Undefined\\n Min=6.503 Max=850.186 \\n Minimum=6.503, Maximum=850.186, Mean=72.227, StdDev=52.055\\n NoData Value=-3.4e+38\\n Overviews: 1500x1500, 750x750, 375x375\\n Metadata:\\n STATISTICS_MAXIMUM=850.18554567087\\n STATISTICS_MEAN=72.227219607842\\n STATISTICS_MINIMUM=6.5033239743444\\n STATISTICS_STDDEV=52.055061765112\\n\"" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "tiff_read <- sf::gdal_utils(\"info\", tiff_path)\n", "tiff_read" ] }, { "cell_type": "markdown", "id": "fdb65efb-a988-4b6d-b1e1-2004b5e0872a", "metadata": {}, "source": [ "### Vector\n", "\n", "For this example, we'll access a geopackage from a shared bucket query using the `sf` package. Similar to above, we'll attach `/vsis3/` to our path." ] }, { "cell_type": "code", "execution_count": 16, "id": "3124ad01-82e0-43f3-a8f4-dedcca54b9dc", "metadata": {}, "outputs": [], "source": [ "vector_listing <- s3$list_objects_v2(Bucket = bucket, Prefix = \"shared/smk0033/CONUSbiohex2020/\")\n", "vector_key <- sapply(vector_listing$Contents, function(vector_object) vector_object$Key)" ] }, { "cell_type": "code", "execution_count": 17, "id": "771489f5-de9a-47f2-ba52-bec2837b0687", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[1] \"/vsis3/maap-ops-workspace/shared/smk0033/CONUSbiohex2020/biohex.gpkg\"\n" ] } ], "source": [ "vector_path <- paste(\"/vsis3\", bucket, vector_key[9], sep = \"/\")\n", "print(vector_path)" ] }, { "cell_type": "code", "execution_count": 18, "id": "1307eb31-c4cc-4fcc-84fe-d0274e535a5e", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Reading layer `CONUSbiohex2020' from data source \n", " `/vsis3/maap-ops-workspace/shared/smk0033/CONUSbiohex2020/biohex.gpkg' \n", " using driver `GPKG'\n", "Simple feature collection with 12591 features and 26 fields\n", "Geometry type: MULTIPOLYGON\n", "Dimension: XY\n", "Bounding box: xmin: -125.0093 ymin: 24.3193 xmax: -66.6917 ymax: 49.50757\n", "Geodetic CRS: Unknown datum based upon the Clarke 1866 ellipsoid\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "Registered S3 method overwritten by 'geojsonsf':\n", " method from \n", " print.geojson geojson\n", "\n" ] }, { "data": { "application/geo+json": { "features": [ { "geometry": { "coordinates": [ [ [ [ -69.3372, 47.5734 ], [ -69.3385, 47.4337 ], [ -69.1548, 47.3637 ], [ -68.9694, 47.4332 ], [ -68.9672, 47.5728 ], [ -69.1513, 47.6431 ], [ -69.3372, 47.5734 ] ] ] ], "type": "MultiPolygon" }, "properties": { "AVG_INVYR": 2017.3, "CRM_LIVE": 76.7292, "CRM_LIVE_D": 78.8203, "CRM_STND_D": 2.0911, "DRYBIOT_LI": 100.8048, "DRYBIOT_ST": 20.0917, "DRYBIOT__1": 120.8965, "EMAP_HEX": 1680, "EST_SAMPLE": 14242.7868, "JENK_LIVE": 104.6057, "JENK_LIVE_": 127.7172, "JENK_STND_": 23.5302, "NON_SAMPLE": 0, "PROP_FORES": 0.9668, "SAMPLED_PL": 6, "SE_CRM_LIV": 14.8108, "SE_CRM_L_1": 15.3813, "SE_CRM_STN": 68.1083, "SE_DRYBIOT": 17.031, "SE_DRYBI_1": 54.7746, "SE_DRYBI_2": 11.7529, "SE_JENK_LI": 17.2879, "SE_JENK_ST": 59.0508, "SE_JENK__1": 10.5835, "SE_PROP_FO": 3.2477, "USHEXES_ID": 1680 }, "type": "Feature" }, { "geometry": { "coordinates": [ [ [ [ -69.1548, 47.3637 ], [ -69.3385, 47.4337 ], [ -69.5233, 47.3636 ], [ -69.5239, 47.2239 ], [ -69.3406, 47.1542 ], [ -69.1563, 47.224 ], [ -69.1548, 47.3637 ] ] ] ], "type": "MultiPolygon" }, "properties": { "AVG_INVYR": 2017.1, "CRM_LIVE": 72.7512, "CRM_LIVE_D": 74.6218, "CRM_STND_D": 1.8706, "DRYBIOT_LI": 102.1586, "DRYBIOT_ST": 6.0942, "DRYBIOT__1": 108.2528, "EMAP_HEX": 1681, "EST_SAMPLE": 47158.8896, "JENK_LIVE": 109.1485, "JENK_LIVE_": 117.1908, "JENK_STND_": 9.4224, "NON_SAMPLE": 0, "PROP_FORES": 0.9839, "SAMPLED_PL": 19, "SE_CRM_LIV": 10.499, "SE_CRM_L_1": 10.4966, "SE_CRM_STN": 25.1864, "SE_DRYBIOT": 9.4992, "SE_DRYBI_1": 21.0299, "SE_DRYBI_2": 9.3179, "SE_JENK_LI": 9.3901, "SE_JENK_ST": 18.2349, "SE_JENK__1": 9.2327, "SE_PROP_FO": 1.1236, "USHEXES_ID": 1681 }, "type": "Feature" }, { "geometry": { "coordinates": [ [ [ [ -69.1548, 47.3637 ], [ -69.1563, 47.224 ], [ -68.9734, 47.1538 ], [ -68.7886, 47.223 ], [ -68.7861, 47.3626 ], [ -68.9694, 47.4332 ], [ -69.1548, 47.3637 ] ] ] ], "type": "MultiPolygon" }, "properties": { "AVG_INVYR": 2016.6, "CRM_LIVE": 88.527, "CRM_LIVE_D": 89.2302, "CRM_STND_D": 0.7031, "DRYBIOT_LI": 99.4358, "DRYBIOT_ST": 1.9766, "DRYBIOT__1": 101.4124, "EMAP_HEX": 1568, "EST_SAMPLE": 21226.9697, "JENK_LIVE": 107.3186, "JENK_LIVE_": 109.8393, "JENK_STND_": 2.6431, "NON_SAMPLE": 0, "PROP_FORES": 0.8541, "SAMPLED_PL": 9, "SE_CRM_LIV": 20.4167, "SE_CRM_L_1": 20.333, "SE_CRM_STN": 58.6495, "SE_DRYBIOT": 20.3801, "SE_DRYBI_1": 47.8732, "SE_DRYBI_2": 20.0863, "SE_JENK_LI": 20.1264, "SE_JENK_ST": 45.611, "SE_JENK__1": 19.8584, "SE_PROP_FO": 12.539, "USHEXES_ID": 1568 }, "type": "Feature" }, { "geometry": { "coordinates": [ [ [ [ -68.7861, 47.3626 ], [ -68.7886, 47.223 ], [ -68.6061, 47.1522 ], [ -68.4208, 47.2208 ], [ -68.4174, 47.3604 ], [ -68.6002, 47.4315 ], [ -68.7861, 47.3626 ] ] ] ], "type": "MultiPolygon" }, "properties": { "AVG_INVYR": 2017.4, "CRM_LIVE": 52.0524, "CRM_LIVE_D": 55.8362, "CRM_STND_D": 3.7838, "DRYBIOT_LI": 67.3134, "DRYBIOT_ST": 11.7764, "DRYBIOT__1": 79.0898, "EMAP_HEX": 1456, "EST_SAMPLE": 23836.8498, "JENK_LIVE": 68.7976, "JENK_LIVE_": 81.4404, "JENK_STND_": 13.8584, "NON_SAMPLE": 0, "PROP_FORES": 0.5435, "SAMPLED_PL": 10, "SE_CRM_LIV": 40.7134, "SE_CRM_L_1": 39.0801, "SE_CRM_STN": 37.6652, "SE_DRYBIOT": 38.4131, "SE_DRYBI_1": 32.3026, "SE_DRYBI_2": 36.4278, "SE_JENK_LI": 37.5327, "SE_JENK_ST": 29.3796, "SE_JENK__1": 35.2884, "SE_PROP_FO": 22.5987, "USHEXES_ID": 1456 }, "type": "Feature" }, { "geometry": { "coordinates": [ [ [ [ -68.4174, 47.3604 ], [ -68.4208, 47.2208 ], [ -68.2387, 47.1495 ], [ -68.0529, 47.2175 ], [ -68.0485, 47.357 ], [ -68.2309, 47.4286 ], [ -68.4174, 47.3604 ] ] ] ], "type": "MultiPolygon" }, "properties": { "AVG_INVYR": 2016.9, "CRM_LIVE": 42.1795, "CRM_LIVE_D": 42.52, "CRM_STND_D": 0.3405, "DRYBIOT_LI": 53.0168, "DRYBIOT_ST": 2.0284, "DRYBIOT__1": 55.0452, "EMAP_HEX": 1345, "EST_SAMPLE": 37744.6196, "JENK_LIVE": 57.0282, "JENK_LIVE_": 59.346, "JENK_STND_": 2.7447, "NON_SAMPLE": 0, "PROP_FORES": 0.5202, "SAMPLED_PL": 16, "SE_CRM_LIV": 29.2608, "SE_CRM_L_1": 29.3369, "SE_CRM_STN": 50.4989, "SE_DRYBIOT": 27.1758, "SE_DRYBI_1": 48.6648, "SE_DRYBI_2": 27.5634, "SE_JENK_LI": 27.366, "SE_JENK_ST": 41.8642, "SE_JENK__1": 27.7875, "SE_PROP_FO": 23.2102, "USHEXES_ID": 1345 }, "type": "Feature" }, { "geometry": { "coordinates": [ [ [ [ -68.0485, 47.357 ], [ -68.0529, 47.2175 ], [ -67.8712, 47.1457 ], [ -67.6848, 47.213 ], [ -67.6795, 47.3525 ], [ -67.8615, 47.4246 ], [ -68.0485, 47.357 ] ] ] ], "type": "MultiPolygon" }, "properties": { "AVG_INVYR": 2017, "CRM_LIVE": 15.9912, "CRM_LIVE_D": 15.9912, "CRM_STND_D": 0, "DRYBIOT_LI": 22.7802, "DRYBIOT_ST": 0, "DRYBIOT__1": 22.7802, "EMAP_HEX": 1235, "EST_SAMPLE": 4576.2532, "JENK_LIVE": 20.0853, "JENK_LIVE_": 20.0853, "JENK_STND_": 1.0981, "NON_SAMPLE": 0, "PROP_FORES": 0.2953, "SAMPLED_PL": 2, "SE_CRM_LIV": 73.4043, "SE_CRM_L_1": 73.4043, "SE_CRM_STN": 0, "SE_DRYBIOT": 73.4043, "SE_DRYBI_1": 0, "SE_DRYBI_2": 73.4043, "SE_JENK_LI": 73.4043, "SE_JENK_ST": 73.4043, "SE_JENK__1": 73.4043, "SE_PROP_FO": 73.4043, "USHEXES_ID": 1235 }, "type": "Feature" } ], "type": "FeatureCollection" }, "text/html": [ "\n", "\n", "\n", "\t\n", "\t\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\n", "
A sf: 6 × 27
USHEXES_IDEMAP_HEXPROP_FORESSE_PROP_FOCRM_LIVESE_CRM_LIVCRM_STND_DSE_CRM_STNCRM_LIVE_DSE_CRM_L_1ShapeSE_JENK_LIJENK_STND_SE_JENK_STJENK_LIVE_SE_JENK__1EST_SAMPLESAMPLED_PLNON_SAMPLEAVG_INVYRShape
<int><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><MULTIPOLYGON [°]>
1168016800.9668349 3.24765976.7292114.810822.091053468.1083478.8202715.38130MULTIPOLYGON (((-69.33725 4...17.28790723.53024459.05075127.7172310.5834714242.787 602017.3MULTIPOLYGON (((-69.33725 4...
2168116810.9839139 1.12359172.7511910.498961.870613025.1864274.6218110.49655MULTIPOLYGON (((-69.1548 47... 9.390085 9.42236218.23495117.19076 9.2327547158.8901902017.1MULTIPOLYGON (((-69.1548 47...
3156815680.854100512.53903488.5270420.416720.703146658.6494689.2301820.33304MULTIPOLYGON (((-69.1548 47...20.126408 2.64305645.61095109.8392819.8584421226.970 902016.6MULTIPOLYGON (((-69.1548 47...
4145614560.543536322.59869952.0524440.713393.783766137.6652455.8362139.08006MULTIPOLYGON (((-68.78615 4...37.53265913.85836329.37956 81.4403735.2883623836.8501002017.4MULTIPOLYGON (((-68.78615 4...
5134513450.520229223.21019942.1795529.260780.340500950.4988842.5200529.33694MULTIPOLYGON (((-68.41737 4...27.366023 2.74468141.86418 59.3460427.7875437744.6201602016.9MULTIPOLYGON (((-68.41737 4...
6123512350.295306573.40429415.9912073.404290.0000000 0.0000015.9912073.40429MULTIPOLYGON (((-68.04847 4...73.404294 1.09807173.40429 20.0852573.40429 4576.253 202017.0MULTIPOLYGON (((-68.04847 4...
\n" ], "text/latex": [ "A sf: 6 × 27\n", "\\begin{tabular}{r|lllllllllllllllllllll}\n", " & USHEXES\\_ID & EMAP\\_HEX & PROP\\_FORES & SE\\_PROP\\_FO & CRM\\_LIVE & SE\\_CRM\\_LIV & CRM\\_STND\\_D & SE\\_CRM\\_STN & CRM\\_LIVE\\_D & SE\\_CRM\\_L\\_1 & Shape & ⋯ & SE\\_JENK\\_LI & JENK\\_STND\\_ & SE\\_JENK\\_ST & JENK\\_LIVE\\_ & SE\\_JENK\\_\\_1 & EST\\_SAMPLE & SAMPLED\\_PL & NON\\_SAMPLE & AVG\\_INVYR & Shape\\\\\n", " & & & & & & & & & & & ⋯ & & & & & & & & & & \\\\\n", "\\hline\n", "\t1 & 1680 & 1680 & 0.9668349 & 3.247659 & 76.72921 & 14.81082 & 2.0910534 & 68.10834 & 78.82027 & 15.38130 & MULTIPOLYGON (((-69.33725 4... & ⋯ & 17.287907 & 23.530244 & 59.05075 & 127.71723 & 10.58347 & 14242.787 & 6 & 0 & 2017.3 & MULTIPOLYGON (((-69.33725 4...\\\\\n", "\t2 & 1681 & 1681 & 0.9839139 & 1.123591 & 72.75119 & 10.49896 & 1.8706130 & 25.18642 & 74.62181 & 10.49655 & MULTIPOLYGON (((-69.1548 47... & ⋯ & 9.390085 & 9.422362 & 18.23495 & 117.19076 & 9.23275 & 47158.890 & 19 & 0 & 2017.1 & MULTIPOLYGON (((-69.1548 47...\\\\\n", "\t3 & 1568 & 1568 & 0.8541005 & 12.539034 & 88.52704 & 20.41672 & 0.7031466 & 58.64946 & 89.23018 & 20.33304 & MULTIPOLYGON (((-69.1548 47... & ⋯ & 20.126408 & 2.643056 & 45.61095 & 109.83928 & 19.85844 & 21226.970 & 9 & 0 & 2016.6 & MULTIPOLYGON (((-69.1548 47...\\\\\n", "\t4 & 1456 & 1456 & 0.5435363 & 22.598699 & 52.05244 & 40.71339 & 3.7837661 & 37.66524 & 55.83621 & 39.08006 & MULTIPOLYGON (((-68.78615 4... & ⋯ & 37.532659 & 13.858363 & 29.37956 & 81.44037 & 35.28836 & 23836.850 & 10 & 0 & 2017.4 & MULTIPOLYGON (((-68.78615 4...\\\\\n", "\t5 & 1345 & 1345 & 0.5202292 & 23.210199 & 42.17955 & 29.26078 & 0.3405009 & 50.49888 & 42.52005 & 29.33694 & MULTIPOLYGON (((-68.41737 4... & ⋯ & 27.366023 & 2.744681 & 41.86418 & 59.34604 & 27.78754 & 37744.620 & 16 & 0 & 2016.9 & MULTIPOLYGON (((-68.41737 4...\\\\\n", "\t6 & 1235 & 1235 & 0.2953065 & 73.404294 & 15.99120 & 73.40429 & 0.0000000 & 0.00000 & 15.99120 & 73.40429 & MULTIPOLYGON (((-68.04847 4... & ⋯ & 73.404294 & 1.098071 & 73.40429 & 20.08525 & 73.40429 & 4576.253 & 2 & 0 & 2017.0 & MULTIPOLYGON (((-68.04847 4...\\\\\n", "\\end{tabular}\n" ], "text/markdown": [ "\n", "A sf: 6 × 27\n", "\n", "| | USHEXES_ID <int> | EMAP_HEX <dbl> | PROP_FORES <dbl> | SE_PROP_FO <dbl> | CRM_LIVE <dbl> | SE_CRM_LIV <dbl> | CRM_STND_D <dbl> | SE_CRM_STN <dbl> | CRM_LIVE_D <dbl> | SE_CRM_L_1 <dbl> | Shape ⋯ | ⋯ <dbl> | SE_JENK_LI <dbl> | JENK_STND_ <dbl> | SE_JENK_ST <dbl> | JENK_LIVE_ <dbl> | SE_JENK__1 <dbl> | EST_SAMPLE <dbl> | SAMPLED_PL <dbl> | NON_SAMPLE <dbl> | AVG_INVYR <MULTIPOLYGON [°]> | Shape <int> |\n", "|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|\n", "| 1 | 1680 | 1680 | 0.9668349 | 3.247659 | 76.72921 | 14.81082 | 2.0910534 | 68.10834 | 78.82027 | 15.38130 | MULTIPOLYGON (((-69.33725 4... | ⋯ | 17.287907 | 23.530244 | 59.05075 | 127.71723 | 10.58347 | 14242.787 | 6 | 0 | 2017.3 | MULTIPOLYGON (((-69.33725 4... |\n", "| 2 | 1681 | 1681 | 0.9839139 | 1.123591 | 72.75119 | 10.49896 | 1.8706130 | 25.18642 | 74.62181 | 10.49655 | MULTIPOLYGON (((-69.1548 47... | ⋯ | 9.390085 | 9.422362 | 18.23495 | 117.19076 | 9.23275 | 47158.890 | 19 | 0 | 2017.1 | MULTIPOLYGON (((-69.1548 47... |\n", "| 3 | 1568 | 1568 | 0.8541005 | 12.539034 | 88.52704 | 20.41672 | 0.7031466 | 58.64946 | 89.23018 | 20.33304 | MULTIPOLYGON (((-69.1548 47... | ⋯ | 20.126408 | 2.643056 | 45.61095 | 109.83928 | 19.85844 | 21226.970 | 9 | 0 | 2016.6 | MULTIPOLYGON (((-69.1548 47... |\n", "| 4 | 1456 | 1456 | 0.5435363 | 22.598699 | 52.05244 | 40.71339 | 3.7837661 | 37.66524 | 55.83621 | 39.08006 | MULTIPOLYGON (((-68.78615 4... | ⋯ | 37.532659 | 13.858363 | 29.37956 | 81.44037 | 35.28836 | 23836.850 | 10 | 0 | 2017.4 | MULTIPOLYGON (((-68.78615 4... |\n", "| 5 | 1345 | 1345 | 0.5202292 | 23.210199 | 42.17955 | 29.26078 | 0.3405009 | 50.49888 | 42.52005 | 29.33694 | MULTIPOLYGON (((-68.41737 4... | ⋯ | 27.366023 | 2.744681 | 41.86418 | 59.34604 | 27.78754 | 37744.620 | 16 | 0 | 2016.9 | MULTIPOLYGON (((-68.41737 4... |\n", "| 6 | 1235 | 1235 | 0.2953065 | 73.404294 | 15.99120 | 73.40429 | 0.0000000 | 0.00000 | 15.99120 | 73.40429 | MULTIPOLYGON (((-68.04847 4... | ⋯ | 73.404294 | 1.098071 | 73.40429 | 20.08525 | 73.40429 | 4576.253 | 2 | 0 | 2017.0 | MULTIPOLYGON (((-68.04847 4... |\n", "\n" ], "text/plain": [ " USHEXES_ID EMAP_HEX PROP_FORES SE_PROP_FO CRM_LIVE SE_CRM_LIV CRM_STND_D\n", "1 1680 1680 0.9668349 3.247659 76.72921 14.81082 2.0910534 \n", "2 1681 1681 0.9839139 1.123591 72.75119 10.49896 1.8706130 \n", "3 1568 1568 0.8541005 12.539034 88.52704 20.41672 0.7031466 \n", "4 1456 1456 0.5435363 22.598699 52.05244 40.71339 3.7837661 \n", "5 1345 1345 0.5202292 23.210199 42.17955 29.26078 0.3405009 \n", "6 1235 1235 0.2953065 73.404294 15.99120 73.40429 0.0000000 \n", " SE_CRM_STN CRM_LIVE_D SE_CRM_L_1 Shape ⋯ SE_JENK_LI\n", "1 68.10834 78.82027 15.38130 MULTIPOLYGON (((-69.33725 4... ⋯ 17.287907 \n", "2 25.18642 74.62181 10.49655 MULTIPOLYGON (((-69.1548 47... ⋯ 9.390085 \n", "3 58.64946 89.23018 20.33304 MULTIPOLYGON (((-69.1548 47... ⋯ 20.126408 \n", "4 37.66524 55.83621 39.08006 MULTIPOLYGON (((-68.78615 4... ⋯ 37.532659 \n", "5 50.49888 42.52005 29.33694 MULTIPOLYGON (((-68.41737 4... ⋯ 27.366023 \n", "6 0.00000 15.99120 73.40429 MULTIPOLYGON (((-68.04847 4... ⋯ 73.404294 \n", " JENK_STND_ SE_JENK_ST JENK_LIVE_ SE_JENK__1 EST_SAMPLE SAMPLED_PL NON_SAMPLE\n", "1 23.530244 59.05075 127.71723 10.58347 14242.787 6 0 \n", "2 9.422362 18.23495 117.19076 9.23275 47158.890 19 0 \n", "3 2.643056 45.61095 109.83928 19.85844 21226.970 9 0 \n", "4 13.858363 29.37956 81.44037 35.28836 23836.850 10 0 \n", "5 2.744681 41.86418 59.34604 27.78754 37744.620 16 0 \n", "6 1.098071 73.40429 20.08525 73.40429 4576.253 2 0 \n", " AVG_INVYR Shape \n", "1 2017.3 MULTIPOLYGON (((-69.33725 4...\n", "2 2017.1 MULTIPOLYGON (((-69.1548 47...\n", "3 2016.6 MULTIPOLYGON (((-69.1548 47...\n", "4 2017.4 MULTIPOLYGON (((-68.78615 4...\n", "5 2016.9 MULTIPOLYGON (((-68.41737 4...\n", "6 2017.0 MULTIPOLYGON (((-68.04847 4..." ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "vector <- st_read(vector_path)\n", "\n", "# limit the printout to the first few rows\n", "head(vector)" ] }, { "cell_type": "markdown", "id": "adb0b1b9-b6a8-492b-8c1c-684fe0e65971", "metadata": {}, "source": [ "### CSV (Spatial)\n", "\n", "For this example, we'll access a CSV file with spatial data from our MAAP STAC query. We'll use the \"item\" variable from the STAC query, and then use `sf` to open the file." ] }, { "cell_type": "code", "execution_count": 19, "id": "983c47bd-5926-4f2c-8d15-37c37caa66b6", "metadata": {}, "outputs": [ { "data": { "text/html": [ "'s3://nasa-maap-data-store/file-staging/nasa-map/icesat2-boreal/boreal_agb_202302151676439579_1326_train_data.csv'" ], "text/latex": [ "'s3://nasa-maap-data-store/file-staging/nasa-map/icesat2-boreal/boreal\\_agb\\_202302151676439579\\_1326\\_train\\_data.csv'" ], "text/markdown": [ "'s3://nasa-maap-data-store/file-staging/nasa-map/icesat2-boreal/boreal_agb_202302151676439579_1326_train_data.csv'" ], "text/plain": [ "[1] \"s3://nasa-maap-data-store/file-staging/nasa-map/icesat2-boreal/boreal_agb_202302151676439579_1326_train_data.csv\"" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "item" ] }, { "cell_type": "markdown", "id": "68023df7-d252-4e1e-9bea-8c7a06ae659e", "metadata": {}, "source": [ "Since we have a full S3 URL, let's replace `s3://` with `/vsis/` using the `sub` function. We'll also set names for the coordinate fields - see the [GDAL Comma Separated Value (.csv) driver page](https://gdal.org/en/stable/drivers/vector/csv.html) for more information." ] }, { "cell_type": "code", "execution_count": 20, "id": "2387c105-6ec0-4331-a38e-22be68b86911", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "options: X_POSSIBLE_NAMES=lon Y_POSSIBLE_NAMES=lat \n", "Reading layer `boreal_agb_202302151676439579_1326_train_data' from data source \n", " `/vsis3/nasa-maap-data-store/file-staging/nasa-map/icesat2-boreal/boreal_agb_202302151676439579_1326_train_data.csv' \n", " using driver `CSV'\n", "Simple feature collection with 8773 features and 4 fields\n", "Geometry type: POINT\n", "Dimension: XY\n", "Bounding box: xmin: -178.5851 ymin: 36.25292 xmax: 178.2856 ymax: 67.56312\n", "CRS: NA\n" ] }, { "data": { "application/geo+json": { "features": [ { "geometry": { "coordinates": [ -76.3015, 51.0891 ], "type": "Point" }, "properties": { "AGB": "13.2031877105918", "SE": "0.00120325130936702", "lat": 51.0891, "lon": -76.3015 }, "type": "Feature" }, { "geometry": { "coordinates": [ -79.0118, 50.9724 ], "type": "Point" }, "properties": { "AGB": "3.88344532354623", "SE": "0.00107527195707417", "lat": 50.9724, "lon": -79.0118 }, "type": "Feature" }, { "geometry": { "coordinates": [ -76.3973, 50.4583 ], "type": "Point" }, "properties": { "AGB": "4.3007091919769", "SE": "0.00107527195707417", "lat": 50.4583, "lon": -76.3973 }, "type": "Feature" }, { "geometry": { "coordinates": [ -76.3084, 50.4427 ], "type": "Point" }, "properties": { "AGB": "43.3027732332638", "SE": "0.00120325130936702", "lat": 50.4427, "lon": -76.3084 }, "type": "Feature" }, { "geometry": { "coordinates": [ -77.4565, 52.0315 ], "type": "Point" }, "properties": { "AGB": "2.34135031326733", "SE": "0.00107527195707417", "lat": 52.0315, "lon": -77.4565 }, "type": "Feature" }, { "geometry": { "coordinates": [ -77.6892, 50.536 ], "type": "Point" }, "properties": { "AGB": "39.7893307310248", "SE": "0.00120325130936702", "lat": 50.536, "lon": -77.6892 }, "type": "Feature" } ], "type": "FeatureCollection" }, "text/html": [ "\n", "\n", "\n", "\t\n", "\t\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\n", "
A sf: 6 × 5
lonlatAGBSEgeometry
<dbl><dbl><chr><chr><POINT>
1-76.3015551.0890713.20318771059180.00120325130936702POINT (-76.30155 51.08907)
2-79.0118350.972453.883445323546230.00107527195707417POINT (-79.01183 50.97245)
3-76.3973150.458324.3007091919769 0.00107527195707417POINT (-76.39731 50.45832)
4-76.3084450.4426843.30277323326380.00120325130936702POINT (-76.30844 50.44268)
5-77.4564552.031462.341350313267330.00107527195707417POINT (-77.45645 52.03146)
6-77.6891950.5360439.78933073102480.00120325130936702POINT (-77.68919 50.53604)
\n" ], "text/latex": [ "A sf: 6 × 5\n", "\\begin{tabular}{r|lllll}\n", " & lon & lat & AGB & SE & geometry\\\\\n", " & & & & & \\\\\n", "\\hline\n", "\t1 & -76.30155 & 51.08907 & 13.2031877105918 & 0.00120325130936702 & POINT (-76.30155 51.08907)\\\\\n", "\t2 & -79.01183 & 50.97245 & 3.88344532354623 & 0.00107527195707417 & POINT (-79.01183 50.97245)\\\\\n", "\t3 & -76.39731 & 50.45832 & 4.3007091919769 & 0.00107527195707417 & POINT (-76.39731 50.45832)\\\\\n", "\t4 & -76.30844 & 50.44268 & 43.3027732332638 & 0.00120325130936702 & POINT (-76.30844 50.44268)\\\\\n", "\t5 & -77.45645 & 52.03146 & 2.34135031326733 & 0.00107527195707417 & POINT (-77.45645 52.03146)\\\\\n", "\t6 & -77.68919 & 50.53604 & 39.7893307310248 & 0.00120325130936702 & POINT (-77.68919 50.53604)\\\\\n", "\\end{tabular}\n" ], "text/markdown": [ "\n", "A sf: 6 × 5\n", "\n", "| | lon <dbl> | lat <dbl> | AGB <chr> | SE <chr> | geometry <POINT> |\n", "|---|---|---|---|---|---|\n", "| 1 | -76.30155 | 51.08907 | 13.2031877105918 | 0.00120325130936702 | POINT (-76.30155 51.08907) |\n", "| 2 | -79.01183 | 50.97245 | 3.88344532354623 | 0.00107527195707417 | POINT (-79.01183 50.97245) |\n", "| 3 | -76.39731 | 50.45832 | 4.3007091919769 | 0.00107527195707417 | POINT (-76.39731 50.45832) |\n", "| 4 | -76.30844 | 50.44268 | 43.3027732332638 | 0.00120325130936702 | POINT (-76.30844 50.44268) |\n", "| 5 | -77.45645 | 52.03146 | 2.34135031326733 | 0.00107527195707417 | POINT (-77.45645 52.03146) |\n", "| 6 | -77.68919 | 50.53604 | 39.7893307310248 | 0.00120325130936702 | POINT (-77.68919 50.53604) |\n", "\n" ], "text/plain": [ " lon lat AGB SE \n", "1 -76.30155 51.08907 13.2031877105918 0.00120325130936702\n", "2 -79.01183 50.97245 3.88344532354623 0.00107527195707417\n", "3 -76.39731 50.45832 4.3007091919769 0.00107527195707417\n", "4 -76.30844 50.44268 43.3027732332638 0.00120325130936702\n", "5 -77.45645 52.03146 2.34135031326733 0.00107527195707417\n", "6 -77.68919 50.53604 39.7893307310248 0.00120325130936702\n", " geometry \n", "1 POINT (-76.30155 51.08907)\n", "2 POINT (-79.01183 50.97245)\n", "3 POINT (-76.39731 50.45832)\n", "4 POINT (-76.30844 50.44268)\n", "5 POINT (-77.45645 52.03146)\n", "6 POINT (-77.68919 50.53604)" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "head(st_read(sub(\"s3://\", \"/vsis3/\", item), options = c(\"X_POSSIBLE_NAMES=lon\", \"Y_POSSIBLE_NAMES=lat\")))" ] }, { "cell_type": "markdown", "id": "a540da76-564c-4bb4-871c-72572b545320", "metadata": {}, "source": [ "### CSV (non-spatial)" ] }, { "cell_type": "markdown", "id": "bf71e0c2-b508-4c23-a9cf-9ec2f498f3a3", "metadata": {}, "source": [ "For this example, we'll access a CSV file from our shared bucket. This CSV file does not contain spatial data (i.e., latitude and longitude).\n", "\n", "**Note**: this example applies to all non-spatial CSV files. It is recommended for non-spatial CSV files to be downloaded locally and then opened using `read.csv`. While we are able to directly access a non-spatial CSV file, we are using this method for simplicity." ] }, { "cell_type": "code", "execution_count": 21, "id": "879d64cc-dd7c-42dc-b275-f66aa133cac2", "metadata": {}, "outputs": [ { "data": { "text/html": [ "'shared/smk0033/csv_ex/country_estimates_gedi_l4b_v002.csv'" ], "text/latex": [ "'shared/smk0033/csv\\_ex/country\\_estimates\\_gedi\\_l4b\\_v002.csv'" ], "text/markdown": [ "'shared/smk0033/csv_ex/country_estimates_gedi_l4b_v002.csv'" ], "text/plain": [ "[1] \"shared/smk0033/csv_ex/country_estimates_gedi_l4b_v002.csv\"" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "csv_listing <- s3$list_objects_v2(Bucket = bucket, Prefix = \"shared/smk0033/csv_ex/\")\n", "csv_keys <- sapply(csv_listing$Contents, function(csv_object) csv_object$Key)\n", "\n", "# choose an arbitrary key\n", "csv_key <- csv_keys[4]\n", "csv_key" ] }, { "cell_type": "markdown", "id": "46ac6713-bc47-4f38-94dd-98621dc21d6b", "metadata": {}, "source": [ "Before downloading, let's get our filename and create a new directory to put our file." ] }, { "cell_type": "code", "execution_count": 22, "id": "8b5e1bb6-f6cb-40cb-9476-4e8a42b203db", "metadata": {}, "outputs": [], "source": [ "# get filename\n", "filename <- sub(\".*/\", \"\", csv_key)\n", "\n", "# create directory\n", "dir_path = file.path(\".\", \"data\")\n", "dir.create(dir_path, showWarnings = FALSE, recursive = TRUE)\n", "\n", "# create filepath\n", "filepath <- file.path(dir_path, filename)" ] }, { "cell_type": "markdown", "id": "c6685408-17cc-40ae-b89e-eec35df1c887", "metadata": {}, "source": [ "Now we can download our data and open it." ] }, { "cell_type": "code", "execution_count": 24, "id": "02fbea00-3708-4756-abe4-71d59c08eac2", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
    \n", "
\n" ], "text/latex": [ "\\begin{enumerate}\n", "\\end{enumerate}\n" ], "text/markdown": [ "\n", "\n" ], "text/plain": [ "list()" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# download\n", "s3$download_file(Bucket = bucket, Key = csv_key, Filename = filepath)" ] }, { "cell_type": "code", "execution_count": 25, "id": "893f4b97-156c-4813-a7a6-4288ae3e7971", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\t\n", "\t\n", "\n", "\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\t\n", "\n", "
A data.frame: 6 × 11
CountryISO3Percent_ForestFAO_Forested_AGBDFAO_Forested_AGBD.1GEDI_L4B_Total_AGBDGEDI_L4B_Total_AGBD.1GEDI_L4B_AGBD_SE_PercentFAO_AGBGEDI_L4B_AGBGEDI_L4B_AGB_SE
<chr><chr><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl>
1Aruba ABW 2.3-9999.0-9999.0 2.10.523.6-9.999e+033.554221e-058.388068e-06
2AfghanistanAFG 1.9-9999.0-9999.024.71.3 5.4-9.999e+031.583907e+008.486180e-02
3Angola AGO53.4 30.3 16.234.60.6 1.9 2.020e+004.312326e+008.028431e-02
4Anguilla AIA61.1 210.0 128.3 4.41.022.5 1.160e-033.543690e-057.973480e-06
5Albania ALB28.8-9999.0-9999.056.91.4 2.5-9.999e+031.611579e-014.025675e-03
6Andorra AND34.0 154.0 52.474.34.7 6.3 2.460e-033.360226e-032.118110e-04
\n" ], "text/latex": [ "A data.frame: 6 × 11\n", "\\begin{tabular}{r|lllllllllll}\n", " & Country & ISO3 & Percent\\_Forest & FAO\\_Forested\\_AGBD & FAO\\_Forested\\_AGBD.1 & GEDI\\_L4B\\_Total\\_AGBD & GEDI\\_L4B\\_Total\\_AGBD.1 & GEDI\\_L4B\\_AGBD\\_SE\\_Percent & FAO\\_AGB & GEDI\\_L4B\\_AGB & GEDI\\_L4B\\_AGB\\_SE\\\\\n", " & & & & & & & & & & & \\\\\n", "\\hline\n", "\t1 & Aruba & ABW & 2.3 & -9999.0 & -9999.0 & 2.1 & 0.5 & 23.6 & -9.999e+03 & 3.554221e-05 & 8.388068e-06\\\\\n", "\t2 & Afghanistan & AFG & 1.9 & -9999.0 & -9999.0 & 24.7 & 1.3 & 5.4 & -9.999e+03 & 1.583907e+00 & 8.486180e-02\\\\\n", "\t3 & Angola & AGO & 53.4 & 30.3 & 16.2 & 34.6 & 0.6 & 1.9 & 2.020e+00 & 4.312326e+00 & 8.028431e-02\\\\\n", "\t4 & Anguilla & AIA & 61.1 & 210.0 & 128.3 & 4.4 & 1.0 & 22.5 & 1.160e-03 & 3.543690e-05 & 7.973480e-06\\\\\n", "\t5 & Albania & ALB & 28.8 & -9999.0 & -9999.0 & 56.9 & 1.4 & 2.5 & -9.999e+03 & 1.611579e-01 & 4.025675e-03\\\\\n", "\t6 & Andorra & AND & 34.0 & 154.0 & 52.4 & 74.3 & 4.7 & 6.3 & 2.460e-03 & 3.360226e-03 & 2.118110e-04\\\\\n", "\\end{tabular}\n" ], "text/markdown": [ "\n", "A data.frame: 6 × 11\n", "\n", "| | Country <chr> | ISO3 <chr> | Percent_Forest <dbl> | FAO_Forested_AGBD <dbl> | FAO_Forested_AGBD.1 <dbl> | GEDI_L4B_Total_AGBD <dbl> | GEDI_L4B_Total_AGBD.1 <dbl> | GEDI_L4B_AGBD_SE_Percent <dbl> | FAO_AGB <dbl> | GEDI_L4B_AGB <dbl> | GEDI_L4B_AGB_SE <dbl> |\n", "|---|---|---|---|---|---|---|---|---|---|---|---|\n", "| 1 | Aruba | ABW | 2.3 | -9999.0 | -9999.0 | 2.1 | 0.5 | 23.6 | -9.999e+03 | 3.554221e-05 | 8.388068e-06 |\n", "| 2 | Afghanistan | AFG | 1.9 | -9999.0 | -9999.0 | 24.7 | 1.3 | 5.4 | -9.999e+03 | 1.583907e+00 | 8.486180e-02 |\n", "| 3 | Angola | AGO | 53.4 | 30.3 | 16.2 | 34.6 | 0.6 | 1.9 | 2.020e+00 | 4.312326e+00 | 8.028431e-02 |\n", "| 4 | Anguilla | AIA | 61.1 | 210.0 | 128.3 | 4.4 | 1.0 | 22.5 | 1.160e-03 | 3.543690e-05 | 7.973480e-06 |\n", "| 5 | Albania | ALB | 28.8 | -9999.0 | -9999.0 | 56.9 | 1.4 | 2.5 | -9.999e+03 | 1.611579e-01 | 4.025675e-03 |\n", "| 6 | Andorra | AND | 34.0 | 154.0 | 52.4 | 74.3 | 4.7 | 6.3 | 2.460e-03 | 3.360226e-03 | 2.118110e-04 |\n", "\n" ], "text/plain": [ " Country ISO3 Percent_Forest FAO_Forested_AGBD FAO_Forested_AGBD.1\n", "1 Aruba ABW 2.3 -9999.0 -9999.0 \n", "2 Afghanistan AFG 1.9 -9999.0 -9999.0 \n", "3 Angola AGO 53.4 30.3 16.2 \n", "4 Anguilla AIA 61.1 210.0 128.3 \n", "5 Albania ALB 28.8 -9999.0 -9999.0 \n", "6 Andorra AND 34.0 154.0 52.4 \n", " GEDI_L4B_Total_AGBD GEDI_L4B_Total_AGBD.1 GEDI_L4B_AGBD_SE_Percent FAO_AGB \n", "1 2.1 0.5 23.6 -9.999e+03\n", "2 24.7 1.3 5.4 -9.999e+03\n", "3 34.6 0.6 1.9 2.020e+00\n", "4 4.4 1.0 22.5 1.160e-03\n", "5 56.9 1.4 2.5 -9.999e+03\n", "6 74.3 4.7 6.3 2.460e-03\n", " GEDI_L4B_AGB GEDI_L4B_AGB_SE\n", "1 3.554221e-05 8.388068e-06 \n", "2 1.583907e+00 8.486180e-02 \n", "3 4.312326e+00 8.028431e-02 \n", "4 3.543690e-05 7.973480e-06 \n", "5 1.611579e-01 4.025675e-03 \n", "6 3.360226e-03 2.118110e-04 " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# open data\n", "data <- read.csv(filepath)\n", "head(data)" ] } ], "metadata": { "kernelspec": { "display_name": "R", "language": "R", "name": "ir" }, "language_info": { "codemirror_mode": "r", "file_extension": ".r", "mimetype": "text/x-r-source", "name": "R", "pygments_lexer": "r", "version": "4.3.3" } }, "nbformat": 4, "nbformat_minor": 5 }