Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not seeing date_time in response #173

Open
openworldza opened this issue Nov 20, 2024 · 1 comment
Open

Not seeing date_time in response #173

openworldza opened this issue Nov 20, 2024 · 1 comment

Comments

@openworldza
Copy link

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
Copy link

Could you try if increasing max_timedep_distance works?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants