首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在GraphHopper中不起作用的转弯限制

在GraphHopper中不起作用的转弯限制
EN

Stack Overflow用户
提问于 2015-04-29 11:57:07
回答 1查看 761关注 0票数 1

使用GraphHopper 0.4.0,我无法启用car + bike2 + foot和turnCosts=true --我系统地得到了一个错误,我只能使用2种模式。

但是在GraphHopper 0.4.1和0.5GraphHopper-web-0.5-20150422.180133-28 bin的情况下,转弯限制在最终图形中根本没有考虑,不管车辆的数量是多少,但是在超过2种模式的情况下,仍然有第一个错误。

那么,如何增加国旗呢?

另外,如果将一种方式设置为私有,GraphHopper将不会考虑使用标记,并且在0.4或0.5中都使用它。

配置文件

代码语言:javascript
复制
##### Vehicles #####
#
# Possible options: car,foot,bike,bike2,mtb,racingbike,motorcycle (comma separated)
# bike2 takes elevation data into account (like up-hill is slower than down-hill)
# and requires enabling graph.elevation.provider below
graph.flagEncoders=bike2,foot

# Enable turn restrictions for car or motorcycle. 
# Currently you need to additionally set prepare.chWeighting=no before using this (see below and #270)
graph.flagEncoders=foot,bike2|turnCosts=true

#osmreader.bytesForFlags=8
#osmreader.acceptWay=car,bike,foot


##### Elevation #####
#
# To populate your graph with elevation data use SRTM, default is noop
graph.elevation.provider=srtm
#
# default location for cache is /tmp/srtm
# graph.elevation.cachedir=./srtmprovider/
#
# If you have a slow disk or plenty of RAM change the default MMAP to:
# graph.elevation.dataaccess=RAM_STORE



##### Storage #####
#
# configure the memory access, use RAM_STORE for well equipped servers, 
# MMAP_STORE_SYNC could be used otherwise but will be a lot slower
graph.dataaccess=RAM_STORE

# if you want to reduce storage size and you don't need instructions for the resulting path use:
# osmreader.instructions=false
osmreader.wayPointMaxDistance=1


#### Speed-up Mode vs. Flexibility Mode ####
#
# By default the speed-up mode with the 'fastest' weighting is used. Internally a graph preparation via
# contraction hierarchies is done to speed routing up. This requires more RAM/disc space for holding the
# graph but less for every request. Also only the first vehicle of the flagEncoders list will be prepared.
# prepare.chWeighting=fastest
#
# Disable the speed-up mode (contraction hierarchies, CH) via enabling the flexibility mode:
prepare.chWeighting=no


##### Web #####
# if you want to support jsonp response type you need to add it explicitely here. By default it is disabled for 
# stronger security.
web.jsonpAllowed=true

日志

代码语言:javascript
复制
com.google.inject.internal.MessageProcessor visit
INFOS: An exception was caught and reported. Message: java.lang.IllegalArgumentException: Encoders are requesting more than 32 bits of way flags. Decrease the number of vehicles or increase the flags to take long.
java.lang.IllegalStateException: Couldn't load graph
    at com.graphhopper.http.DefaultModule.configure(DefaultModule.java:82)
    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:114)
    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:62)
    at com.graphhopper.http.GHServer.main(GHServer.java:48)
Caused by: java.lang.IllegalArgumentException: Encoders are requesting more than 32 bits of way flags. Decrease the number of vehicles or increase the flags to take long.
    at com.graphhopper.routing.util.EncodingManager.registerEncoder(EncodingManager.java:183)
    at com.graphhopper.routing.util.EncodingManager.<init>(EncodingManager.java:106)
    at com.graphhopper.routing.util.EncodingManager.<init>(EncodingManager.java:75)
    at com.graphhopper.GraphHopper.init(GraphHopper.java:574)
    at com.graphhopper.http.DefaultModule.createGraphHopper(DefaultModule.java:55)
    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:35)
  at com.graphhopper.http.GHServletModule.configureServlets(GHServletModule.java:60)

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:35)
  at com.graphhopper.http.GHServletModule.configureServlets(GHServletModule.java:63)

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:35)
  at com.graphhopper.http.GHServletModule.configureServlets(GHServletModule.java:66)

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

5) 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:55)
  at com.graphhopper.http.GHServletModule.configureServlets(GHServletModule.java:66)

6) 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:35)
  at com.graphhopper.http.GHServletModule.configureServlets(GHServletModule.java:60)

7) 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:39)
  at com.graphhopper.http.GHServletModule.configureServlets(GHServletModule.java:63)

7 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:62)
    at com.graphhopper.http.GHServer.main(GHServer.java:48)
Caused by: java.lang.IllegalStateException: Couldn't load graph
    at com.graphhopper.http.DefaultModule.configure(DefaultModule.java:82)
    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:114)
    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.IllegalArgumentException: Encoders are requesting more than 32 bits of way flags. Decrease the number of vehicles or increase the flags to take long.
    at com.graphhopper.routing.util.EncodingManager.registerEncoder(EncodingManager.java:183)
    at com.graphhopper.routing.util.EncodingManager.<init>(EncodingManager.java:106)
    at com.graphhopper.routing.util.EncodingManager.<init>(EncodingManager.java:75)
    at com.graphhopper.GraphHopper.init(GraphHopper.java:574)
    at com.graphhopper.http.DefaultModule.createGraphHopper(DefaultModule.java:55)
    at com.graphhopper.http.DefaultModule.configure(DefaultModule.java:69)
    ... 14 more
EN

回答 1

Stack Overflow用户

发布于 2015-04-30 19:26:19

转弯限制将起作用,例如,如果禁用CH prepare.chWeighting=no,对汽车也是如此。

IllegalArgumentException意味着您应该减少使用的空间或增加可用的空间,但是在如何这样做时,应该改进错误消息:

osmreader.bytesForFlags=8

通过此承诺修正。(顺便说一句:不同版本的区别是因为我们需要更多的位在更新的版本中)

现在,关于:

另外,如果将一种方法设置为私有,GraphHopper将不会考虑使用标记,并且在0.4或0.5中都使用它。

我们成功地排除了其他标记,因此我押注于bug :)。也许你能告诉我们你到底做了什么

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29943037

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档