Skip to content

Instantly share code, notes, and snippets.

View vincentsarago's full-sized avatar

Vincent Sarago vincentsarago

View GitHub Profile
"""API."""
from dataclasses import dataclass, field
import os
from urllib.parse import urlencode
from typing import Callable, Dict, Optional
import pkg_resources
from rasterio.transform import from_bounds
from cogeo_mosaic.mosaic import MosaicJSON
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Australia Wildfires DG images</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.

Workshop

COG + STAC

Requirements

  • python 3.7
  • rio-viz, rio-cogeo
"""rio-tiler.reader: image utility functions."""
from typing import Any, Dict, List, Optional, Sequence, Tuple, Union
import math
import warnings
from concurrent import futures
import numpy
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vincentsarago
vincentsarago / nodatas.py
Last active March 5, 2020 19:48
convert multiple nodata values to 0
"""cli"""
import click
import numpy
import rasterio
from rasterio.rio import options
/* This code helps you create multiple copies of a document in your google drive and rename each of them based on values in a google sheet.
In the first column of your google sheet, list down the names of the new files as required.
In your google sheet,open tools-->script editor and paste the following code.
Open the google doc whose copy is to be made. Copy the text after /d/ and replace the text in line 13.
Run the code. You will find your new copies in the same folder as the document whose copies are being made*/
function copyDocs() {
var data = SpreadsheetApp.getActiveSheet().getDataRange().getValues();
# Please be kind
# See https://github.com/developmentseed/awspds-mosaic
# to deploy your own
endpoint = "https://landsatlive.live"
# Define AOI here
bounds = [-5.833740234375, 46.15700496290803, -0.9118652343749999, 49.23912083246698]
# Date Filters
start = "2019-01-01T00:00:00Z"
$ rio cogeo validate s3://ds-satellite/raw/ABoVE_LandCover_1984_2014/ABoVE_LandCover_Simplified_Bh17v10.tif
The following errors were found:
- The file is greater than 512xH or 512xW, but is not tiled
- The offset of the main IFD should be 8 for ClassicTIFF or 16 for BigTIFF. It is 32340442 instead
- The offset of the first block of overview of index 1 should be after the one of the overview of index 2
- The offset of the first block of overview of index 0 should be after the one of the overview of index 1
- The offset of the first block of the main resolution image should be after the one of the overview of index 2
s3://ds-satellite/raw/ABoVE_LandCover_1984_2014/ABoVE_LandCover_Simplified_Bh17v10.tif is NOT a valid cloud optimized GeoTIFF