diff --git a/code/graphhopper_start.sh b/code/graphhopper_start.sh new file mode 100755 index 0000000..e06c57d --- /dev/null +++ b/code/graphhopper_start.sh @@ -0,0 +1,8 @@ + if ! [ -d graph-cache/ ]; + then + wget -c https://osmit-estratti.wmcloud.org/output/pbf/comuni/022205_Trento.osm.pbf; + wget -c https://repo1.maven.org/maven2/com/graphhopper/graphhopper-web/9.1/graphhopper-web-9.1.jar; + wget -c https://raw.githubusercontent.com/napo/geospatial_unitn_2024/refs/heads/main/data/config/config_trento.yml; + fi +java -jar graphhopper*.jar server config_trento.yml +https://osmit-estratti.wmcloud.org/output/pbf/comuni/022205_Trento.osm.pbf diff --git a/data/config/config_trento.yml b/data/config/config_trento.yml index a22750e..5dd014c 100644 --- a/data/config/config_trento.yml +++ b/data/config/config_trento.yml @@ -14,46 +14,45 @@ graphhopper: # # In general a profile consists of the following # - name (required): a unique string identifier for the profile - # - vehicle (required): refers to the `graph.vehicles` used for this profile - # - weighting (required): the weighting used for this profile like custom,fastest,shortest or short_fastest - # - turn_costs (true/false, default: false): whether or not turn restrictions should be applied for this profile. + # - weighting (optional): by default 'custom' + # - turn_costs (optional): + # vehicle_types: [motorcar, motor_vehicle] (vehicle types used for vehicle-specific turn restrictions) + # u_turn_costs: 60 (time-penalty for doing a u-turn in seconds) # # Depending on the above fields there are other properties that can be used, e.g. - # - distance_factor: 0.1 (can be used to fine tune the time/distance trade-off of short_fastest weighting) - # - u_turn_costs: 60 (time-penalty for doing a u-turn in seconds (only possible when `turn_costs: true`)). - # Note that since the u-turn costs are given in seconds the weighting you use should also calculate the weight - # in seconds, so for example it does not work with shortest weighting. - # - custom_model_file: when you specified "weighting: custom" you need to set a json file inside your custom_models.directory - # or working directory that defines the custom_model. If you want an empty model you can also set "custom_model_file: empty". - # You can also use th e`custom_model` field instead and specify your custom model in the profile directly. + # - custom_model_files: when you specified "weighting: custom" you need to set one or more json files which are searched in + # custom_models.directory or the working directory that defines the custom_model. If you want an empty model you can + # set "custom_model_files: [] + # You can also use the `custom_model` field instead and specify your custom model in the profile directly. # # To prevent long running routing queries you should usually enable either speed or hybrid mode for all the given # profiles (see below). Or at least limit the number of `routing.max_visited_nodes`. profiles: - - name: car - vehicle: car - weighting: custom - custom_model: - distance_influence: 70 -# turn_costs: true -# u_turn_costs: 60 - - - name: bike - # to use the bike vehicle make sure to not ignore cycleways etc., see import.osm.ignored_highways below - vehicle: bike - weighting: shortest -# # the custom model in bike.json is defined to avoid hills -# custom_model_file: bike.json - - name: foot - vehicle: foot - weighting: shortest + - name: car +# turn_costs: +# vehicle_types: [motorcar, motor_vehicle] +# u_turn_costs: 60 + custom_model_files: [car.json] - # specify the folder where to find the custom model files - custom_models.directory: custom_models + - name: foot +# custom_model_files: [foot.json, foot_elevation.json] +# +# - name: bike +# custom_model_files: [bike.json, bike_elevation.json] +# +# - name: racingbike +# custom_model_files: [racingbike.json, bike_elevation.json] +# +# - name: mtb +# custom_model_files: [mtb.json, bike_elevation.json] + + # instead of the inbuilt custom models (see ./core/src/main/resources/com/graphhopper/custom_models) + # you can specify a folder where to find your own custom model files + # custom_models.directory: custom_models # Speed mode: - # Its possible to speed up routing by doing a special graph preparation (Contraction Hierarchies, CH). This requires + # It's possible to speed up routing by doing a special graph preparation (Contraction Hierarchies, CH). This requires # more RAM/disk space for holding the prepared graph but also means less memory usage per request. Using the following # list you can define for which of the above routing profiles such preparation shall be performed. Note that to support # profiles with `turn_costs: true` a more elaborate preparation is required (longer preparation time and more memory @@ -73,22 +72,14 @@ graphhopper: profiles_lm: [] - #### Vehicles #### - - # The vehicle defines the base for how the routing of a profile behaves. It can be fine tuned using the options: - # name=mycustomvehicle,block_private=true,turn_costs=true,transportation_mode=MOTOR_VEHICLE (only for the roads vehicle) - # Still, it is recommended to avoid changing the vehicle settings and change the custom model instead. - # graph.vehicles: car|block_fords=true,turn_costs=true,bike|turn_costs=true - # Other standard vehicles: foot,bike,mtb,racingbike,motorcycle,wheelchair - - #### Encoded Values #### # Add additional information to every edge. Used for path details (#1548) and custom models (docs/core/custom-models.md) # Default values are: road_class,road_class_link,road_environment,max_speed,road_access - # More are: surface,smoothness,max_width,max_height,max_weight,hgv,max_axle_load,max_length,hazmat,hazmat_tunnel,hazmat_water, - # lanes,osm_way_id,toll,track_type,mtb_rating,hike_rating,horse_rating - # graph.encoded_values: surface,toll,track_type + # More are: surface,smoothness,max_width,max_height,max_weight,max_weight_except,hgv,max_axle_load,max_length, + # hazmat,hazmat_tunnel,hazmat_water,lanes,osm_way_id,toll,track_type,mtb_rating,hike_rating,horse_rating, + # country,curvature,average_slope,max_slope,car_temporal_access,bike_temporal_access,foot_temporal_access + graph.encoded_values: car_access, car_average_speed #### Speed, hybrid and flexible mode #### @@ -122,8 +113,11 @@ graphhopper: # graph.elevation.edge_smoothing: ramer # removes elevation fluctuations up to max_elevation (in meter) and replaces the elevation with a value based on the average slope # graph.elevation.edge_smoothing.ramer.max_elevation: 5 - # A potentially bigger reduction of ascend/descend is possible, but maximum slope will often increase (do not use when average_slope and maximum_slope shall be used in a custom_model) + # Using an averaging approach for smoothing will reveal values not affected by outliers and realistic slopes and total altitude values (up and down) # graph.elevation.edge_smoothing: moving_average + # window size in meter along a way used for averaging a node's elevation + # graph.elevation.edge_smoothing.moving_average.window_size: 150 + # To increase elevation profile resolution, use the following two parameters to tune the extra resolution you need # against the additional storage space used for edge geometries. You should enable bilinear interpolation when using @@ -135,6 +129,14 @@ graphhopper: # graph.elevation.way_point_max_distance: 10 + #### Country-dependent defaults for max speeds #### + + # This features sets a maximum speed in 'max_speed' encoded value if no maxspeed tag was found. It is country-dependent + # and based on several rules. See https://github.com/westnordost/osm-legal-default-speeds + # To use it uncomment the following, then enable urban density below and add 'country' to graph.encoded_values + # max_speed_calculator.enabled: true + + #### Urban density (built-up areas) #### # This feature allows classifying roads into 'rural', 'residential' and 'city' areas (encoded value 'urban_density') @@ -143,10 +145,10 @@ graphhopper: # Use higher/lower sensitivities if too little/many roads fall into the according categories. # Using smaller radii will speed up the classification, but only change these values if you know what you are doing. # If you do not need the (rather slow) city classification set city_radius to zero. - # graph.urban_density.residential_radius: 300 - # graph.urban_density.residential_sensitivity: 60 - # graph.urban_density.city_radius: 2000 - # graph.urban_density.city_sensitivity: 30 + # graph.urban_density.residential_radius: 400 + # graph.urban_density.residential_sensitivity: 6000 + # graph.urban_density.city_radius: 1500 + # graph.urban_density.city_sensitivity: 1000 #### Subnetworks #### @@ -158,13 +160,16 @@ graphhopper: prepare.min_network_size: 200 prepare.subnetworks.threads: 1 - #### Routing #### # You can define the maximum visited nodes when routing. This may result in not found connections if there is no # connection between two points within the given visited nodes. The default is Integer.MAX_VALUE. Useful for flexibility mode # routing.max_visited_nodes: 1000000 + # The maximum time in milliseconds after which a routing request will be aborted. This has some routing algorithm + # specific caveats, but generally it should allow the prevention of long-running requests. The default is Long.MAX_VALUE + # routing.timeout_ms: 300000 + # Control how many active landmarks are picked per default, this can improve query performance # routing.lm.active_landmarks: 4 @@ -180,9 +185,8 @@ graphhopper: # motorized vehicles. This leads to a smaller and less dense graph, because there are fewer ways (obviously), # but also because there are fewer crossings between highways (=junctions). # Another typical example is excluding 'motorway', 'trunk' and maybe 'primary' highways for bicycle or pedestrian routing. + import.osm.ignored_highways: footway,cycleway,path,pedestrian,steps # typically useful for motorized-only routing # import.osm.ignored_highways: motorway,trunk # typically useful for non-motorized routing - # import.osm.ignored_highways: footway,cycleway,path,pedestrian,steps # typically useful for motorized-only routing - import.osm.ignored_highways: # typically useful for motorized-only routing # configure the memory access, use RAM_STORE for well equipped servers (default and recommended) graph.dataaccess.default_type: RAM_STORE @@ -190,14 +194,10 @@ graphhopper: # will write way names in the preferred language (language code as defined in ISO 639-1 or ISO 639-2): # datareader.preferred_language: en - # Sort the graph after import to make requests roughly ~10% faster. Note that this requires significantly more RAM on import. - # graph.do_sort: true - - #### Custom Areas #### # GraphHopper reads GeoJSON polygon files including their properties from this directory and makes them available - # to all tag parsers, vehicles and custom models. All GeoJSON Features require to have the "id" property. + # to all tag parsers and custom models. All GeoJSON Features require to have the "id" property. # Country borders are included automatically (see countries.geojson). # custom_areas.directory: path/to/custom_areas @@ -215,6 +215,8 @@ server: port: 8989 # for security reasons bind to localhost bind_host: localhost + # increase GET request limit - not necessary if /maps UI is not used or used without custom models + max_request_header_size: 50k request_log: appenders: [] admin_connectors: @@ -224,14 +226,24 @@ server: # See https://www.dropwizard.io/en/latest/manual/core.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" + - 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" + loggers: + "com.graphhopper.osm_warnings": + level: DEBUG + additive: false + appenders: + - type: file + currentLogFilename: logs/osm_warnings.log + archive: false + logFormat: '[%level] %msg%n' +