Skip to content

Instantly share code, notes, and snippets.

View nilsnolde's full-sized avatar

Nils nilsnolde

  • temp retiree
  • Berlin, DE
View GitHub Profile
@nilsnolde
nilsnolde / valhalla_traffic_tile_encoder.py
Last active May 20, 2022 09:12
How to encode traffic stuff for valhalla
from ctypes import *
import struct
from enum import Enum
"""
Converts valhalla's tile header & edge speeds into byte objects to be compressed.
"""
HEADER_FORMAT = '<2Q4L' # 2 uint_64, 4 uint_32 from the traffic header