Skip to content

Instantly share code, notes, and snippets.

@ptpt
ptpt / mapillary_download.py
Created September 5, 2019 16:23
A command line tool used to download Mapillary data via Mapillary API v3
#!/usr/bin/env python3
"""A command line tool used to download Mapillary data via Mapillary API v3 https://www.mapillary.com/developer/api-documentation/.
This tool fetches data and prints them line by line (http://ndjson.org/), and it handles pagination automatically.
Usage:
mapillary_download.py URL [HEADER...]
Examples:
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ptpt
ptpt / index.html
Last active January 26, 2017 17:26
Mapillary API v3 demo
<!DOCTYPE html>
<html>
<head>
<title>Mapillary API v3 demo</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.1/dist/leaflet.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://unpkg.com/leaflet@1.0.1/dist/leaflet.js"></script>
<script src="./main.js"></script>
@ptpt
ptpt / index.html
Last active August 7, 2018 23:04
Demo page for Mapillary raster tiles
<!DOCTYPE html>
<html>
<head>
<title>Raster Tiles - Mapillary</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.1/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.0.1/dist/leaflet.js"></script>
</head>
<body>
@ptpt
ptpt / matched_routes.geojson
Last active August 3, 2016 16:14
Measurements and map-matched routes in Pittsburgh, Pennsylvania
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ptpt
ptpt / AUTHORS
Last active February 24, 2021 20:40
Minimal setup for getting pthread work correctly with autotools
We couldn’t find that file to show.
@ptpt
ptpt / benchmark.py
Created June 7, 2016 10:24
mapbox-vector-tile benchmark
import random
import cProfile
import shapely.geometry
import mapbox_vector_tile as mvt
_EXTENT = 4096
def generate_linestring(size):
@ptpt
ptpt / verify.cc
Last active March 11, 2016 19:00
Verify GetOpposingEdge
// compile: g++ --std=c++11 verify.cc -o verify -lvalhalla_midgard -lvalhalla_baldr
// run: ./verify CONF_PATH
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <valhalla/midgard/logging.h>
#include <valhalla/baldr/directededge.h>
#include <valhalla/baldr/graphreader.h>
#include <valhalla/baldr/tilehierarchy.h>
@ptpt
ptpt / test_graphreader.cc
Last active December 30, 2015 11:06
A script to test valhalla/baldr's graph reader
#include <thread>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <valhalla/baldr/graphreader.h>
#include <valhalla/baldr/tilehierarchy.h>
#include <valhalla/midgard/logging.h>
#include <valhalla/baldr/graphid.h>