nilsnolde / docker-valhalla

This is our flexible Docker repository for the Valhalla routing engine
MIT License
257 stars 74 forks source link

Not seeing date_time in response #173

Open openworldza opened 1 week ago

openworldza commented 1 week ago

Hello,

I've started migrating to docker-valhalla from a stand-alone deployment. When comparing the results I don't see the date_time field in the response. I'm creating a custom Docker image based off ghcr.io/gis-ops/docker-valhalla/valhalla:latest as I need to include the tiles in the image. What could cause of date_time being missing in the response?

ARG VALHALLA_BUILDER_IMAGE=ghcr.io/gis-ops/docker-valhalla/valhalla:latest

ENV CUSTOM_FILES="/custom_files"
ENV serve_tiles=False
ENV do_timezones=True
ENV build_tar=True
ENV MERGED_FILE="merged.osm.pbf"
ADD ./entrypoint.sh /

RUN sudo apt-get update && \
  sudo apt-get -y upgrade && \
  sudo apt-get -y install osmium-tool wget jq

ADD ./custom_files/merged.osm.pbf ${CUSTOM_FILES}/merged.osm.pbf

RUN /valhalla/scripts/run.sh build_tiles
RUN sudo valhalla_build_admins --config ${CUSTOM_FILES}/valhalla.json ${CUSTOM_FILES}/${MERGED_FILE}
RUN sudo mkdir ${CUSTOM_FILES}/timezone_data && \
  sudo sh -c "valhalla_build_timezones > ${CUSTOM_FILES}/timezone_data/timezones.sqlite"

RUN sudo sh -c "jq .'service_limits.auto.max_locations=120' ${CUSTOM_FILES}/valhalla.json | sponge ${CUSTOM_FILES}/valhalla.json" && \
  sudo sh -c "jq .'service_limits.auto.max_matrix_location_pairs=14400' ${CUSTOM_FILES}/valhalla.json | sponge ${CUSTOM_FILES}/valhalla.json" && \
  sudo sh -c "jq .'service_limits.bicycle.max_locations=120' ${CUSTOM_FILES}/valhalla.json | sponge ${CUSTOM_FILES}/valhalla.json" && \
  sudo sh -c "jq .'service_limits.bikeshare.max_locations=120' ${CUSTOM_FILES}/valhalla.json | sponge ${CUSTOM_FILES}/valhalla.json" && \
  sudo sh -c "jq .'service_limits.bus.max_locations=120' ${CUSTOM_FILES}/valhalla.json | sponge ${CUSTOM_FILES}/valhalla.json" && \
  sudo sh -c "jq .'service_limits.motorcycle.max_locations=120' ${CUSTOM_FILES}/valhalla.json | sponge ${CUSTOM_FILES}/valhalla.json" && \
  sudo sh -c "jq .'service_limits.pedestrian.max_locations=120' ${CUSTOM_FILES}/valhalla.json | sponge ${CUSTOM_FILES}/valhalla.json" && \
  sudo sh -c "jq .'service_limits.taxi.max_locations=120' ${CUSTOM_FILES}/valhalla.json | sponge ${CUSTOM_FILES}/valhalla.json" && \
  sudo sh -c "jq .'service_limits.truck.max_locations=120' ${CUSTOM_FILES}/valhalla.json | sponge ${CUSTOM_FILES}/valhalla.json"

RUN sudo rm ${CUSTOM_FILES}/*.osm.pbf

RUN sudo chown -R valhalla:valhalla ${CUSTOM_FILES}/
USER valhalla
EXPOSE 8002
ENTRYPOINT ["/entrypoint.sh"]

Request:

{
  "costing": "auto",
  "directions_type": "instructions",
  "waiting": 60000000,
  "date_time": {
    "type": 1,
    "value": "2024-11-25T08:00"
  },
  "locations": [
    { "lon": 27.9654275, "lat": -26.1845344, "waiting": 1200 },
    { "lon": 27.9702964, "lat": -26.1097757, "waiting": 1200 },
    { "lon": 27.9654275, "lat": -26.1845344 },
    { "lon": 27.9837783, "lat": -26.1451922 },
    { "lon": 27.973732, "lat": -26.1322258 },
    { "lon": 28.0084533, "lat": -26.148754 }
  ]
}

Response snippets: Old server:

{
    "trip": {
        "locations": [
            {
                "type": "break",
                "lat": -26.184534,
                "lon": 27.965427,
                "date_time": "2024-11-25T08:00",
                "side_of_street": "left",
                "original_index": 0
            },
            {
                "type": "break",
                "lat": -26.109775,
                "lon": 27.970296,
                "date_time": "2024-11-25T08:33",
                "waiting": 1200,
                "side_of_street": "left",
                "original_index": 1
            },
            {
                "type": "break",
                "lat": -26.184534,
                "lon": 27.965427,
                "date_time": "2024-11-25T08:47",
                "side_of_street": "right",
                "original_index": 2
            },
            {
                "type": "break",
                "lat": -26.145192,
                "lon": 27.983778,
                "date_time": "2024-11-25T08:55",
                "side_of_street": "left",
                "original_index": 3
            },
            {
                "type": "break",
                "lat": -26.132225,
                "lon": 27.973732,
                "date_time": "2024-11-25T08:59",
                "side_of_street": "left",
                "original_index": 4
            },

Docker valhalla instance:

{
    "trip": {
        "locations": [
            {
                "type": "break",
                "lat": -26.184534,
                "lon": 27.965427,
                "date_time": "2024-11-25T08:00",
                "side_of_street": "left",
                "original_index": 0
            },
            {
                "type": "break",
                "lat": -26.109775,
                "lon": 27.970296,
                "waiting": 1200,
                "side_of_street": "left",
                "original_index": 1
            },
            {
                "type": "break",
                "lat": -26.184534,
                "lon": 27.965427,
                "side_of_street": "right",
                "original_index": 2
            },
            {
                "type": "break",
                "lat": -26.145192,
                "lon": 27.983778,
                "side_of_street": "left",
                "original_index": 3
            },
            {
                "type": "break",
                "lat": -26.132225,
                "lon": 27.973732,
                "side_of_street": "left",
                "original_index": 4
            },

Docker valhalla startup:

2024/11/20 19:35:02.732663 [INFO] Tile extract successfully loaded with tile count: 44
2024/11/20 19:35:02.737118 [INFO] Tile extract successfully loaded with tile count: 44
2024/11/20 19:35:02.754757 [WARN] (stat): /custom_files/traffic.tar No such file or directory
2024/11/20 19:35:02.754759 [WARN] (stat): /custom_files/traffic.tar No such file or directory
2024/11/20 19:35:02.754787 [WARN] Traffic tile extract could not be loaded
2024/11/20 19:35:02.754800 [WARN] Traffic tile extract could not be loaded
CommanderStorm commented 3 days ago

Could you try if increasing max_timedep_distance works?