mfdz / OpenTripPlanner

MFDZ (HSLdevcom/)OpenTripPlanner clone supporting Carpooling.
http://www.opentripplanner.org
Other
5 stars 4 forks source link

From.name and to.name are null for FLEX trips #92

Closed leonardehrenfried closed 3 years ago

leonardehrenfried commented 3 years ago

In the following GraphQL trip from.name and to.name are null.

query{
  plan(
    date: "2021-06-03"
    time: "22:30"
    from: { lat:  48.6226, lon: 8.8879 }
    to: { lat: 48.5755, lon: 8.8795 }
    transportModes: [
      { mode: RAIL },
      { mode: FLEX, qualifier: EGRESS },
      { mode: FLEX, qualifier: DIRECT },
      { mode: WALK },
    ],
    maxWalkDistance: 5000
  ) {
    itineraries {
      legs {
        mode
        rentedBike
        distance
        startTime
        endTime

        pickupBookingInfo {
          message
          contactInfo {
            phoneNumber
            infoUrl
            bookingUrl
          }
        }
        route {
          url
          mode
          shortName
        }
        trip {
          gtfsId
          tripShortName
        }
        from {
          name
          bikeRentalStation {
            name
            id
          }
        }
        to {
          name
          bikeRentalStation {
            name
            id
          }
        }
      }
    }
  }
}
flaktack commented 3 years ago

The flex Locations in locations.geojson don't have any properties, only an id, which is why there is no name: https://github.com/OneBusAway/onebusaway-gtfs-modules/blob/627ee8dd49cd23e52f0c564a38d20fbf0eaf14ee/onebusaway-gtfs/src/main/java/org/onebusaway/gtfs/serialization/LocationsGeoJSONReader.java#L52

hbruch commented 3 years ago

Looking into the spec, I wonder if it should not rather read the name from the property stop_name?

derhuerst commented 3 years ago

In https://github.com/derhuerst/generate-herrenberg-gtfs-flex/commit/89304366ce1438fa76131fe47ff794d096ee5239, I have added name, stop_name and stop_desc to each location area.