Topics:

Bicycling

If you are not yet familiar with GraphQL and GraphiQL it is highly recommended to review those pages at first.

The Routing API provides a few bicycle related query types:

  • Query type plan can be used to query bicycling routes using either a city bike or your personal bike
  • Query types bikeRentalStation and bikeRentalStations can be used to query city bike rental stations and bikes that are available
  • Query types bikePark and bikeParks can be used to query bike parks that are available

Note: For more details about these query types you can use the Documentation Explorer provided in GraphiQL.

City bikes

Note: City bike API data is realtime and it is always up to date.

https://www.velotm.ro

Query examples

Note: If the examples provided with an ID do not return what is expected then the ID in question may not be in use any more and you should try again with an existing ID.

All available city bike stations

  1. Click this link to run the query below in GraphiQL. It should fetch all available city bike stations.
{
  bikeRentalStations {
    name
    stationId
  }
}
  1. Press play in GraphiQL to execute the query.

Single city bike station and its current bike availability details

  1. Click this link to run the query below in GraphiQL. It should fetch the city bike station and its current bike availability details.
{
  bikeRentalStation(id:"22") {
    stationId
    name
    bikesAvailable
    spacesAvailable
    lat
    lon
    allowDropoff
  }
}
  1. Press play in GraphiQL to execute the query.

All available bike parks

  1. Click this link to run the query below in GraphiQL. It should fetch all available bike parks.
{
  bikeParks {
    bikeParkId
    name
  }
}
  1. Press play in GraphiQL to execute the query.

Single bike park

  1. Click this link to run the query below in GraphiQL. It should fetch the bike park and its current space availability details.
{
  bikePark(id: "906") {
    bikeParkId
    name
    spacesAvailable
    lat
    lon
  }
}
  1. Press play in GraphiQL to execute the query.

Plan an itinerary from Complexul Studentesc to Iulius Town using city bike rental

  • Bike rental can be used by adding qualifier RENT to transportModes argument

    • Note that field mode in the results does not include information about qualifiers
  • Click this link to run the query below in GraphiQL. It should plan an itinerary using city bike rental and show which rental stations are used.
{
  plan(
    fromPlace: "Complex Studentesc::45.748078,21.236596",
    toPlace: "Iulius Town::45.766413, 21.227519",
    numItineraries: 1,
    transportModes: [{mode: BICYCLE, qualifier: RENT}, {mode: WALK}],
  ) {
    itineraries{
      walkDistance
      duration
      legs {
        mode
        startTime
        endTime
        from {
          lat
          lon
          name
          bikeRentalStation {
            stationId
            name
          }
        }
        to {
          lat
          lon
          name
          bikeRentalStation {
            stationId
            name
          }
        }
        distance
        legGeometry {
          length
          points
        }
      }
    }
  }
}
  1. Press play in GraphiQL to execute the query.

Plan an itinerary from Shoping City to Dumbravita riding your personal bike

  • Note that transport mode WALK must not be used when planning an itinerary with personal bike, as otherwise the whole journey is done by walking
  • Click this link to run the query below in GraphiQL. It should fetch bicycle route from Kamppi to Pisa.
{
  plan(
    fromPlace: "Shopping City::45.725141,21.200891",
    toPlace: "Dumbravita::45.786172,21.237509",
    transportModes: {mode: BICYCLE}
  ) {
    itineraries{
      walkDistance
      duration
      legs {
        mode
        startTime
        endTime
        from {
          lat
          lon
          name
        }
        to {
          lat
          lon
          name
        }
        distance
        legGeometry {
          length
          points
        }
      }
    }
  }
}
  1. Press play in GraphiQL to execute the query.

Plan an itinerary from Giroc to Ghiroda and use your personal bike for the first part of the journey

  • Using qualifier PARK for BICYCLE mode plans an itinerary, which begins by bicycling to a bike park from which the journey is continued by public transportation
  • Click this link to run the query below in GraphiQL.
{
  plan(
    fromPlace: "Giroc::45.699270,21.235142",
    toPlace: "Ghiroda::45.764336,21.295344",
    numItineraries: 1,
    transportModes: [{mode: BICYCLE, qualifier: PARK}, {mode: WALK}, {mode: TRANSIT}],
  ) {
    itineraries{
      walkDistance
      duration
      legs {
        mode
        startTime
        endTime
        from {
          lat
          lon
          name
          stop {
            gtfsId
            code
            name
          }
        }
        to {
          lat
          lon
          name
          bikePark {
            bikeParkId
            name
          }
          stop {
            gtfsId
            code
            name
          }
        }
        trip {
          routeShortName
          tripHeadsign
        }
        distance
        legGeometry {
          length
          points
        }
      }
    }
  }
}
  1. Press play in GraphiQL to execute the query.

Plan an itinerary from Stadion to Pasajul Jiul using personal bike and optimizing for safety

  • Argument optimize: SAFE can be used to set preference for safer routes, i.e. avoid crossing streets and use bike paths when possible
  • Click this link to run the query below in GraphiQL.
{
  plan(
    fromPlace: "45.744620,21.246866"
    toPlace: "45.751619,21.216655"
    transportModes: [{mode: BICYCLE}]
    optimize: SAFE
  ) {
    itineraries {
      legs {
        mode
        duration
        distance
        legGeometry {
          points
        }
      }
    }
  }
}
  1. Press play in GraphiQL to execute the query.