Skip to content

Instantly share code, notes, and snippets.

View m-mohr's full-sized avatar
🌍
Flying through space and time!

Matthias Mohr m-mohr

🌍
Flying through space and time!
View GitHub Profile
{
"stac_version": "1.0.0",
"stac_extensions": [],
"type": "Feature",
"id": "S2A_MSIL2A_20231107T144731_N0509_R139_T20QRF_20231107T182159", // product URI, ".SAFE" removed
"collection": "sentinel-2-l2a",
"properties": {
"datetime": "2023-11-07T14:47:31.024000Z",
"platform": "Sentinel-2A",
"proj:epsg": 32620,
@m-mohr
m-mohr / multihash.py
Last active March 4, 2024 20:42
Create a multihash in Python
def encode_varint(value):
"""Encode an integer as a varint in bytes."""
encoded_bytes = bytearray()
while value > 0x7F:
encoded_bytes.append((value & 0x7F) | 0x80)
value >>= 7
encoded_bytes.append(value)
return bytes(encoded_bytes)
def hex_to_multihash(hexstring_hash, hex_fn_code):
@m-mohr
m-mohr / add-geoparquet-metadata.py
Created July 17, 2023 10:51
Adds geoparquet metadata to a parquet file
import json
import pyarrow.parquet as pq
path1 = "pf.parquet"
path2 = "pf.geoparquet"
geo_metadata = {
"version": "1.0.0-beta.1",
"primary_column": "geometry",
"columns": {
@m-mohr
m-mohr / evi.json
Last active December 17, 2019 13:16
{
"dc": {
"process_id": "load_collection",
"description": "Loading the data; The order of the specified bands is important for the following reduce operation.",
"arguments": {
"id": "Sentinel-2",
"spatial_extent": {
"west": 16.1,
"east": 16.6,
"north": 48.6,
@m-mohr
m-mohr / polygons.geojson
Created June 7, 2018 09:40
Polygons for openEO Hackathon
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.