integration with parcoursmob
Some checks failed
Build and Push Docker Image / build_and_push (push) Failing after 2m23s

This commit is contained in:
2025-03-25 15:07:39 +01:00
parent d465ef56c9
commit 4718de6c80
10 changed files with 739 additions and 489 deletions

View File

@@ -58,6 +58,23 @@ func (h *CarpoolServiceHandler) CreateRegularRoutes(routes []*geojson.FeatureCol
return nil
}
func (h *CarpoolServiceHandler) GetUserRegularRoutes(userid string) ([]*geojson.FeatureCollection, error) {
routes, err := h.Storage.GetUserRegularRoutes(userid)
if err != nil {
log.Error().Err(err).Msg("error in storage - GetUserRegularRoutes")
return nil, err
}
return routes, nil
}
func (h *CarpoolServiceHandler) DeleteRegularRoutes(ids []string) (err error) {
err = h.Storage.DeleteRegularRoutes(ids)
if err != nil {
log.Error().Err(err).Msg("error deleteing regular routes")
}
return err
}
// GetUserPlanning returns the planned routes for a user between 2 dates. It transforms regular routes to multiple indivual planned route schedules
func (h *CarpoolServiceHandler) GetUserPlanning(userid string, minDepartureDate time.Time, maxDepartureDate time.Time) (planned_schedules map[string][]internal.PlannedRouteSchedule, missing_planning bool, err error) {
log.Debug().

View File

@@ -12,7 +12,6 @@ import (
// GetDriverJourneys searches for matching punctual planned driver journeys.
func (h *CarpoolServiceHandler) GetDriverJourneys(departure orb.Point, arrival orb.Point, departureRadius *float64, arrivalRadius *float64, minDate time.Time, maxDate time.Time, count *int64) ([]internal.PlannedRouteSchedule, error) {
log.Debug().
Any("departure", departure).
Any("arrival", arrival).
@@ -62,7 +61,7 @@ func (h *CarpoolServiceHandler) GetDriverJourneys(departure orb.Point, arrival o
distanceFromArrival, indexArrival := geoutils.DistanceFromLineString(arrival, ls)
if indexArrival >= indexDeparture && distanceFromDeparture <= drad && distanceFromArrival <= arad {
//routePoints := []orb.Point{r.Route.Features[0].Point(), departure, arrival, r.Route.Features[1].Point()}
// routePoints := []orb.Point{r.Route.Features[0].Point(), departure, arrival, r.Route.Features[1].Point()}
routePoints := []orb.Point{r.Route.Features[0].Point(), departure, arrival, r.Route.Features[1].Point()}
log.Debug().Any("route points", routePoints).Msg("calculate multipoint route")
itinerary, err := h.Routing.Route(routePoints)
@@ -96,7 +95,6 @@ func (h *CarpoolServiceHandler) GetDriverJourneys(departure orb.Point, arrival o
// GetPassengerJourneys searches for matching punctual planned passenger journeys.
func (h *CarpoolServiceHandler) GetPassengerJourneys(departure orb.Point, arrival orb.Point, departureRadius *float64, arrivalRadius *float64, minDate time.Time, maxDate time.Time, count *int64) ([]internal.PlannedRouteSchedule, error) {
log.Debug().
Any("departure", departure).
Any("arrival", arrival).