1

我正在使用 Graphhoper 代码。我在.pbf、 .OSM (Open Street Map) 中有形状文件和 Graphhoper 工作。但我有形状文件,所以我使用 Merkaartor 将形状文件转换为 osm 文件,但在 Graphopper 中使用,但我面临以下错误

INFO: An exception was caught and reported. Message: java.lang.IllegalStateException: osm must not be empty. read 96080 lines and 0 locations
java.lang.IllegalStateException: Couldn't load graph
    at com.graphhopper.http.DefaultModule.configure(DefaultModule.java:84)
    at com.google.inject.AbstractModule.configure(AbstractModule.java:59)
    at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223)
    at com.google.inject.AbstractModule.install(AbstractModule.java:118)
    at com.graphhopper.http.GHServer$1.configure(GHServer.java:117)
    at com.google.inject.AbstractModule.configure(AbstractModule.java:59)
    at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223)
    at com.google.inject.spi.Elements.getElements(Elements.java:101)
    at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:133)
    at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:103)
    at com.google.inject.Guice.createInjector(Guice.java:95)
    at com.google.inject.Guice.createInjector(Guice.java:72)
    at com.google.inject.Guice.createInjector(Guice.java:62)
    at com.graphhopper.http.GHServer.start(GHServer.java:64)
    at com.graphhopper.http.GHServer.main(GHServer.java:50)
Caused by: java.lang.IllegalStateException: osm must not be empty. read 96080 lines and 0 locations
    at com.graphhopper.reader.OSMReader.writeOsm2Graph(OSMReader.java:329)
    at com.graphhopper.reader.OSMReader.readGraph(OSMReader.java:152)
    at com.graphhopper.GraphHopper.importData(GraphHopper.java:668)
    at com.graphhopper.GraphHopper.process(GraphHopper.java:637)
    at com.graphhopper.GraphHopper.importOrLoad(GraphHopper.java:610)
    at com.graphhopper.http.DefaultModule.createGraphHopper(DefaultModule.java:56)
    at com.graphhopper.http.DefaultModule.configure(DefaultModule.java:69)
    ... 14 more

Exception in thread "main" com.google.inject.CreationException: Guice creation errors:

1) Explicit bindings are required and java.lang.Boolean annotated with @com.google.inject.name.Named(value=jsonpAllowed) is not explicitly bound.
  while locating java.lang.Boolean annotated with @com.google.inject.name.Named(value=jsonpAllowed)
    for field at com.graphhopper.http.GHBaseServlet.jsonpAllowed(GHBaseServlet.java:41)
  at com.graphhopper.http.GHServletModule.configureServlets(GHServletModule.java:61)

2) Explicit bindings are required and java.lang.Boolean annotated with @com.google.inject.name.Named(value=jsonpAllowed) is not explicitly bound.
  while locating java.lang.Boolean annotated with @com.google.inject.name.Named(value=jsonpAllowed)
    for field at com.graphhopper.http.GHBaseServlet.jsonpAllowed(GHBaseServlet.java:41)
  at com.graphhopper.http.GHServletModule.configureServlets(GHServletModule.java:64)

3) Explicit bindings are required and java.lang.Boolean annotated with @com.google.inject.name.Named(value=jsonpAllowed) is not explicitly bound.
  while locating java.lang.Boolean annotated with @com.google.inject.name.Named(value=jsonpAllowed)
    for field at com.graphhopper.http.GHBaseServlet.jsonpAllowed(GHBaseServlet.java:41)
  at com.graphhopper.http.GHServletModule.configureServlets(GHServletModule.java:67)

4) Explicit bindings are required and java.lang.Boolean annotated with @com.google.inject.name.Named(value=jsonpAllowed) is not explicitly bound.
  while locating java.lang.Boolean annotated with @com.google.inject.name.Named(value=jsonpAllowed)
    for field at com.graphhopper.http.GHBaseServlet.jsonpAllowed(GHBaseServlet.java:41)
  at com.graphhopper.http.GHServletModule.configureServlets(GHServletModule.java:70)

5) An exception was caught and reported. Message: Couldn't load graph
  at com.graphhopper.http.GHServer$1.configure(GHServer.java:117)

6) Explicit bindings are required and com.graphhopper.GraphHopper is not explicitly bound.
  while locating com.graphhopper.GraphHopper
    for field at com.graphhopper.http.GraphHopperServlet.hopper(GraphHopperServlet.java:56)
  at com.graphhopper.http.GHServletModule.configureServlets(GHServletModule.java:67)

7) Explicit bindings are required and com.graphhopper.http.RouteSerializer is not explicitly bound.
  while locating com.graphhopper.http.RouteSerializer
    for field at com.graphhopper.http.GraphHopperServlet.routeSerializer(GraphHopperServlet.java:56)
  at com.graphhopper.http.GHServletModule.configureServlets(GHServletModule.java:67)

8) Explicit bindings are required and com.graphhopper.util.TranslationMap is not explicitly bound.
  while locating com.graphhopper.util.TranslationMap
    for field at com.graphhopper.http.I18NServlet.map(I18NServlet.java:38)
  at com.graphhopper.http.GHServletModule.configureServlets(GHServletModule.java:61)

9) Explicit bindings are required and com.graphhopper.GraphHopper is not explicitly bound.
  while locating com.graphhopper.GraphHopper
    for field at com.graphhopper.http.InfoServlet.hopper(InfoServlet.java:42)
  at com.graphhopper.http.GHServletModule.configureServlets(GHServletModule.java:64)

10) Explicit bindings are required and com.graphhopper.GraphHopper is not explicitly bound.
  while locating com.graphhopper.GraphHopper
    for field at com.graphhopper.http.NearestServlet.hopper(NearestServlet.java:40)
  at com.graphhopper.http.GHServletModule.configureServlets(GHServletModule.java:70)

10 errors
    at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:435)
    at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:154)
    at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:106)
    at com.google.inject.Guice.createInjector(Guice.java:95)
    at com.google.inject.Guice.createInjector(Guice.java:72)
    at com.google.inject.Guice.createInjector(Guice.java:62)
    at com.graphhopper.http.GHServer.start(GHServer.java:64)
    at com.graphhopper.http.GHServer.main(GHServer.java:50)
Caused by: java.lang.IllegalStateException: Couldn't load graph
    at com.graphhopper.http.DefaultModule.configure(DefaultModule.java:84)
    at com.google.inject.AbstractModule.configure(AbstractModule.java:59)
    at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223)
    at com.google.inject.AbstractModule.install(AbstractModule.java:118)
    at com.graphhopper.http.GHServer$1.configure(GHServer.java:117)
    at com.google.inject.AbstractModule.configure(AbstractModule.java:59)
    at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223)
    at com.google.inject.spi.Elements.getElements(Elements.java:101)
    at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:133)
    at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:103)
    ... 5 more
Caused by: java.lang.IllegalStateException: osm must not be empty. read 96080 lines and 0 locations
    at com.graphhopper.reader.OSMReader.writeOsm2Graph(OSMReader.java:329)
    at com.graphhopper.reader.OSMReader.readGraph(OSMReader.java:152)
    at com.graphhopper.GraphHopper.importData(GraphHopper.java:668)
    at com.graphhopper.GraphHopper.process(GraphHopper.java:637)
    at com.graphhopper.GraphHopper.importOrLoad(GraphHopper.java:610)
    at com.graphhopper.http.DefaultModule.createGraphHopper(DefaultModule.java:56)
    at com.graphhopper.http.DefaultModule.configure(DefaultModule.java:69)
    ... 14 more
4

0 回答 0