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
IMAGE_IDS=(362976198490009 1888143888002636 970575523746168 526796082027428 787889015446658 1129147657601096 1134535653732089 516618696031026 3009173986073277 201523208270637 305968770975732 958137924938581 378277316722727 209974830660272 200809664984637 137764555030387 942474903179186 940427276721989 791211061781396 202333174851275 486957325778877 805797957001540 307770120984995 1219491835133659 769091757079434 1872619352895950 778127736176918 3798100280296173 213819066867563 294716358908682 275077454328412 480761446478341 137502264962195 3040376049527215 470323904271869 820151898619584 492926185359821 159343019469864 4325440874162153 1092544157922995 208763204132713 461976144896623 285895799882708 814337192828833 173258464676887 463248201424612 1731583310354169 940020236759254 841291296595554 1511530889191059 4316488295027806 848396649443765 2964793180444944 1136549010145
@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 March 30, 2025 02:56
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 December 16, 2024 14:23
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