openrouteservice icon indicating copy to clipboard operation
openrouteservice copied to clipboard

Got schwimming-route for 760km but only asked for 2km walking: Isochrones

Open jannefleischer opened this issue 7 months ago • 1 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

Problem description

I am using the isochrones api and realised that there might be an inconsistancy on how ferry-lines are treated when asking for a walking-isochrone, depending on wether the source point is on water or not. If on water within the Kiel harbor, I can easily walk to the other side of the baltic sea (by ferry, and far longer then the defined walking-limit). But when I ran the same algorithm from land (50m next to it) I only reach the asked distance into the sea (on the ferry line).

Proposed solution

Handle both cases the same (preferably stay within limits).

Additional context

This is small script reproducing the issue from within the qgis-python-console (using the qgis-plugin, though error comes from api, i think):

import processing

from qgis.core import (
    QgsVectorLayer,
    QgsFeature,
    QgsGeometry,
    QgsPointXY,
    QgsProject,
    QgsFields,
    QgsField
)
from PyQt5.QtCore import QVariant

# Punktkoordinaten (Längengrad, Breitengrad)
coordinatepairs = (
    (10.170385,54.336271),
    (10.166104, 54.336526)
)

# Memory-Layer erstellen
layer = QgsVectorLayer("Point?crs=EPSG:4326", "Startpunkt", "memory")
prov = layer.dataProvider()

# Attributfeld hinzufügen (z. B. für Walk_ID)
prov.addAttributes([QgsField("Walk_ID", QVariant.String)])
layer.updateFields()

for i, (lon, lat) in enumerate(coordinatepairs):
    # Feature mit Punkt und Attribut erstellen
    feat = QgsFeature()
    feat.setGeometry(QgsGeometry.fromPointXY(QgsPointXY(lon, lat)))
    feat.setAttributes([f"Start_{i}"])
    prov.addFeature(feat)

# Layer aktualisieren und zur Karte hinzufĂźgen
layer.updateExtents()
QgsProject.instance().addMapLayer(layer)


# Name des Layers wie in QGIS (muss exakt Ăźbereinstimmen)
layer_name = "Startpunkt"

# Layer-Objekt holen
point_layer = QgsProject.instance().mapLayersByName(layer_name)[0]

# Isochronen berechnen (Distanz: 2000 Meter, Profil: Fußgänger, ohne Fähren)
result = processing.run(
    "ORS Tools:isochrones_from_layer",
    {
        "INPUT_PROVIDER": 0,
        "INPUT_PROFILE": 6,  # foot-walking
        "INPUT_POINT_LAYER": point_layer,
        "INPUT_FIELD": "Walk_ID",
        "INPUT_METRIC": 1,  # 1 = Distanz
        "INPUT_RANGES": "2000",
        "INPUT_SMOOTHING": None,
        "LOCATION_TYPE": 0,  # Startpunkt
        "INPUT_AVOID_FEATURES": [],
        "INPUT_AVOID_BORDERS": None,
        "INPUT_AVOID_COUNTRIES": "",
        "INPUT_AVOID_POLYGONS": None,
        "OUTPUT": "memory:"  # temporärer Layer
    }
)

# Ergebnis-Layer zur Karte hinzufĂźgen
QgsProject.instance().addMapLayer(result["OUTPUT"])

Forum Topic Link

No response

jannefleischer avatar Jun 10 '25 12:06 jannefleischer

This is indeed funny, thanks for reporting it! ❤️

The issue is evident in the maps client as well, see the link.

Apparently the first routing graph edge to which the isochrone center snaps to is taken as a whole regardless the isochrone limit, and only subsequent edges are split accordingly. In the example the OSM way 564107872 representing the ferry connection corresponds to a very long edge. A similar thing happens for long way segments stretching across land, like here.

Image Image Image

aoles avatar Aug 05 '25 10:08 aoles