Skip to content

problem for GTFS #1973

Closed
Closed

Description

@Datn1298

Hello Graphhopper Team

I follow all below step:
wget -O gtfs-vbb.zip http://transitfeeds.com/p/verkehrsverbund-berlin brandenburg/213/latest/download
wget http://download.geofabrik.de/europe/germany/brandenburg-latest.osm.pbf
./graphhopper.sh build

java -Xmx8g -Xms8g
-Ddw.graphhopper.datareader.file=brandenburg-latest.osm.pbf
-Ddw.graphhopper.gtfs.file=gtfs-vbb.zip
-Ddw.graphhopper.graph.flag_encoders=pt
-Ddw.graphhopper.graph.location=./graph-cache
-jar web/target/graphhopper-web-*.jar server config.yml

Then i get problem:
java.lang.IllegalArgumentException: entry in encoder list not supported pt
at com.graphhopper.routing.util.DefaultFlagEncoderFactory.createFlagEncoder(DefaultFlagEncoderFactory.java:60)
at com.graphhopper.routing.util.EncodingManager.parseEncoderString(EncodingManager.java:393)
at com.graphhopper.routing.util.EncodingManager$Builder.addAll(EncodingManager.java:190)
at com.graphhopper.GraphHopper.createEncodingManager(GraphHopper.java:572)
at com.graphhopper.GraphHopper.init(GraphHopper.java:517)
at com.graphhopper.http.GraphHopperManaged.(GraphHopperManaged.java:90)
at com.graphhopper.http.GraphHopperBundle.run(GraphHopperBundle.java:201)
at com.graphhopper.http.GraphHopperBundle.run(GraphHopperBundle.java:55)
at io.dropwizard.setup.Bootstrap.run(Bootstrap.java:200)
at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:42)
at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:87)
at io.dropwizard.cli.Cli.run(Cli.java:78)
at io.dropwizard.Application.run(Application.java:93)
at com.graphhopper.http.GraphHopperApplication.main(GraphHopperApplication.java:36)

Pls help me

Activity

  1. changed the title [-]hello Graphhopper team[/-] [+]problem from GTFS[/+] on Mar 29, 2020
  2. karussell commented on Mar 30, 2020

    @karussell
    Member

    Ah, this is ugly. Thanks for reporting. There seems to be multiple issues. One is like #1921.

    Can you try the following command:

    java -Xmx8g -Xms8g -jar web/target/graphhopper-web-*.jar server config.yml

    With the following config.yml:

    graphhopper:
    
      datareader.file: brandenburg-latest.osm.pbf 
      gtfs.file: gtfs-vbb.zip
      graph.location: graph-cache
      graph.flag_encoders: foot
    
      profiles: 
        - name: foot
          vehicle: foot
          weighting: fastest
    
      profiles_ch: []
    
      # avoid being stuck in a (oneway) subnetwork, see https://discuss.graphhopper.com/t/93
      prepare.min_network_size: 200
      prepare.min_one_way_network_size: 200
    
    # Dropwizard server configuration
    server:
      application_connectors:
      - type: http
        port: 8989
        # for security reasons bind to localhost
        bind_host: localhost
      request_log:
          appenders: []
      admin_connectors:
      - type: http
        port: 8990
        bind_host: localhost
    # See https://www.dropwizard.io/1.3.8/docs/manual/configuration.html#logging
    logging:
      appenders:
      - type: file
        time_zone: UTC
        current_log_filename: logs/graphhopper.log
        log_format: "%d{YYYY-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"
        archive: true
        archived_log_filename_pattern: ./logs/graphhopper-%d.log.gz
        archived_file_count: 30
        never_block: true
      - type: console
        time_zone: UTC
        log_format: "%d{YYYY-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"

    TODOs:

    • fix NPE if profiles entry is removed (should we throw an exception?) and what about an empty list ala profiles: []?
    • fix NPE in GraphHopperGtfs.close (if gtfsStorage wasn't initialized close should be ignored)
    • if flag encoder is set to foot, still pt and foot should be available as "profiles".
  3. karussell commented on Mar 30, 2020

    @karussell
    Member

    The best idea is always to use the latest stable release 0.13 plus its documentation: https://github.com/graphhopper/graphhopper/tree/0.13/reader-gtfs (make sure you switch to the 0.13 git branch and run ./graphhopper.sh clean before)

  4. easbar commented on Mar 30, 2020

    @easbar
    Member

    And better remove the graph-cache folder as well

  5. added this to the 1.0 milestone on Mar 30, 2020
  6. changed the title [-]problem from GTFS[/-] [+]problem for GTFS[/+] on Mar 30, 2020
  7. michaz commented on Apr 7, 2020

    @michaz
    Member

    Fixed by 07009b0

    I think the answer was in the code comment already: We shouldn't require a profile. At least not when using transit.

    Transit just isn't included in the profiles concept so far. In the current state, pt isn't a profile, and it doesn't use profiles. It can route (internally) via foot because foot is a FlagEncoder, not because it is a profile.

    As long as FlagEncoders still exist as something in the config, we shouldn't pretend we need a profile when we really don't.

    I see that pt will have something to do with profiles soon, but at the moment it is less wrong if we don't require a profile to be there.

    I removed the validation exception that requires a profile to be there for now. The router will know when it tries to find a profile in the empty list.

  8. michaz commented on Apr 7, 2020

    @michaz
    Member

    Oh, and the README was wrong. Pt isn't a flag encoder. That was loooong ago..

  9. karussell commented on May 25, 2020

    @karussell
    Member

    The quickstart still needs a change (see discussion):

    • remove profiles section
    • remove profiles_ch section
    • include gtfs.file: "" (we can do that change permanently)
  10. karussell commented on May 25, 2020

    @karussell
    Member

    remove profiles section
    remove profiles_ch section

    Or is there a way we can overwrite it via a command line argument? Like -Ddw.graphhopper.profiles=[]? The only ugly workaround I found so far is to replace vehicle=car with foot via

    -Ddw.graphhopper.profiles[0].name=foot -Ddw.graphhopper.profiles[0].vehicle=foot -Ddw.graphhopper.profiles_ch[0]=foot
    

    without editing the config.yml.

  11. michaz commented on May 26, 2020

    @michaz
    Member

    Let's provide an example config for transit.

    (I don't want to immediately teach new users patching parameters on the command line as the normal thing to do. The normal thing to do is write a config.)

  12. cartogreaves commented on Jun 1, 2020

    @cartogreaves

    Hi, wondering what the progress is with the GTFS reader support in V1.0.0.
    Is there any further documentation that addresses the bugs above? Is the plan to integrate this as a routing profile, so that it can be used much like any other mode of transport? Any info would be great.

  13. michaz commented on Jun 2, 2020

    @michaz
    Member

    Updated the README

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