Skip to content

Commit

Permalink
Merge tag '8.0' into osm-reader-callbacks-8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Nakaner committed May 2, 2024
2 parents c837659 + 1e224ae commit 2d4859c
Show file tree
Hide file tree
Showing 537 changed files with 23,770 additions and 11,619 deletions.
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
root = true

# https://github.com/graphhopper/graphhopper/blob/master/CONTRIBUTING.md#code-formatting

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
max_line_length = 100
tab_width = 4

[*.java]
ij_continuation_indent_size = 8
ij_formatter_off_tag = @formatter:off
ij_formatter_on_tag = @formatter:on
ij_formatter_tags_enabled = true
ij_smart_tabs = false
ij_visual_guides = none
ij_wrap_on_typing = false
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java-version: [ 19, 20-ea ]
java-version: [ 20, 21-ea ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
Expand Down
49 changes: 47 additions & 2 deletions .github/workflows/remove-old-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,53 @@ jobs:

steps:
- name: Remove old artifacts
uses: c-hive/gha-remove-artifacts@v1
uses: c-hive/gha-remove-artifacts@v1.3.0
with:
age: '11 months'
skip-tags: true
skip-recent: 10
skip-recent: 300

remove-old-artifacts-2:
if: github.repository_owner == 'graphhopper'
name: Remove old artifacts
runs-on: ubuntu-latest
timeout-minutes: 10 # stop the task if it takes longer

steps:
- name: Remove old artifacts 2.1
uses: actions/[email protected]
with:
package-name: matrix
package-type: maven
min-versions-to-keep: 300

- name: Remove old artifacts 2.2
uses: actions/[email protected]
with:
package-name: com.graphhopper.graphhopper-matrix
package-type: maven
min-versions-to-keep: 300

- name: Remove old artifacts 2.3
uses: actions/[email protected]
with:
package-name: graphhopper-matrix
package-type: maven
min-versions-to-keep: 300

remove-old-artifacts-3:
if: github.repository_owner == 'graphhopper'
name: Remove old artifacts 3
runs-on: ubuntu-latest
timeout-minutes: 10 # stop the task if it takes longer

steps:
- name: Remove old artifacts 3.1
uses: SmartsquareGmbH/[email protected]
with:
names: |
matrix
com.graphhopper.graphhopper-matrix
graphhopper-matrix
type: maven
keep: 300
26 changes: 24 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
### 7.0 [not yet released]

### 8.0 [not yet released]

- access "turn"-EncodedValue of EncodingManager through separate methods, see #2884
- removed fastest weighting for public usage, use custom instead, see #2866
- removed shortest weighting for public usage, use a high distance_influence instead, see #2865
- removed duration:seconds as intermediate tag
- /info endpoint does no longer return the vehicle used per profile and won't return encoded value of vehicles like car_average_speed
- Country rules no longer contain maxspeed handling, enable a much better alternative via `max_speed_calculator.enabled: true`. On the client side use `max_speed_estimated` to determine if max_speed is from OSM or an estimation. See #2810
- bike routing better avoids dangerous roads, see #2796 and #2802
- routing requests can be configured to timeout after some time, see #2795
- custom_model_file string changed to custom_model_files array, see #2787
- renamed EdgeKVStorage to KVStorage as it is (temporarily) used for node tage too, see #2705
- bike vehicles are now allowed to go in reverse direction of oneways, see custom_models/bike.json #196
- prefer cycleways, bicycle_road and cyclestreet for bike routing, see #2784 and #2778
- add support for further surfaces like pebblestones or concrete:lanes, see #2751
- reduced memory usage for urban density calculation, see #2828
- urban density is now based on road junctions, so the according parameters need adjustment in case
the config file does not use the defaults, see #2842
- removed heading penalty *time*, see #2563
- base graph no longer allows loop edges, see #2862

### 7.0 [14 Mar 2023]

- access node tags via List instead of Map: List<Map<String, Object>> nodeTags = way.getTag("node_tags", emptyList()), see #2705
- remove StringEncodedValue support from custom model due to insufficient usage/testing
- handle also node_tags in handleWayTags, when extending AbstractAccessParser call handleNodeTags, #2738
- Format of 'areas' in CustomModel changed to 'FeatureCollection'. The old format is deprecated and will be removed in a later version, #2734
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ All contributions like pull requests, bug fixes, documentation changes and trans

## Code formatting

We use IntelliJ defaults and a very similar configuration for NetBeans defined in the root pom.xml. For eclipse there is this [configuration](https://github.com/graphhopper/graphhopper/files/481920/GraphHopper.Formatter.zip). Also for other IDEs
it should be simple to match:
We use IntelliJ defaults. For eclipse there is this [configuration](https://github.com/graphhopper/graphhopper/files/481920/GraphHopper.Formatter.zip).
For other IDEs we use [editorconfig](https://github.com/graphhopper/graphhopper/pull/2791) or the following rules:

* Java indent is 4 spaces
* Line width is 100 characters
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ Here is an overview:
* b3nn0, Android improvements
* baumboi, path detail and landmark improvements
* boldtrn, one of the core developers with motorcycle knowledge :)
* bt90, fixes like #2786
* cgarreau, increase of routing success rate via subnetwork cleanup
* chollemans, fixes like #1482
* ChristianSeitzer, motorcycle improvements
* ChristophKaser, agrees to the project's CLA, improved Android compatibility #1207
* Christoph Lingg, elevation smoothing #2772
* chucre, add special JSON output format, see #41
* daisy1754, fixed usage of graphhopper.sh script
* dardin88, instructions improved
Expand Down
31 changes: 18 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,21 @@ We even have [good first issues](https://github.com/graphhopper/graphhopper/issu

To get started you can try [GraphHopper Maps](README.md#graphhopper-maps), read through our documentation and install the GraphHopper Web Service locally.

* 6.x: [documentation](https://github.com/graphhopper/graphhopper/blob/6.x/docs/index.md)
, [web service jar](https://repo1.maven.org/maven2/com/graphhopper/graphhopper-web/6.2/graphhopper-web-6.2.jar)
, [announcement](https://www.graphhopper.com/blog/2022/09/19/graphhopper-routing-engine-6-0-released/)
* 8.x: [documentation](https://github.com/graphhopper/graphhopper/blob/8.x/docs/index.md)
, [web service jar](https://repo1.maven.org/maven2/com/graphhopper/graphhopper-web/8.0/graphhopper-web-8.0.jar)
, [announcement](https://www.graphhopper.com/blog/2023/10/18/graphhopper-routing-engine-8-0-released/)
* unstable master: [documentation](https://github.com/graphhopper/graphhopper/blob/master/docs/index.md)

<details><summary>Click to see older releases</summary>

* See our [changelog file](./CHANGELOG.md) for Java API Changes.

* 7.x: [documentation](https://github.com/graphhopper/graphhopper/blob/7.x/docs/index.md)
, [web service jar](https://repo1.maven.org/maven2/com/graphhopper/graphhopper-web/7.0/graphhopper-web-7.0.jar)
, [announcement](https://www.graphhopper.com/blog/2023/03/14/graphhopper-routing-engine-7-0-released/)
* 6.x: [documentation](https://github.com/graphhopper/graphhopper/blob/6.x/docs/index.md)
, [web service jar](https://repo1.maven.org/maven2/com/graphhopper/graphhopper-web/6.2/graphhopper-web-6.2.jar)
, [announcement](https://www.graphhopper.com/blog/2022/09/19/graphhopper-routing-engine-6-0-released/)
* 5.x: [documentation](https://github.com/graphhopper/graphhopper/blob/5.x/docs/index.md)
, [web service jar](https://github.com/graphhopper/graphhopper/releases/download/5.3/graphhopper-web-5.3.jar)
, [announcement](https://www.graphhopper.com/blog/2022/03/23/graphhopper-routing-engine-5-0-released/)
Expand Down Expand Up @@ -98,7 +105,7 @@ To get started you can try [GraphHopper Maps](README.md#graphhopper-maps), read
To install the [GraphHopper Maps](https://graphhopper.com/maps/) UI and the web service locally you [need a JVM](https://adoptium.net) (>= Java 8) and do:

```bash
wget https://repo1.maven.org/maven2/com/graphhopper/graphhopper-web/6.2/graphhopper-web-6.2.jar https://raw.githubusercontent.com/graphhopper/graphhopper/6.x/config-example.yml http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
wget https://repo1.maven.org/maven2/com/graphhopper/graphhopper-web/8.0/graphhopper-web-8.0.jar https://raw.githubusercontent.com/graphhopper/graphhopper/8.x/config-example.yml http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
java -D"dw.graphhopper.datareader.file=berlin-latest.osm.pbf" -jar graphhopper*.jar server config-example.yml
```

Expand Down Expand Up @@ -191,8 +198,7 @@ Read more about the technical details [here](./docs/core/technical.md).
## License

We chose the Apache License to make it easy for you to embed GraphHopper in your products, even closed source.
We suggest that you contribute back your changes, as GraphHopper evolves fast,
but of course this is not necessary.
We suggest that you contribute back your changes, as GraphHopper evolves fast.

## OpenStreetMap Support

Expand Down Expand Up @@ -223,7 +229,7 @@ See [our example application](./example/src/main/java/com/graphhopper/example/Ro

You can customize GraphHopper with Java knowledge (with a high and low level API) and also without Java knowledge using the [custom models](./docs/core/custom-models.md).

### Web UI and API
### Web API

With the web module, we provide code to query GraphHopper over HTTP and decrease bandwidth usage as much as possible.
For that we use an efficient polyline encoding, the Ramer–Douglas–Peucker algorithm, and a simple
Expand All @@ -243,26 +249,25 @@ A fast and production ready map visualization for the Desktop can be implemented

Here is a list of the more detailed features:

* Based on Java and simple start for developers via Maven.
* Works out of the box with OpenStreetMap (osm/xml and pbf) and can be adapted to custom data
* OpenStreetMap integration: stores and considers road type, speed limit, the surface, barriers, access restrictions, ferries, [conditional access restrictions](https://github.com/graphhopper/graphhopper/pull/621), ...
* GraphHopper is fast. And with the so called "Contraction Hierarchies" it can be even faster (enabled by default).
* Memory efficient data structures, algorithms and [the low and high level API](./docs/core/low-level-api.md) is tuned towards ease of use and efficiency
* Provides a simple [web API](./docs/web/api-doc.md) including JavaScript and Java clients
* Multiple weightings (fastest/shortest/custom/...) and pre-built routing profiles: car, bike, racing bike, mountain bike, foot, hike, motorcycle, wheelchair, ...
* Pre-built routing profiles: car, bike, racing bike, mountain bike, foot, hike, motorcycle, wheelchair, ...
* [Customization of these profiles](./docs/core/profiles.md#custom-profiles) are possible and e.g. get truck routing or support for cargo bikes and [many other changes](https://www.graphhopper.com/blog/2020/05/31/examples-for-customizable-routing/)
* Provides a powerful [web API](./docs/web/api-doc.md) that exposes the data from OpenStreetMap and allows customizing the vehicle profiles per request. With JavaScript and Java clients.
* Does [map matching](./map-matching)
* Supports public transit routing and [GTFS](./reader-gtfs/README.md).
* Offers turn instructions in more than 42 languages, contribute or improve [here](./docs/core/translations.md)
* Offers turn instructions in more than 45 languages, contribute or improve [here](./docs/core/translations.md)
* Displays and takes into account [elevation data](./docs/core/elevation.md)
* Can apply [real time changes to edge weights](https://graphhopper.com/blog/2015/04/08/visualize-and-handle-traffic-information-with-graphhopper-in-real-time-for-cologne-germany-koln/) (flexible and hybrid mode only)
* [Alternative routes](https://discuss.graphhopper.com/t/alternative-routes/424)
* [Turn costs and restrictions](./docs/core/turn-restrictions.md)
* Country specific routing via country rules
* Allows customizing routing behavior using custom areas
* Allows customizing routing behavior using custom areas
* The core uses only a few dependencies (hppc, jts, janino and slf4j)
* Scales from small indoor-sized to world-wide-sized graphs
* Finds nearest point on street e.g. to get elevation or 'snap to road' or being used as spatial index (see [#1485](https://github.com/graphhopper/graphhopper/pull/1485))
* Calculates isochrones and [shortest path trees](https://github.com/graphhopper/graphhopper/pull/1577)
* Shows the whole road network in the browser for debugging purposes ("vector tile support") [#1572](https://github.com/graphhopper/graphhopper/pull/1572)
* Shows details along a route like road_class or max_speed ("path details") [#1142](https://github.com/graphhopper/graphhopper/pull/1142)
* Written Java and simple start for developers via Maven.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '{build}'
skip_tags: true
clone_depth: 10
image: Visual Studio 2019
image: Visual Studio 2022
environment:
MAVEN_OPTS: -Xmx1g
JAVA_OPTS: -Xmx1g
Expand Down
40 changes: 3 additions & 37 deletions benchmark/benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ measurement.stop_on_error=true \
measurement.summaryfile=${SUMMARY_DIR}summary_small.dat \
measurement.repeats=1 \
measurement.run_slow_routing=true \
measurement.weighting=fastest \
measurement.ch.node=true \
measurement.ch.edge=true \
measurement.lm=true \
Expand Down Expand Up @@ -76,7 +75,6 @@ measurement.stop_on_error=true \
measurement.summaryfile=${SUMMARY_DIR}summary_big.dat \
measurement.repeats=1 \
measurement.run_slow_routing=true \
measurement.weighting=fastest \
measurement.ch.node=true \
measurement.ch.edge=false \
measurement.lm=true \
Expand All @@ -91,38 +89,7 @@ measurement.json=true \
measurement.count=5000 \
measurement.use_measurement_time_as_ref_time=${USE_MEASUREMENT_TIME_AS_REF_TIME}

echo "3 - big map with a custom model that is 'a little customized', i.e. similar to the standard fastest-car profile"
echo "node-based CH + LM"
java -cp tools/target/graphhopper-tools-*-jar-with-dependencies.jar \
-XX:+UseParallelGC -Xmx20g -Xms20g \
com.graphhopper.tools.Measurement \
datareader.file=${BIG_OSM_MAP} \
datareader.date_range_parser_day=2019-11-01 \
measurement.name=big_map_little_custom \
measurement.folder=${RESULTS_DIR} \
measurement.clean=true \
measurement.stop_on_error=true \
measurement.summaryfile=${SUMMARY_DIR}summary_big_little_custom.dat \
measurement.repeats=1 \
measurement.run_slow_routing=false \
measurement.weighting=custom \
measurement.custom_model_file=benchmark/little_custom.json \
graph.encoded_values=max_width,max_height,toll,hazmat \
measurement.ch.node=true \
measurement.ch.edge=false \
measurement.lm=true \
"measurement.lm.active_counts=[8]" \
measurement.lm.edge_based=false \
measurement.vehicle=car \
import.osm.ignored_highways=footway,cycleway,path,pedestrian,bridleway \
measurement.turn_costs=true \
graph.location=${GRAPH_DIR}measurement-big-little-custom-gh \
prepare.min_network_size=10000 \
measurement.json=true \
measurement.count=5000 \
measurement.use_measurement_time_as_ref_time=${USE_MEASUREMENT_TIME_AS_REF_TIME}

echo "4 - big map with a custom model that is 'very customized', i.e. has many custom weighting rules"
echo "3 - big map with a custom model that is 'very customized', i.e. has many custom weighting rules"
echo "node-based CH + LM"
java -cp tools/target/graphhopper-tools-*-jar-with-dependencies.jar \
-XX:+UseParallelGC -Xmx20g -Xms20g \
Expand Down Expand Up @@ -153,7 +120,7 @@ measurement.json=true \
measurement.count=5000 \
measurement.use_measurement_time_as_ref_time=${USE_MEASUREMENT_TIME_AS_REF_TIME}

echo "5 - big map, outdoor: node-based CH + landmarks (edge- & node-based for LM)"
echo "4 - big map, outdoor: node-based CH + landmarks (edge- & node-based for LM)"
java -cp tools/target/graphhopper-tools-*-jar-with-dependencies.jar \
-XX:+UseParallelGC -Xmx20g -Xms20g \
com.graphhopper.tools.Measurement \
Expand All @@ -166,7 +133,6 @@ measurement.stop_on_error=true \
measurement.summaryfile=${SUMMARY_DIR}summary_big_outdoor.dat \
measurement.repeats=1 \
measurement.run_slow_routing=false \
measurement.weighting=fastest \
measurement.ch.node=true \
measurement.ch.edge=false \
measurement.lm=true \
Expand All @@ -179,4 +145,4 @@ graph.location=${GRAPH_DIR}measurement-big-outdoor-gh \
prepare.min_network_size=10000 \
measurement.json=true \
measurement.count=5000 \
measurement.use_measurement_time_as_ref_time=${USE_MEASUREMENT_TIME_AS_REF_TIME}
measurement.use_measurement_time_as_ref_time=${USE_MEASUREMENT_TIME_AS_REF_TIME}
15 changes: 0 additions & 15 deletions benchmark/little_custom.json

This file was deleted.

46 changes: 10 additions & 36 deletions benchmark/very_custom.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,17 @@
// this is a heavily customized model used to benchmark routing with a custom weighting
{
"speed": [
{
"if": "road_class == MOTORWAY",
"multiply_by": "0.85"
},
{
"else_if": "road_class == PRIMARY",
"multiply_by": "0.9"
},
{
"if": "true",
"limit_to": "110"
}
{ "if": "road_class == MOTORWAY", "multiply_by": "0.85" },
{ "else_if": "road_class == PRIMARY", "multiply_by": "0.9" },
{ "if": "true", "limit_to": "110" }
],
"priority": [
{
"if": "max_height < 3.8",
"multiply_by": "0"
},
{
"if": "max_width < 2.5",
"multiply_by": "0"
},
{
"if": "road_class == PRIMARY",
"multiply_by": "0.5"
},
{
"else_if": "road_class != MOTORWAY",
"multiply_by": "0.9"
},
{
"if": "toll != NO",
"multiply_by": "0.5"
},
{
"if": "hazmat == NO",
"multiply_by": "0"
}
{ "if": "road_access == PRIVATE", "multiply_by": "0" },
{ "if": "max_height < 3.8", "multiply_by": "0" },
{ "if": "max_width < 2.5", "multiply_by": "0" },
{ "if": "road_class == PRIMARY", "multiply_by": "0.5" },
{ "else_if": "road_class != MOTORWAY", "multiply_by": "0.9" },
{ "if": "toll != NO", "multiply_by": "0.5" },
{ "if": "hazmat == NO", "multiply_by": "0" }
]
}
2 changes: 1 addition & 1 deletion client-hc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.9.3</version>
<version>4.11.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand Down
Loading

0 comments on commit 2d4859c

Please sign in to comment.