Skip to content

Truck profile #223

Closed
Closed

Description

@karussell

Create a truck profile which is configurable

See this discussion

Activity

  1. sanga commented on Aug 7, 2016

    @sanga

    Any news on this? You have this (or something like it) internally I suppose, and I think I read somewhere that implied that it might get open sourced (here I guess it was: https://discuss.graphhopper.com/t/bus-flag-encoder-on-graphhopper-com/796/5)

  2. karussell commented on Aug 7, 2016

    @karussell
    MemberAuthor

    No, but it will get easy/easier after we finish the work with configurable vehicle profiles #730

    Regarding what is open source (and what will be) you can read #131 and https://graphhopper.com/#os-comparison

  3. sanga commented on Aug 7, 2016

    @sanga

    OK, understood. Thanks for the quick response.

  4. karussell commented on Jan 16, 2017

    @karussell
    MemberAuthor

    Parts of this are implemented in PR #936

  5. tmnguyen-swin commented on Feb 2, 2017

    @tmnguyen-swin
    Contributor

    There is one comment I forgot to mention in PR #936 in relation to having multiple configuration flags for road attributes. In my view, I don't think all clients need the full set of encoders. Needs will vary depending on client's usage. As such, most of the encoders (like highwayEncoder, surfaceEncoder, transportModeEncoder, accessEncoder) in DataFlagEncoder should be make configurable independently. Clients will be able to enable/disable encoders for their respective purpose.

  6. karussell commented on Mar 7, 2019

    @karussell
    MemberAuthor

    As such, most of the encoders (like highwayEncoder, surfaceEncoder, transportModeEncoder, accessEncoder) in DataFlagEncoder should be make configurable independently. Clients will be able to enable/disable encoders for their respective purpose.

    This will be fully configurable with #1548

  7. added this to the 1.0 milestone on May 1, 2020
  8. karussell commented on Aug 25, 2022

    @karussell
    MemberAuthor

    To consider special truck-related access and turn restrictions this was possible before only via a small change in Java:

    class TruckFlagEncoder extends CarFlagEncoder {
      
        public TransportationMode getTransportationMode() {
            return TransportationMode.HGV;
        }
         
        public String toString() {
           return "truck";
        }
    }

    With the latest 2 commits (here, here) it is now possible to create a truck via configuration or per request:

    graphhopper:
      ...
      graph.flag_encoders: roads|transportation_mode=HGV,car
      graph.encoded_values: toll,hgv,surface,max_width,max_height
    
      profiles:
        - name: truck
          vehicle: roads
          weighting: custom
          custom_model:
            distance_influence: 1
            speed:
             - if: "true"
               limit_to: "car_average_speed * 0.9"
             - if: "true"
               limit_to: "95"
            priority:
             - if: "car_access == false || hgv == NO || max_width < 3 || max_height < 4"
               multiply_by: "0"

    The RoadsTagParser should be considered a "beta" feature, which will be likely replaced by something better but helps us to explore a greater flexibility with the existing architecture.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions