Skip to content

Instantly share code, notes, and snippets.

View vincentsarago's full-sized avatar

Vincent Sarago vincentsarago

View GitHub Profile
import json
import click
import cligj
from shapely.geometry import shape, mapping, MultiPolygon
from shapely.affinity import translate
@click.command()
"""rio_tiler.sentinel1: Sentinel-1 processing."""
import os
import re
import json
import warnings
import multiprocessing
from functools import partial
from concurrent import futures
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Demo</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v1.0.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v1.0.0/mapbox-gl.css' rel='stylesheet' />
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import mercantile
from shapely.geometry import box, shape
from supermercado import burntiles
minzoom = 7
maxzoom = 12
maximum_items_per_tile = 20
def stac_to_mosaicJSON(data):
dataset = data["features"]
@vincentsarago
vincentsarago / Sentinel2_to_cog_price.md
Created May 2, 2019 20:52
How much will it cost to convert all the Sentinel-2 JPEG2000 to COG ?

Let's see how much it will cost to translate all the Sentinel-2 JPEG2000 to COGs using AWS Lambda https://github.com/developmentseed/sentinel-2-cog (Note at this scale AWS Lambda might not be the cheapest option).

How many S2 scenes do we have on AWS?

$ curl https://sat-api.developmentseed.org/collections/sentinel-2-l1c/items | jq -r '.meta.found'
5 633 438

Lambda config

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# IN MEMORY
Line # Mem usage Increment Line Contents
================================================
29 102.769531 MiB 102.769531 MiB @profile(precision=6)
30 def cog_translate(
31 src_path,
32 dst_path,
33 dst_kwargs,
34 indexes=None,
35 nodata=None,