Skip to content

Instantly share code, notes, and snippets.

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.
*
@karussell
karussell / leaflet_hosted.ipynb
Created Jul 28, 2020
routing api via jupyter
View leaflet_hosted.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@karussell
karussell / customizable-routing.ipynb
Last active Jul 28, 2020
customizable routing - the notebook needs to be trusted to run JavaScript which is required for the leaflet maps or view it on https://nbviewer.jupyter.org/gist/karussell/5b799b253e608a93aeb6b120ccc8e67a
View customizable-routing.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View config.yml
graphhopper:
datareader.file: ""
graph.location: graph-cache
graph.flag_encoders: car|turn_costs=true
profiles:
- name: car
vehicle: car
weighting: fastest
@karussell
karussell / copy-to-bashrc.sh
Last active Jun 10, 2020
append to foreign pull request
View copy-to-bashrc.sh
# Here is how to append commits to a pull request from a foreign repository without (slow) cloning
# When you put the function in .bashrc you can use it via:
# cd graphhopper # go into your local copy of the repo where the pull request was made
# pranch graphhopper msbarry:sample-and-3d-simplify
# The first argument is your organisation and the second argument is "foreign_organisation:foreign_branch" e.g. copied from the pull request
pranch()
{
forbranch=${2#*:} # == foreign branch
fororg=${2%%:*} # == foreign organisation
locbranch=${fororg}_${forbranch}
@karussell
karussell / price.md
Last active Jul 25, 2020
hetzner pricing for 256GB RAM servers and beyond
View price.md
name CPU 256GB-price max GB max-price price/1GB CPU Benchmark
SB (auction) Xeon® E5-1650 v3 Hexa-Core ~100€ 256 ~100€ 0.31-0.43 13531
AX161 EPYC™ 7502P 32-Core Zen2 167.00€ 512 263€ 0.514-0.652 27437
PX92 Xeon® W-2145 Octa-Core 174.93€ 256 174€ 0.683 19707
DX152 2*Xeon® SP Silver 10-Core 267.96€ 768 492€ 0.640-1.074 19256
DX292 2*Xeon® SP Gold 16-Core 338.00€ 768 702€ 0.91-3.97 26585
SX292 Xeon® E5-1650 v3 Hexa-Core 308.21€ 256 308€ 1.204 13531

Prices including VAT.

View truck.yml
# Specify a vehicle (FlagEncoder) or another custom profile like
base: car
# in meter
vehicle_height: 3.8
vehicle_width: 2.5
# in tons
vehicle_weight: 4.5
# The formula is defined in CustomWeighting, where the speed_factor can be used to increase and decrease speed.
View request.json
{
"configuration" : {
"routing" : {
"profile" : "car"
},
"clustering" : {
"max_quantity" : 10,
"min_quantity" : 5,
"num_clusters" : 5
}
@karussell
karussell / error.txt
Created Jan 30, 2020
graal native image
View error.txt
[hello.helloworld:8352] compile: 31,630.85 ms, 2.08 GB
Fatal error: java.lang.UnsatisfiedLinkError
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at java.base/java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:603)
at java.base/java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:1006)
at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:456)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:357)
View native-image-gh.diff
diff --git a/core/src/main/java/com/graphhopper/GraphHopper.java b/core/src/main/java/com/graphhopper/GraphHopper.java
index 673b1880c..6207e5f26 100644
--- a/core/src/main/java/com/graphhopper/GraphHopper.java
+++ b/core/src/main/java/com/graphhopper/GraphHopper.java
@@ -82,7 +82,7 @@ public class GraphHopper implements GraphHopperAPI {
private final String fileLockName = "gh.lock";
private final Set<RoutingAlgorithmFactoryDecorator> algoDecorators = new LinkedHashSet<>();
// utils
- private final TranslationMap trMap = new TranslationMap().doImport();
+ private final TranslationMap trMap;