Searching bus stops along route

Hi,

I’m trying to use openpoiservice to locate all bus stops and stations (category ids 587 and 588) along a route (linestring), but I don’t see any results. It seems to work fine for other category ids under “transport”.

For example, request:

curl -X "POST" "https://api.openrouteservice.org/pois?api_key=..." \
    -H 'Content-Type: application/json' \
    -d $'{
  "filters": {
    "category_ids": [
      587
    ]
  },
  "geometry": {
    "geojson": {
      "type": "LineString",
      "coordinates": [
        [8.800672,53.078612],[8.800748,53.078682],[8.801021,53.078871],[8.801418,53.079074],[8.801865,53.079283],
        [8.802125,53.079402],[8.802557,53.079612],[8.80298,53.079823],[8.803096,53.079886],[8.803136,53.079906],
        [8.803149,53.079945],[8.80313,53.080004],[8.803057,53.080028],[8.802997,53.080029],[8.802744,53.079874],
        [8.802538,53.079767],[8.802296,53.07964],[8.800948,53.079004],[8.800882,53.078973],[8.800798,53.078935],
        [8.800596,53.078818],[8.800539,53.078787],[8.800517,53.078774],[8.800472,53.07875],[8.800446,53.078736],
        [8.80047,53.078714],[8.80055,53.078641],[8.800661,53.078601],[8.800708,53.078565],[8.801572,53.078074],
        [8.801766,53.077966],[8.802075,53.077792],[8.80213,53.07776],[8.802302,53.077661],[8.802502,53.077542],
        [8.802697,53.077383],[8.802733,53.077353],[8.80279,53.077315],[8.802954,53.077203],[8.803536,53.076778],
        [8.803603,53.076716],[8.803646,53.076663],[8.803776,53.076508],[8.803942,53.07637],[8.804088,53.07616],
        [8.804143,53.076066],[8.804189,53.075987],[8.804311,53.075758],[8.804325,53.075624],[8.804403,53.075469],
        [8.804417,53.07545],[8.804472,53.075374],[8.804555,53.07526],[8.804561,53.075254],[8.804675,53.075154],
        [8.804749,53.075017],[8.804764,53.074983],[8.804811,53.074877],[8.804839,53.074811],[8.804882,53.074711],
        [8.804962,53.0746],[8.805091,53.074466],[8.805217,53.074356],[8.805411,53.074204],[8.805609,53.074062],
        [8.806065,53.073749],[8.806253,53.073617]
      ]
    },
    "buffer": 200
  },
  "request": "pois",
  "limit": 200
}'

…returns empty features. Category id 601 (parking) yields plenty of results.

– Topias

Greetings @topekan,

as we are consuming OpenStreetMap data it may very well be the case that this data is missing. To this end, I’d like to ask you to check https://openstreetmap.org first and let us know if there are actually bus stops in this polygon. If they are, we’ll investigate further.

Does this make sense?

Thank you, Tim

Hi @Timothy,

Many thanks for your answer. As you suggested, I have checked OpenStreetMaps (see https://www.openstreetmap.org/directions?engine=osrm_car&route=53.07842%2C8.80092%3B53.07648%2C8.80379#map=18/53.07746/8.80237 ) which seems to contain at least couple of bus stops.

Openrouteservicer.org corresponding API query is:

curl -X "POST" "https://api.openrouteservice.org/pois?api_key=..." \
    -H 'Content-Type: application/json' \
    -d $'{
  "filters": {
    "category_ids": [
      587
    ]
  },
  "geometry": {
    "geojson": {
      "type": "LineString",
      "coordinates": [
        [8.800708,53.078565],[8.801572,53.078074],[8.801766,53.077966],
        [8.802075,53.077792],[8.80213,53.07776],[8.802302,53.077661],
        [8.802502,53.077542],[8.802697,53.077383],[8.802733,53.077353],
        [8.80279,53.077315],[8.802954,53.077203],[8.803536,53.076778],
        [8.803603,53.076716],[8.803646,53.076663],[8.803776,53.076508]
      ]
    },
    "buffer": 200
  },
  "request": "pois",
  "limit": 200
}'

…returning empty features.

Thanks,

Topias

Hi @topekan,

thanks for the digging! I think you’re right. The route you’re describing has only public_transport keys with several tags like platform or stop_position. We don’t consider those yet. Albeit we should.

You can see the keys/tags we use in the service here:

We’ll add this to the next release. Good catch!

Cheers
Nils

Track the progress here:

Thanks guys! And BTW many thanks for great service!

– Topias

@topekan this should now be working, could you give it a try? The category_ids can be found here:

I gave it a quick try and so far it looks promising

{
    "type": "FeatureCollection",
    "bbox": [
        8.799601,
        53.074295,
        8.808646,
        53.080763
    ],
    "features": [
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.801572,
                    53.078074
                ]
            },
            "properties": {
                "osm_id": 768037547,
                "osm_type": 1,
                "distance": 0.03454071,
                "category_ids": {
                    "608": {
                        "category_name": "stop_position",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "name": "Am Brill (Martinistraße), Bussteig D",
                    "wheelchair": "yes"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.804202,
                    53.080531
                ]
            },
            "properties": {
                "osm_id": 35571761,
                "osm_type": 2,
                "distance": 92.70296451,
                "category_ids": {
                    "607": {
                        "category_name": "platform",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "wheelchair": "yes",
                    "name": "Am Wall"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.800289,
                    53.078495
                ]
            },
            "properties": {
                "osm_id": 416834383,
                "osm_type": 1,
                "distance": 23.83315628,
                "category_ids": {
                    "608": {
                        "category_name": "stop_position",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "name": "Am Brill (Bgm.-Smidt-Straße), Bussteig/Gleis A",
                    "wheelchair": "yes"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.808181,
                    53.074561
                ]
            },
            "properties": {
                "osm_id": 817605404,
                "osm_type": 1,
                "distance": 166.51141029,
                "category_ids": {
                    "608": {
                        "category_name": "stop_position",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "name": "Domsheide"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.808253,
                    53.074454
                ]
            },
            "properties": {
                "osm_id": 35667126,
                "osm_type": 2,
                "distance": 163.25364774,
                "category_ids": {
                    "607": {
                        "category_name": "platform",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "name": "Bahnsteig 2",
                    "wheelchair": "yes"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.808646,
                    53.07466
                ]
            },
            "properties": {
                "osm_id": 817605386,
                "osm_type": 1,
                "distance": 197.98739462,
                "category_ids": {
                    "608": {
                        "category_name": "stop_position",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "wheelchair": "yes",
                    "name": "Domsheide"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.80861,
                    53.074601
                ]
            },
            "properties": {
                "osm_id": 67694131,
                "osm_type": 2,
                "distance": 192.26147539,
                "category_ids": {
                    "607": {
                        "category_name": "platform",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "name": "Bussteig 1",
                    "wheelchair": "yes"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.808292,
                    53.074668
                ]
            },
            "properties": {
                "osm_id": 67694133,
                "osm_type": 2,
                "distance": 179.86014656,
                "category_ids": {
                    "607": {
                        "category_name": "platform",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "wheelchair": "yes",
                    "name": "Bussteig A"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.803646,
                    53.080422
                ]
            },
            "properties": {
                "osm_id": 6113855435,
                "osm_type": 1,
                "distance": 57.968184,
                "category_ids": {
                    "608": {
                        "category_name": "stop_position",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "name": "Am Wall"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.803689,
                    53.080311
                ]
            },
            "properties": {
                "osm_id": 416834388,
                "osm_type": 1,
                "distance": 50.6930946,
                "category_ids": {
                    "608": {
                        "category_name": "stop_position",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "name": "Am Wall",
                    "wheelchair": "yes"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.807809,
                    53.074295
                ]
            },
            "properties": {
                "osm_id": 21316819,
                "osm_type": 1,
                "distance": 128.71381151,
                "category_ids": {
                    "608": {
                        "category_name": "stop_position",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "name": "Domsheide"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.803533,
                    53.076781
                ]
            },
            "properties": {
                "osm_id": 2073742751,
                "osm_type": 1,
                "distance": 0.09922154,
                "category_ids": {
                    "608": {
                        "category_name": "stop_position",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "name": "Martinistraße",
                    "wheelchair": "yes"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.80623,
                    53.076738
                ]
            },
            "properties": {
                "osm_id": 62789870,
                "osm_type": 2,
                "distance": 157.24225916,
                "category_ids": {
                    "607": {
                        "category_name": "platform",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "name": "Obernstraße"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.803415,
                    53.076784
                ]
            },
            "properties": {
                "osm_id": 1993705473,
                "osm_type": 1,
                "distance": 5.83089253,
                "category_ids": {
                    "607": {
                        "category_name": "platform",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "name": "Martinistraße",
                    "wheelchair": "yes"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.799946,
                    53.078351
                ]
            },
            "properties": {
                "osm_id": 35571755,
                "osm_type": 2,
                "distance": 51.79757091,
                "category_ids": {
                    "607": {
                        "category_name": "platform",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "name": "Am Brill (Bgm.-Smidt-Straße), Bussteig/Gleis B",
                    "wheelchair": "yes"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.799601,
                    53.078077
                ]
            },
            "properties": {
                "osm_id": 2573585064,
                "osm_type": 1,
                "distance": 89.34267371,
                "category_ids": {
                    "608": {
                        "category_name": "stop_position",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "name": "Am Brill (Bgm.-Smidt-Straße), Bussteig/Gleis B"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.801353,
                    53.078817
                ]
            },
            "properties": {
                "osm_id": 2573585067,
                "osm_type": 1,
                "distance": 18.96539982,
                "category_ids": {
                    "608": {
                        "category_name": "stop_position",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "name": "Am Brill (Hutfilter-/Obernstraße), Bussteig F"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.801096,
                    53.078339
                ]
            },
            "properties": {
                "osm_id": 480770126,
                "osm_type": 1,
                "distance": 0.41572002,
                "category_ids": {
                    "608": {
                        "category_name": "stop_position",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "name": "Am Brill (Martinistraße), Bussteig C",
                    "wheelchair": "yes"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.801674,
                    53.078115
                ]
            },
            "properties": {
                "osm_id": 388565586,
                "osm_type": 1,
                "distance": 7.93981239,
                "category_ids": {
                    "607": {
                        "category_name": "platform",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "wheelchair": "yes",
                    "name": "Am Brill (Martinistraße), Bussteig D"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.801629,
                    53.078779
                ]
            },
            "properties": {
                "osm_id": 62789869,
                "osm_type": 2,
                "distance": 34.15661374,
                "category_ids": {
                    "607": {
                        "category_name": "platform",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "name": "Am Brill (Hutfilter-/Obernstraße), Bussteig F"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.801627,
                    53.078711
                ]
            },
            "properties": {
                "osm_id": 62789868,
                "osm_type": 2,
                "distance": 39.87454118,
                "category_ids": {
                    "607": {
                        "category_name": "platform",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "name": "Am Brill (Hutfilter-/Obernstraße), Bussteig E"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.800977,
                    53.078301
                ]
            },
            "properties": {
                "osm_id": 388565587,
                "osm_type": 1,
                "distance": 9.00862274,
                "category_ids": {
                    "607": {
                        "category_name": "platform",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "wheelchair": "yes",
                    "name": "Am Brill (Martinistraße), Bussteig C"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.800306,
                    53.078485
                ]
            },
            "properties": {
                "osm_id": 2573585065,
                "osm_type": 1,
                "distance": 23.85939402,
                "category_ids": {
                    "608": {
                        "category_name": "stop_position",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "name": "Am Brill (Bgm.-Smidt-Straße), Bussteig/Gleis A"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.80368,
                    53.080327
                ]
            },
            "properties": {
                "osm_id": 2573585068,
                "osm_type": 1,
                "distance": 51.47509172,
                "category_ids": {
                    "608": {
                        "category_name": "stop_position",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "name": "Am Wall"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.804569,
                    53.080753
                ]
            },
            "properties": {
                "osm_id": 2573585069,
                "osm_type": 1,
                "distance": 127.46336645,
                "category_ids": {
                    "608": {
                        "category_name": "stop_position",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "name": "Am Wall"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.808159,
                    53.07452
                ]
            },
            "properties": {
                "osm_id": 35667127,
                "osm_type": 2,
                "distance": 162.53823155,
                "category_ids": {
                    "607": {
                        "category_name": "platform",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "name": "Bahnsteig 3",
                    "wheelchair": "yes"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.806366,
                    53.076594
                ]
            },
            "properties": {
                "osm_id": 2573585074,
                "osm_type": 1,
                "distance": 160.02490529,
                "category_ids": {
                    "608": {
                        "category_name": "stop_position",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "wheelchair": "yes",
                    "name": "Obernstraße"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.804097,
                    53.080583
                ]
            },
            "properties": {
                "osm_id": 35571762,
                "osm_type": 2,
                "distance": 91.37294182,
                "category_ids": {
                    "607": {
                        "category_name": "platform",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "wheelchair": "yes",
                    "name": "Am Wall"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.803509,
                    53.076991
                ]
            },
            "properties": {
                "osm_id": 1993705474,
                "osm_type": 1,
                "distance": 13.67438153,
                "category_ids": {
                    "607": {
                        "category_name": "platform",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "name": "Martinistraße",
                    "wheelchair": "yes"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.803548,
                    53.080473
                ]
            },
            "properties": {
                "osm_id": 6113855434,
                "osm_type": 1,
                "distance": 59.25696321,
                "category_ids": {
                    "607": {
                        "category_name": "platform",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "wheelchair": "limited",
                    "name": "Am Wall"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.808532,
                    53.074664
                ]
            },
            "properties": {
                "osm_id": 3069310717,
                "osm_type": 1,
                "distance": 192.12135958,
                "category_ids": {
                    "608": {
                        "category_name": "stop_position",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "name": "Domsheide"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.800062,
                    53.078273
                ]
            },
            "properties": {
                "osm_id": 35571756,
                "osm_type": 2,
                "distance": 52.44229746,
                "category_ids": {
                    "607": {
                        "category_name": "platform",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "wheelchair": "yes",
                    "name": "Am Brill (Bgm.-Smidt-Straße), Bussteig/Gleis A"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.806013,
                    53.076827
                ]
            },
            "properties": {
                "osm_id": 2573585075,
                "osm_type": 1,
                "distance": 147.66846563,
                "category_ids": {
                    "608": {
                        "category_name": "stop_position",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "name": "Obernstraße",
                    "wheelchair": "yes"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.804544,
                    53.080763
                ]
            },
            "properties": {
                "osm_id": 29194438,
                "osm_type": 1,
                "distance": 126.94309446,
                "category_ids": {
                    "608": {
                        "category_name": "stop_position",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "wheelchair": "yes",
                    "name": "Am Wall"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.801865,
                    53.07868
                ]
            },
            "properties": {
                "osm_id": 2573585066,
                "osm_type": 1,
                "distance": 52.80024996,
                "category_ids": {
                    "608": {
                        "category_name": "stop_position",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "name": "Am Brill (Hutfilter-/Obernstraße), Bussteig E"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.803413,
                    53.077001
                ]
            },
            "properties": {
                "osm_id": 2073742840,
                "osm_type": 1,
                "distance": 9.38967927,
                "category_ids": {
                    "608": {
                        "category_name": "stop_position",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "wheelchair": "yes",
                    "name": "Martinistraße"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.799615,
                    53.078069
                ]
            },
            "properties": {
                "osm_id": 29194426,
                "osm_type": 1,
                "distance": 89.32034958,
                "category_ids": {
                    "608": {
                        "category_name": "stop_position",
                        "category_group": "transport"
                    }
                },
                "osm_tags": {
                    "name": "Am Brill (Bgm.-Smidt-Straße), Bussteig/Gleis B",
                    "wheelchair": "yes"
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    8.806145,
                    53.076682
                ]
            },
            "properties": {
                "osm_id": 62789871,
                "osm_type": 2,
                "distance": 149.5475419,
                "category_ids": {
                    "607": {
                        "category_name": "platform",
                        "category_group": "transport"
                ...
            ...