Skip to content

Instantly share code, notes, and snippets.

View mhaberler's full-sized avatar

Michael Haberler mhaberler

View GitHub Profile
@JesseCrocker
JesseCrocker / merge-pmtiles.py
Created March 29, 2024 13:19
Merge a directory of PMTiles files into a single file
#!/usr/bin/env python3
import argparse
import os
from pmtiles.reader import MmapSource, Reader, all_tiles
from pmtiles.writer import Writer
from pmtiles.tile import Compression
from pmtiles.tile import zxy_to_tileid
from tqdm import tqdm
def merge_pmtiles(input_dir: str, output_file: str) -> None:
@Tomasvrba
Tomasvrba / 360TimelapseTutorial.md
Last active December 17, 2022 22:18
HD 360° Timelapse and FFmpeg tutorial

How to capture, stitch and publish a 360° timelapse

Consumer ready 360° cameras are becoming ever more accessible and many people are experimenting with a variety of 360° content. Out of the many cameras on the market the Ricoh Theta S is one of the most user-friendly, turn-key solutions with lots of built-in features. However, the camera's videos are limited 1920x960 resolution and the Theta+ app only lets you create a timelapse with up to 300 or 400 images. The workaround is to use interval shooting to capture as many images as you'd like at the 5376x2688 to full resolution and then stitch them together manually into an HD video. There are few GUI solutions (especially open-source/free) which let you do this with ease. Here's how you do it:

Set up interval shooting on your Ricoh Theta S

# Intended to convert a typical radar lla and az el to a cesium quaternion orientation for CZML
# Uses numpy, transformations.py (http://www.lfd.uci.edu/~gohlke/code/transformations.py.html),
# and ecef.py (https://code.google.com/p/pysatel/source/browse/trunk/coord.py?r=22)
def azEl2Quaternion(lat, lon, alt, az, el):
rotZ = rotation_matrix(math.radians(180+az), [0,0,1])
rotY = rotation_matrix(math.radians(-(90+el)), [0,1,0])
rotM = np.dot(rotZ, rotY)
origin = geodetic2ecef(lat, lon, alt)
origin = np.multiply(origin, 1000)