Skip to content

Instantly share code, notes, and snippets.

@easbar
easbar / invalid_restriction_relations_in_osm.txt
Created October 28, 2022 16:59
Invalid Restriction Relations in OSM
This file has been truncated, but you can view the full file.
relation 30780 has no member with role 'via'. tags: {restriction=no_u_turn, type=restriction}, members: [from way 26734840, to way 26734841]. Relation ignored.
relation 34926 is missing a member with role 'to'. tags: {restriction=no_right_turn, type=restriction}, members: [from way 37072198, via node 243511827]. Relation ignored.
relation 35162 is missing a member with role 'from'. tags: {restriction=no_left_turn, type=restriction}, members: [via node 65518532, to way 417274299]. Relation ignored.
relation 60434 is missing a member with role 'to'. tags: {restriction=only_straight_on, type=restriction}, members: [from way 22895990, via node 5033895737]. Relation ignored.
relation 60435 is missing a member with role 'from'. tags: {restriction=only_right_turn, type=restriction}, members: [to way 33731176, via node 5033895737]. Relation ignored.
relation 60438 is missing a member with role 'to'. tags: {restriction=no_right_turn, type=restriction}, members: [from way 28931153, via node 331974995]. Relation ignored
@easbar
easbar / README.md
Created August 5, 2022 21:17 — forked from philippkraft/README.md
Convert xyz elevation models to GeoTiff

Convert .xyz elevation models to GeoTiff

In Germany, more and more state agencies allow free access to high resolution elevation models. However, these are often released as xyz tables, which are not easily used in GIS environments. A standard method to convert this format to raster formats (eg. GeoTiff) is the GDAL function gdal_translate [1, 2]. However, converting 1M lines takes dozens of seconds and is not trivial to parallize.

@easbar
easbar / osm_ferry_ways.csv
Last active March 15, 2022 10:11
A list of OSM ferry routes including speed, distance, duration and coordinates (March 2022)
We can't make this file beautiful and searchable because it's too large.
# OSM ferry routes as of March 9th, 2022.
# osm_way: the OSM way ID
# speed_kmh: ferry speed calculated as distance_km/duration_h, or NaN if no duration was given
# duration_h: ferry duration parsed from the OSM duration tag
# distance_km: ferry length calculated from the node coordinates
# beeline_distance_km: the straight line distance between the first and last points of the ferry way
# from: the first node of the ferry way as lat,lon,elevation
# to: the last node of the ferry way as lat,lon,elevation
# duration_tag: the duration tag as it was provided
@easbar
easbar / odessa_mini.xml
Created February 21, 2022 11:12
Mini OSM that yields import error for GH 4.0
<?xml version='1.0' encoding='UTF-8'?>
<osm version="0.6" generator="Osmosis 0.48.3">
<node id="618394826" version="2" timestamp="2021-12-26T18:03:55Z" uid="174344" user="Badarau Andrei" changeset="115394899" lat="46.4859481" lon="29.4078723"/>
<node id="618394827" version="2" timestamp="2021-12-26T18:03:55Z" uid="174344" user="Badarau Andrei" changeset="115394899" lat="46.486163" lon="29.4083603"/>
<node id="618394829" version="2" timestamp="2021-12-26T18:03:55Z" uid="174344" user="Badarau Andrei" changeset="115394899" lat="46.4862991" lon="29.4089486"/>
<node id="618394831" version="1" timestamp="2010-01-22T22:19:23Z" uid="174344" user="Badarau Andrei" changeset="3687676" lat="46.4867111" lon="29.4102631"/>
<node id="618394833" version="1" timestamp="2010-01-22T22:19:24Z" uid="174344" user="Badarau Andrei" changeset="3687676" lat="46.48682" lon="29.4105503"/>
<node id="618394835" version="1" timestamp="2010-01-22T22:19:24Z" uid="174344" user="Badarau Andrei" changeset="3687676" lat="46.4869915"
  • nr = max_settled_nodes_neighbor_relevance
  • nc = max_settled_nodes_contraction
  • nco = max_settled_nodes_contraction_with_order

bike

nodes edges nr nc nco fast_graph_out fast_graph_in prep (ms) query (μs) prep order (ms) query order (μs)
25459 44371 0 0 0 230995 240947 38651 307 1262 308
25459 44371 0 1 1 230995 240947 40905 317 801 314
25459 44371 0 3 3 241798 248331 68862 350 1154 364
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [
[
49.501614,
@easbar
easbar / short_edge.osm.xml
Created January 9, 2020 17:41
infinite_speed_bug
<?xml version='1.0' encoding='UTF-8'?>
<osm version="0.6" generator="Osmosis 0.46">
<bounds minlon="12.03860" minlat="49.20910" maxlon="12.04050" maxlat="49.21700" origin="0.46"/>
<node id="27342236" version="6" timestamp="2012-08-06T18:16:58Z" uid="0" user="" lat="49.2093061" lon="12.0399368">
<tag k="crossing" v="traffic_signals"/>
<tag k="highway" v="traffic_signals"/>
</node>
<node id="60619425" version="3" timestamp="2009-01-07T08:39:21Z" uid="0" user="" lat="49.2096727" lon="12.040376"/>
<node id="148568625" version="2" timestamp="2010-02-28T07:57:22Z" uid="0" user="" lat="49.2093649" lon="12.0398788">
<tag k="addr:city" v="Burglengenfeld"/>
package com.graphhopper.routing;
import com.carrotsearch.hppc.IntArrayList;
import com.graphhopper.routing.util.CarFlagEncoder;
import com.graphhopper.routing.util.EncodingManager;
import com.graphhopper.routing.util.FlagEncoder;
import com.graphhopper.routing.util.TraversalMode;
import com.graphhopper.routing.weighting.FastestWeighting;
import com.graphhopper.routing.weighting.TurnWeighting;
import com.graphhopper.storage.GraphHopperStorage;
@easbar
easbar / graphhopper.xml
Created April 28, 2018 08:23
Intellij Copyright profile for Graphhopper
<component name="CopyrightManager">
<copyright>
<option name="notice" value=" Licensed to GraphHopper GmbH under one or more contributor&#10; license agreements. See the NOTICE file distributed with this work for&#10; additional information regarding copyright ownership.&#10;&#10; GraphHopper GmbH licenses this file to you under the Apache License,&#10; Version 2.0 (the &quot;License&quot;); you may not use this file except in&#10; compliance with the License. You may obtain a copy of the License at&#10;&#10; http://www.apache.org/licenses/LICENSE-2.0&#10;&#10; Unless required by applicable law or agreed to in writing, software&#10; distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10; See the License for the specific language governing permissions and&#10; limitations under the License." />
<option name="myName" value="graphhopper" />
</copyright>
</component>