This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": 8, | |
"name": "OSM Liberty", | |
"metadata": { | |
"maputnik:license": "https://github.com/nst-guide/osm-liberty-topo/blob/gh-pages/LICENSE.md", | |
"maputnik:renderer": "mbgljs" | |
}, | |
"sources": { | |
"openmaptiles": { | |
"type": "vector", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Generic, TypeVar | |
import numpy as np | |
from pydantic.fields import ModelField | |
JSON_ENCODERS = { | |
np.ndarray: lambda arr: arr.tolist() | |
} | |
DType = TypeVar('DType') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import re | |
# Airport ninja | |
# product_id = '163194625' | |
# n_pages = 63 | |
# B2 | |
product_id = '3776320176181' | |
n_pages = 17 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "Feature", | |
"stac_version": "1.0.0-beta.2", | |
"id": "sentinel-2-l2a-mosaic-120-2019-12-7-01K", | |
"properties": { | |
"start_datetime": "2019-12-07T00:00:00", | |
"end_datetime": "2019-12-17T00:00:00", | |
"platform": "sentinel-2", | |
"gsd": 120, | |
"datetime": null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[tool.poetry] | |
name = "tmp" | |
version = "0.1.0" | |
description = "" | |
authors = ["Kyle Barron"] | |
[tool.poetry.dependencies] | |
python = "^3.7" | |
pyarrow = "^2.0.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import zlib | |
from io import BytesIO | |
# pip install bitstruct | |
import bitstruct | |
import numpy as np | |
import rasterio | |
path = 's3://sentinel-cogs/sentinel-s2-l2a-cogs/2020/S2A_26PQB_20200401_0_L2A/B02.tif' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import zlib | |
from io import BytesIO | |
# pip install bitstruct | |
import bitstruct | |
import numpy as np | |
arr = np.random.randint(0, 4096, size=(256, 256), dtype=np.uint16) | |
buf = BytesIO() | |
np.save(buf, arr) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def intersect_bounds(bounds1, bounds2): | |
"""Find intersection of two bounding boxes | |
Attributes | |
---------- | |
bounds1 : list | |
bounds (left, bottom, right, top). | |
bounds2 : list | |
bounds (left, bottom, right, top). | |
Returns | |
------- |