Skip to content

Instantly share code, notes, and snippets.

View cbeddow's full-sized avatar

Christopher Beddow cbeddow

View GitHub Profile
This file has been truncated, but you can view the full file.
#!/bin/bash
# Set the client token
TOKEN="MLY|9332742813501477|98a02ff0529c86451c9d3ff0a4686a65"
# Set the array of Mapillary image IDs
@cbeddow
cbeddow / osm2geojson
Created November 28, 2023 23:37
A JSON dict of Overture places categories to OSM tags
{
"forest": [
"landuse=forest"
],
"stadium_arena": [
"leisure=stadium"
],
"farm": [
"landuse=farm"
],
{
"forest": [
"landuse=forest"
],
"stadium_arena": [
"leisure=stadium"
],
"farm": [
"landuse=farm"
],
import json
import pandas as pd
tags_dict = None
with open('./overture2osm.json') as file:
tags_dict = json.load(file)
def jsonize_tags(tags):
# Split the string at the '=' character
tags = {tag.split('=')[0]: tag.split('=')[1] for tag in tags}
{
"forest": [
"landuse=forest"
],
"stadium_arena": [
"leisure=stadium"
],
"farm": [
"landuse=farm"
],
{
"forest": [
"landuse=forest"
],
"stadium_arena": [
"leisure=stadium"
],
"farm": [
"landuse=farm"
],
@cbeddow
cbeddow / mapillary_jpg_download.py
Last active June 24, 2025 20:02
Download Mapillary images a JPGs
import mercantile, mapbox_vector_tile, requests, json, os
from vt2geojson.tools import vt_bytes_to_geojson
# define an empty geojson as output
output= { "type": "FeatureCollection", "features": [] }
# vector tile endpoints -- change this in the API request to reference the correct endpoint
tile_coverage = 'mly1_public'
# tile layer depends which vector tile endpoints:
@cbeddow
cbeddow / mapillary_image_download.py
Last active June 15, 2025 08:47
Download all Mapillary images in a bounding box - API v4
import mercantile, mapbox_vector_tile, requests, json
from vt2geojson.tools import vt_bytes_to_geojson
# define an empty geojson as output
output= { "type": "FeatureCollection", "features": [] }
# vector tile endpoints -- change this in the API request to reference the correct endpoint
tile_coverage = 'mly1_public'
# tile layer depends which vector tile endpoints:
@cbeddow
cbeddow / mapillary_sequence_download.py
Last active January 18, 2022 21:28
Download Mapillary sequence lines as geojson
import mercantile, mapbox_vector_tile, requests, json
from vt2geojson.tools import vt_bytes_to_geojson
# define an empty geojson as output
output= { "type": "FeatureCollection", "features": [] }
# vector tile endpoints -- change this in the API request to reference the correct endpoint
tile_coverage = 'mly1_public'
# tile layer depends which vector tile endpoints:
@cbeddow
cbeddow / mapillary_image_download.py
Created July 20, 2021 20:39
Download Mapillary images with API v4
import mercantile, mapbox_vector_tile, requests, json
from vt2geojson.tools import vt_bytes_to_geojson
# define an empty geojson as output
output = { "type": "FeatureCollection", "features": [] }
# empty list of image keys
images = []
# vector tile endpoints -- change this in the API request to reference the correct endpoint