Skip to content

Instantly share code, notes, and snippets.

Peter karussell

Block or report user

Report or block karussell

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View an_idea_for_vehicle_profiles.md

Loose statements

properties: compact, self-explanatory, declarative "no-loop", native yaml (?)

very specific to influence only the cost and time calculation:

calcMillis:
  time = distance_in_m / speed_in_kmh * 3.6 + delay_in_sec
calcWeight:
  if (!access) return infinity
View highlight-tunnels.js
var lineLayer = L.geoJson().addTo(mapLayer.getMap());
lineLayer.options.style = function (feature) {
var p = feature.properties || {};
return {color:p.color||"gray", weight:p.weight||2, opacity:0.5};
}
var counter = 0;
var timeLimit = 10 * 30;
var Papa = require("papaparse");
Papa.parse("http://127.0.0.1:8989/spt?point=51.351201,12.398071&time_limit="+timeLimit+"&columns=prev_longitude,prev_latitude,longitude,latitude,time,road_environment", {
View MyBenchmark.java
/*
* Copyright (c) 2014, Oracle America, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
View import-edge-based.log
This file has been truncated, but you can view the full file.
2019-07-08 19:17:08.753 [main] INFO c.g.r.tomtom.TTGraphHopperFactory - No tomtom config detected
2019-07-08 19:17:08.793 [main] INFO c.g.matrix.http.GraphHopperEEManaged - Loaded landmark splitting collection from
View MapMatchingExample1.java
/*
* Licensed to Peter Karich under one or more contributor license
* agreements. See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*
* Peter Karich licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the
* License at
*
View style.json
{
"version": 8,
"name": "gh-mvt",
"sources": {
"gh-mvt-tiles": {
"type": "vector",
"tiles": [
"http://127.0.0.1:8989/mvt/{z}/{x}/{y}.mvt?details=max_speed&details=road_class&details=road_environment"
]
},
@karussell
karussell / output.log
Last active Jun 12, 2019
stats edge based CH: prepare.ch.edge_based: edge_or_node, 2 threads, 4 profiles, no LM => ~65h per profile
View output.log
2019-06-08 18:07:54.182 [fastest_small_truck_edge] INFO c.g.r.c.PrepareContractionHierarchies - took: 180935s, graph now - num edges: 227?362?802, num nodes: 173?012?687, num shortcuts: 633?753?377
2019-06-09 08:32:32.522 [fastest_car_edge] INFO c.g.r.c.PrepareContractionHierarchies - took: 232813s, graph now - num edges: 227?362?802, num nodes: 173?012?687, num shortcuts: 749?629?202
2019-06-10 21:58:44.572 [fastest_truck_edge] INFO c.g.r.c.PrepareContractionHierarchies - took: 186650s, graph now - num edges: 227?362?802, num nodes: 173?012?687, num shortcuts: 603?320?037
2019-06-12 03:07:34.821 [fastest_scooter_edge] INFO c.g.r.c.PrepareContractionHierarchies - took: 239702s, graph now - num edges: 227?362?802, num nodes: 173?012?687, num shortcuts: 747?637?733
7.7G edges
8.4G geometry
3.3G nodes
1.4G location_index
@karussell
karussell / install-android-sdk-linux.txt
Last active May 31, 2019
Install Android SDK for graphhopper/android
View install-android-sdk-linux.txt
https://developer.android.com/studio/#downloads => sdk-tools-linux-4333796.zip
mkdir android-sdk-linux
cd android-sdk-linux
unzip ~/Downloads/sdk-tools-linux-4333796.zip
android-sdk-linux/tools/bin/sdkmanager "build-tools;27.0.3"
android-sdk-linux/tools/bin/sdkmanager "platforms;android-27"
# building with JDK 11 fails currently with javax/xml/something not available
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
mvn -P include-android clean install -DskipTests=true
View test-dedicated.sh
wget -q https://raw.githubusercontent.com/graphhopper/directions-api-js-client/master/route-optimization-examples/vrp_lonlat_new.json -O vrp.json
JOB_ID=$(curl -X POST -H "Content-Type: application/json" "http://localhost:8080/optimize" --data @vrp.json | cut -d'"' -f4)
sleep 2
curl -X GET "http://localhost:8080/solution/$JOB_ID"
View PostLargeProblem.java
// for more than 4K locations or for slow network you need to gzip the body
OkHttpClient client = new OkHttpClient();
client.setConnectTimeout(20, TimeUnit.SECONDS);
client.setReadTimeout(20, TimeUnit.SECONDS);
client.interceptors().add(new GzipRequestInterceptor());
....
You can’t perform that action at this time.