Find all bus stops of any City

Hi,

I am trying to find all bus stops of any choosen City.

Maybe someone has an Idea :slight_smile:

regards

Nils

Hi @Nils_w,

you could use the pois endpoint and pass the city geometry and bus_stops as filter
There are also some examples in the source repository.

Best regards

1 Like

Hi @amandus ,

is there a way how I can get the city geometry? And does the filter input need to be JSON format like this: {“bus_stops”} ?

best regards

Nils

You have to extract that somewhere else e.g. from OSM and need to pass it as GeoJSON (best simplify the geometry or just take the bbox)

No. Please read the examples and documentation.
E.g. the help button for request:

The category ids can be requested from the endpoint or you can take a look at the this documentation

1 Like

Hey Amandus,

is it like:

Ialways get the “400 Bad Request” error.

Best regards

See above,
you can really just copy paste from that example and change the id

1 Like

grafik

Also this is giving me a bad request.

These are the examples from the documentation:

#### JSON bodies for POST requests
##### Pois around a buffered point
{
  "request": "pois",
  "geometry": {
    "bbox": [
      [8.8034, 53.0756],
      [8.7834, 53.0456]
    ],
    "geojson": {
      "type": "Point",
      "coordinates": [8.8034, 53.0756]
    },
    "buffer": 250
  }
}

##### Pois given categories
{
  "request": "pois",
  "geometry": {
    "bbox": [
      [8.8034, 53.0756],
      [8.7834, 53.0456]
    ],
    "geojson": {
      "type": "Point",
      "coordinates": [8.8034, 53.0756]
    },
    "buffer": 100
  },
  "limit": 200,
  "filters": {
    "category_ids": [180, 245]
  }
}

##### Pois given category groups
{
  "request": "pois",
  "geometry": {
    "bbox": [
      [8.8034, 53.0756],
      [8.7834, 53.0456]
    ],
    "geojson": {
      "type": "Point",
      "coordinates": [8.8034, 53.0756]
    },
    "buffer": 100
  },
  "limit": 200,
  "filters": {
    "category_group_ids": [160]
  }
}

##### Pois statistics
{
  "request": "stats",
  "geometry": {
    "bbox": [
      [8.8034, 53.0756],
      [8.7834, 53.0456]
    ],
    "geojson": {
      "type": "Point",
      "coordinates": [8.8034, 53.0756]
    },
    "buffer": 100
  }
}

##### Pois categories as a list
{
    "request": "list"
}

This is the example you are looking for:


##### Pois given categories
{
  "request": "pois",
  "geometry": {
    "bbox": [
      [8.8034, 53.0756],
      [8.7834, 53.0456]
    ],
    "geojson": {
      "type": "Point",
      "coordinates": [8.8034, 53.0756]
    },
    "buffer": 100
  },
  "limit": 200,
  "filters": {
    "category_ids": [180, 245]
  }
}

This is the category id for bus_stop : 588
How it would look like in a request:
"filters":{"category_ids":[588]}
Is that still giving bad request?

2 Likes

Well,
this seems to work but my polygon geometry is too large.

What are the restrictions on that?

best regards

Oh ok it is 50sqkm

London is a little too big :wink: