Skip to content

Instantly share code, notes, and snippets.

View baldur's full-sized avatar

Baldur Gudbjornsson baldur

View GitHub Profile
$ curl http://osrm.test.mapzen.com/car/viaroute\?z\=19\&output\=json\&instructions\=true\&\&loc\=40.7445379,-73.9903955\&loc\=40.747416,-73.988712
------
{"hint_data":{"locations":["WJxIAP_____oeAQAKQAAABMAAAB2AAAAEAAAAIVw3wbktW0CoP6W-wIARAA","vZZIAP____-PeQQAEgAAAEMAAAAAAAAAAAAAAP____9swm0CQAaX-wAAAAA"],"checksum":19155988},"route_name":["Madison Avenue","West 31st Street"],"via_indices":[0,17],"found_alternative":false,"route_summary":{"end_point":"West 31st Street","start_point":"West 26th Street","total_time":145,"total_distance":1173},"via_points":[[40.744419,-73.990494],[40.747627,-73.988541]],"route_instructions":[["10","West 26th Street",222,0,52,"221m","SE",119],["1","East 26th Street",153,5,29,"153m","SE",124],["7","Madison Avenue",393,7,42,"393m","NE",29],["7","East 31st Street",155,12,14,"155m","NW",299],["1","West 31st Street",250,13,22,"249m","NW",299],["15","",0,16,0,"0m","N",0]],"route_geometry":"g}yulA~t_clCnc@{uAnA}DrAeE|Nud@~AeFpA_Ezf@y|Aqe@c[ue@e[ue@i[qe@a[qe@c[ei@hcBmh@x`B_Tlp@yD|M","st
<?xml version="1.0" encoding="UTF-8" ?>
<gpx version="1.1"
creator="gMapToGPX 6.4.11 - http://github.com/seafoodbuffet/gMapToGPX"
xmlns="http://www.topografix.com/GPX/1/1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
<trk>
<name>Gmaps Pedometer Track</name>
<cmt>Permalink: <![CDATA[
Permalink unavailable.
<html>
<head>
</head>
<body>
<div id="stats"></div>
<style>
.h2 {
width: 100%;
display: block;
}
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"name": "Mapzen Route",
"time": "2014-06-05T14:28:34-04:00",
"instructions": [
[
backend cache {
.host = "s3bucket";
}
backend tilestash {
.host = "tilestashhost";
.port = "8000";
}
sub vcl_recv {
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us">
<head>
<title>Canvas stuff</title>
<style>
html, body { width: 100%; height: 100%; margin: 0px; }
</style>
</head>
<body>
<canvas id="gallery"></canvas>
@baldur
baldur / gist:619cdf463c268125dc6d
Created August 29, 2014 13:48
blank names in route_instructions
output from: curl http://osrm.test.mapzen.com/car/viaroute\?z\=19\&output\=json\&instructions\=true\&\&loc\=40.6662678,-73.985334\&loc\=44.028152,-73.147618\&alt\=false | python -m json.tool
{
"found_alternative": false,
"hint_data": {
"checksum": 2875622111,
"locations": [
"ZLtIAGW7SABwUgAATwAAAAkAAAAAAAAAAAAAAP____-4hGwCiBKX-wAARAA",
"tf_VArn_1QKxKwMAKQAAAGkAAAA5AAAAYAEAANhBFAKA0J8C2Nmj-wEAAAA"
]
@baldur
baldur / install-support-jar.sh
Created August 13, 2014 17:21
install-support-jar.sh
#!/bin/sh
#
# This script installs the Android Support v4 jar in your local Maven repository.
#
# Usage:
# install-support-jar.sh
version=$1
echo "Downloading support_r$version.zip"
wget https://dl-ssl.google.com/android/repository/support_r$version.zip
package com.mapzen;
import com.mapzen.osrm.Route;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import org.zeromq.ZMQ;
@Config(manifest=Config.NONE)
require 'find'
Find.find('.') do |path|
basename = File.basename(path)
dirname = File.dirname(path)
if dirname =~ /^\.\/src|^\.\/res/
if basename =~ /.java$/ || basename =~ /.xml$/
content = File.read(path)
if content =~ /\n\n$/
File.write(path, content.gsub(/\n\n$/, "\n"))