Skip to content

Instantly share code, notes, and snippets.

View emileten's full-sized avatar

Emile Tenezakis emileten

  • Development Seed
  • Seoul, Korea
View GitHub Profile
@emileten
emileten / example_collection.json
Created April 5, 2023 06:07
example collection
{
"id": "AfriSAR_AGB_Maps_1681",
"stac_version": "1.0.0",
"links": [],
"license": "not-provided",
"title": "AfriSAR: Aboveground Biomass for Lope, Mabounie, Mondah, and Rabi Sites, Gabon",
"type": "Collection",
"description": "This dataset provides gridded estimates of aboveground biomass (AGB) for four sites in Gabon at 0.25 ha (50 m) resolution derived with field measurements and airborne LiDAR data collected from 2010 to 2016. The sites represent a mix of forested, savannah, and some agricultural and disturbed landcover types: Lope site, within Lope National Park; Mabounie, mostly forested site; Mondah Forest, protected area; and the Rabi forest site, part of the Smithsonian Institution of Global Earth Observatories world-wide network of forest plots. Plot-level biophysical measurements of tree diameter and tree height (or estimated by allometry) were performed at 1 ha and 0.25 ha scales on multiple plots at each site and used to derive AGB for each tree and then summed for each plot. Aerial
@emileten
emileten / use-pypgstac.py
Created April 10, 2023 22:01
use-pypgstac
"""Utilities to bulk load data into pgstac from json/ndjson."""
import logging
from pypgstac.load import Loader as BaseLoader
logger = logging.getLogger(__name__)
from typing import Dict
from pypgstac.load import Methods
from stac_pydantic import Collection
from pypgstac.db import PgstacDB
@emileten
emileten / collection-example.json
Created April 10, 2023 22:03
collection-example
{
"id": "ESACCI_Biomass_L4_AGB_V3_100m_2018",
"links":[],
"item_assets":{},
"stac_version": "1.0.0",
"license": "ESA CCI Data Policy: free and open access",
"title": "ESA CCI above-ground biomass product level 4, year 2018",
"type": "Collection",
"description": "This dataset comprises estimates of forest above-ground biomass for the years 2010, 2017 and 2018. They are derived from a combination of Earth observation data, depending on the year, from the Copernicus Sentinel-1 mission, Envisat’s ASAR instrument and JAXA’s Advanced Land Observing Satellite (ALOS-1 and ALOS-2), along with additional information from Earth observation sources. The data has been produced as part of the European Space Agency's (ESA's) Climate Change Initiative (CCI) programme by the Biomass CCI team.",
"extent": {
@emileten
emileten / rrequest-python-lambda-construct
Created April 13, 2023 00:30
request-python-lambda-construct
#!/usr/bin/env python3
from aws_cdk import aws_lambda, Stack, App
import aws_cdk.aws_lambda_python_alpha as aws_lambda_python
class LambdaStack(Stack):
def __init__(self, app, construct_id, **kwargs) -> None:
super().__init__(app, construct_id, **kwargs)
self.construct_id = construct_id
def python_lambda(name, directory, **kwargs):
return aws_lambda_python.PythonFunction(
@emileten
emileten / count_items_in_collection_pystac.py
Created April 27, 2023 02:52
count_items_in_collection_pystac
from pystac_client import Client
CATALOG_URL = '' # Replace with your catalog URL
COLLECTION_ID = '' # Replace with your collection ID
# Create a client to connect to the catalog
client = Client.open(CATALOG_URL)
for collection in client.get_all_collections():
print(f'Collection ID: {collection.id}')
@emileten
emileten / get-AWS-lambda-environment-variables-in-dotenv-format.sh
Created April 28, 2023 06:02
get-AWS-lambda-environment-variables-in-dotenv-format
aws lambda get-function-configuration --function-name <function-name> --query 'Environment.Variables' --output json | jq -r 'to_entries | .[] | .key + "=" + .value' > .env
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@emileten
emileten / test-titiler-pgstac
Created May 24, 2023 02:38
test-titiler-pgstac
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## titiler.PgSTAC Demo\n",
"\n",
"This Notebook aims to show the different features provided by titiler.pgstac application\n",
@emileten
emileten / test-titiler-pgstac.ipynb
Last active May 24, 2023 02:40
test titiler pgstac
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@emileten
emileten / create_CCI_mosaic.ipynb
Created June 23, 2023 09:14
create CCI mosaic
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.