Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make use of node tags like 'highway' or 'crossing' #2705

Merged
merged 27 commits into from Mar 16, 2023
Merged

Conversation

easbar
Copy link
Member

@easbar easbar commented Dec 2, 2022

So far we keep node tags only for barrier nodes, but with a few small changes we can also provide the tags of all nodes belonging to the current edge to the tag parsers. This allows us to write encoded values that consider traffic lights, pedestrian crossings etc.

We read the node tags during the second OSM pass (because only then do we know which nodes belong to the ways we are interested in) and then we need to keep around until we read the ways in the second pass. Keeping all the node tags is not as bad as it sounds, though. I did a test for Germany and there were 540_000 nodes with barrier tags (which we already keep around anyway) and the total number of nodes with tags was around 2_600_000, so around five times as many.

Here are the most frequent node tags (only nodes belonging to highways were counted and note that nodes carrying multiple tags appear once for each tag in these numbers):

highway: 1.12%, 791784
barrier: 0.76%, 537916
name: 0.51%, 364319
crossing: 0.42%, 294333
created_by: 0.39%, 276287
public_transport: 0.35%, 246989
bus: 0.34%, 242477
bicycle: 0.28%, 200287
foot: 0.26%, 182614
tactile_paving: 0.26%, 180970
entrance: 0.25%, 178177
noexit: 0.21%, 150552
traffic_sign: 0.18%, 125280
access: 0.18%, 124076
crossing:island: 0.15%, 108724
direction: 0.14%, 97463
railway: 0.13%, 91601
network: 0.10%, 68049
kerb: 0.09%, 63401
button_operated: 0.09%, 61035
wheelchair: 0.08%, 55419
source: 0.08%, 54207
traffic_signals:sound: 0.08%, 54145
ref:IFOPT: 0.07%, 52075
traffic_signals:direction: 0.07%, 51788

We could reduce the number of tags we need to store by excluding some we definitely don't need, like created_by=JOSM for example, but not even sure if this is really needed. If we want to save memory we should probably rather focus on using a more efficient way to store the tags as currently this is simply a List<Map<String, Object>>. But this is probably something for later and first we should check how useful the node tags can be (hence this draft PR).

The node tags are available to all tag parsers via:

List<Map<String, Object>> nodeTags = (List<Map<String, Object>>) way.getTag("node_tags");

and this list contains one entry for each point in the point list of the current edge.

Related: #2430 (comment)

todo:

  • try some real-world examples, maybe add some encoded values that make use of node tags
  • fix existing tests
  • review code, pay special attention to barrier node handling
  • add some tests
  • check performance, memory requirements and number of node tags also for global imports
  • if needed: exclude unnecessary node tags
  • try more memory-efficient way to store node tags -> EdgeKVStorage. For now not necessary as memory usage does not seem much higher.

@easbar easbar marked this pull request as draft December 2, 2022 13:26
@easbar easbar temporarily deployed to benchmarks December 2, 2022 13:30 Inactive
@easbar
Copy link
Member Author

easbar commented Dec 2, 2022

This could also be interesting to improve urban density calculations (traffic lights, bus stops, street lamps, zebra etc. all indicate that a street belongs to some kind of populated area).

@karussell karussell mentioned this pull request Dec 2, 2022
@easbar easbar temporarily deployed to benchmarks December 3, 2022 08:24 Inactive
@karussell karussell temporarily deployed to benchmarks March 2, 2023 12:39 — with GitHub Actions Inactive
@karussell karussell temporarily deployed to benchmarks March 2, 2023 14:35 — with GitHub Actions Inactive
@karussell karussell temporarily deployed to benchmarks March 2, 2023 14:36 — with GitHub Actions Inactive
@karussell karussell temporarily deployed to benchmarks March 2, 2023 17:48 — with GitHub Actions Inactive
@karussell karussell temporarily deployed to benchmarks March 2, 2023 18:00 — with GitHub Actions Inactive
if (!nodeTags.isEmpty()) {
protected void handleNodeTags(IntsRef edgeFlags, List<Map<String, Object>> nodeTags) {
if (nodeTags.isEmpty()) return; // allMatch returns 'true' by default
boolean isBarrier = nodeTags.stream().allMatch(tags -> {
Copy link
Member

@karussell karussell Mar 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We split barrier nodes into separate (short) edges where both nodes have these barrier tags. The adjacent edges only have one node with these barrier tags and so we need allMatch and anyMatch is not sufficient.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should do this already one level higher in OSMReader#handleEdge#setArtificialWayTags, something like:

        if (!nodeTags.isEmpty() && (boolean) nodeTags.get(0).getOrDefault("gh:split_node", false))
            way.setTag("gh:split_node_edge", true);
        else
            way.removeTag("gh:split_node_edge");

This way the downstream tag parsers can recognize edges that were created by splitting a node by looking at the gh:split_node_edge tag and can access the tags of the split node by looking at the node tags for either of the two nodes (they are the same anyway).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do this even earlier: The moment we create the barrier edge we now add the gh:barrier_edge tag for the reader way.

We could even use the node tags of the split node as value of the gh:barrier_edge tag (instead of simply true)? But we can also obtain these tags in the parsers by looking at the node tags of either of the two nodes of these edges, like we currently do, not sure if one would be more clear than the other. We could even do both :)

@easbar easbar temporarily deployed to benchmarks March 6, 2023 14:05 — with GitHub Actions Inactive
@karussell karussell temporarily deployed to benchmarks March 11, 2023 17:43 — with GitHub Actions Inactive
@karussell karussell marked this pull request as ready for review March 13, 2023 16:16
@karussell karussell temporarily deployed to benchmarks March 14, 2023 11:07 — with GitHub Actions Inactive
@karussell karussell temporarily deployed to benchmarks March 14, 2023 12:29 — with GitHub Actions Inactive
@easbar easbar temporarily deployed to benchmarks March 15, 2023 07:18 — with GitHub Actions Inactive
node.removeTag("source");
node.removeTag("note");
node.removeTag("fixme");
node.setTags(new HashMap<>(node.getTags())); // create compact Map
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather create the compact map in OSMNodeData.setTags, so it is kind of up to this 'storage' class how to the tags are stored (and compacted and such).

Comment on lines 81 to 83
protected void handleNodeTags(IntsRef edgeFlags, Map<String, Object> nodeTags) {
if (!nodeTags.isEmpty()) {
// for now we just create a dummy reader node, because our encoders do not make use of the coordinates anyway
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's rename handleNodeTags? It sounds like something general, but cit is only called for edges tagged as gh:barrier_edge, and the same for the JavaDoc comment.

Comment on lines 71 to 73
// yet and a value of -2 means there was an entry but it was removed again
// yet.
private final LongIntMap nodeTagIndicesByOsmNodeIds;

// stores node tags
private final List<Map<String, Object>> nodeTags;
private final LongSet nodesToBeSplit;
Copy link
Member Author

@easbar easbar Mar 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my last commit I added this LongSet to replace the artificial (and possibly confusing?) gh:split_node tag, and so we do not need the remove operation for the tags (in case we like to store the node tags with EdgeKVStorage or similar).

Now we use the following data structures for the node data:

  • idsByOSMNodeIds is a (very large) map that maps the full range of possible (64bit) OSM node IDs to a smaller (32bit) range of indices of nodes we actually use to build the graph (typically those contained in ways using the highway tag).

  • nodeTagIndicesByOSMNodeIds is a similar, but smaller, map that does the same, but only for nodes for which we keep the tags for

  • nodeTags is a list that maps the int indices we get via nodeTagIndicesByOSMNodeIds to the actual tags

  • nodesToBeSplit is a separate hash set of OSM node IDS that shall be split. for this we need a way to remove/unset values.

Quite possibly we could combine some of these to either save memory or speed up the import, or both? For example we could combine idsByOsmNodeIds and nodeTagIndicesByOsmNodeIds, which would definitely be an improvement if we stored tags for all nodes. Or we could use the int index we get via nodeTagIndicesByOsmNodeIds to replace the nodesToBeSplit LongSet with a BitSet (using the int index).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite possibly we could combine some of these to either save memory or speed up the import, or both?

It looks like whenever we do a lookup into nodeTagIndicesByOSMNodeIds we also do a lookup into idsByOSMNodeIds anyway, which means we could get rid of the lookup into nodeTagIndicesByOSMNodeIds. But since there are less nodes for which we store tags than there are nodes we need to map the (larger) int index we get from idsByOSMNodeIds to a smaller, more compact index. At least as long as we want to keep the node tags list compact. So actually we would then need another int-int lookup, and I'm not sure if overall this will be better, but it might be worth a try.

Copy link
Member Author

@easbar easbar Mar 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you check for how many nodes we now store the tags (compared to the total number of nodes we map the coordinates for)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit off-topic, but it also might speed up the import if we replaced:

 int curr = idsByOsmNodeIds.get(osmNodeId);
 if (curr == EMPTY_NODE)
       idsByOsmNodeIds.put(osmNodeId, newNodeType);

with something like

  int index = idsByOsmNodeIds.indexOf(osmNodeId);
  int curr = idsByOsmNodeIds.indexGet(index);
  if (curr == EMPTY_NODE)
        idsByOsmNodeIds.indexPut(index, newNodeType);

but not sure if using an index like this is possible with GHLongIntBTreeMap.

@karussell karussell temporarily deployed to benchmarks March 15, 2023 19:04 — with GitHub Actions Inactive
@karussell karussell temporarily deployed to benchmarks March 15, 2023 19:29 — with GitHub Actions Inactive
@karussell karussell temporarily deployed to benchmarks March 15, 2023 19:34 — with GitHub Actions Inactive
@karussell karussell added this to the 8.0 milestone Mar 16, 2023
@karussell
Copy link
Member

karussell commented Mar 16, 2023

For the planet import (planet-230227.osm.pbf, openjdk 17) this branch uses slightly more memory than master (minimum Xmx was 88g instead of 87g). Without the KVStorage the memory usage would have been 6gb more.

Still, it takes the same time for the 2 passes (~6400s).

One needs to take a bit more care to implement the node handling in the TagParsers to avoid a slow down. E.g. before this change the slow down was ~7%.

Seems to work. Now we can exclude e.g. fords and ferries via a custom model too.

@karussell karussell temporarily deployed to benchmarks March 16, 2023 09:49 — with GitHub Actions Inactive
@karussell karussell merged commit d781707 into master Mar 16, 2023
4 checks passed
@karussell karussell deleted the node_tags branch March 16, 2023 10:31
akuracy pushed a commit to s3pweb/graphhopper that referenced this pull request Mar 21, 2023
* Pass all node tags to edge handlers

* Remove node tag count (was only used for analysis)

* crossing EV (graphhopper#2706)

* add tests; fix traffic_signalS; remove zebra as same as uncontrolled; include proposed tags https://wiki.openstreetmap.org/wiki/Proposed_features/Highway_crossing_cleanup

* fix

* fix tests

* minor fix

* minor typo

* node tag whitelist; use get not put in removeTag

* include node tags handling for road_access and fords (road_environment)

* mark only node tags of barrier edge as 'split_node'

* avoid stream and collect

* minor further perf tune

* make barrier edge explicit via tag

* simplify handleNodeTags

* Remove artificial gh:split_node tag and use long hash set instead

* minor rename

* use EdgeKVStorage for node tags storage

* rename EdgeKVStorage to KVStorage as also used to temporarily store node tags for import

* log more infos about node tags; no compact necessary due to KVStorage; limit pointer of KVStorage to positive numbers for now

* rename method to handleBarrierEdge

* fix taggednodecount method

* node tags for the barrier edge should be identical, i.e. use the ref instead of a copy

---------

Co-authored-by: Peter <graphhopper@gmx.de>
jp-lopez added a commit to StuartApp/graphhopper-matrix that referenced this pull request Jun 21, 2023
* force max_slope and average_slope to create SlopeCalculator

* remove that motorroad=yes influences speed or is used as highway tag, graphhopper#2329

* CurvatureCalculator: if included in tests that don't set artificial tags

* Treat segments tagged as "lcn=yes" the same way as a bicycle route relation with "network=lcn". (graphhopper#2693)

See https://wiki.openstreetmap.org/wiki/DE:Tag:lcn%3Dyes

* update maps

* Fix rare NPE in map matching

* Add support for (single) via-way restrictions (graphhopper#2689)

* Remove outdated comment and rule

* Revert "Remove outdated comment and rule"

This reverts commit 03e64da.

* value can be no for oneway:bicycle but also for cycleway:right:oneway, fixes graphhopper#2694

* Replace com.wdtinc MVT library with no.ecc (graphhopper#2698)

* Upgrade to JTS 1.19.0, fix graphhopper#1803

* minor

* Support ";" access delimiter for bikes (graphhopper#2676)

One example is vehicle = agricultural;forestry

Now we block also such combinations for bikes.

* Update maps, geocoding is disabled now

* Remove LegacyProfileResolver (graphhopper#2679)

* removed legacy parameters

* fixed error message

* add comment

* Update README.md

* Copy no.ecc code, remove no.ecc repository, graphhopper#2698

* Create edges even if flags are empty (graphhopper#2700)

* Add OSM way ID encoded value (graphhopper#2701)

* remove Bike2WeightTagParser again (graphhopper#2668)

* fix changelog graphhopper#2703

* Use explicit ignore list for highway values during OSM import (graphhopper#2702)

* Revert "Use explicit ignore list for highway values during OSM import (graphhopper#2702)"

This reverts commit ef2937f.

* split buildEncodingManagerAndOSMParsers method

* Revert "Revert "Use explicit ignore list for highway values during OSM import (graphhopper#2702)""

This reverts commit 97579b6

* Revert "Revert "Revert "Use explicit ignore list for highway values during OSM import (graphhopper#2702)"""

This reverts commit daccf5f.

* Revert "Revert "Revert "Revert "Use explicit ignore list for highway values during OSM import (graphhopper#2702)""""

This reverts commit b9b1ed4.

* Allow ignoring vehicle tag parser name

* Add tests to demonstrate that moped=yes etc. does not allow driving on a footway

* Keep ways tagged as man_made=pier or platform=railway for foot/bike

* Footway encoded value (graphhopper#2707)

* Add ignored highways to benchmark.sh

* do not throw an error if Java config is used without config file

* Revert "do not throw an error if Java config is used without config file"

This reverts commit c872780.

* Revert ignored highways for now

* Use GitHub Actions for Maven Central deployment too (graphhopper#2709)

* use github actions to deploy to maven central

* use private key directly to avoid escaping problems

* run only when tagged; renamed

* specify key id

* use more recent plugin versions

* different badge

* github actions: ignore tags

* include branches required

* include (2nd) test build to be sure

* ignoring tags is the default if branches is specified

* matches really all tags, https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet

* force test failure

* Revert "force test failure"

This reverts commit 85b38fe.

* include bus into TransportationMode enum, graphhopper#2710

* log the exception, not just the message

* mapmatching: put visited nodes into log event

* github packages: set permissions

* open a few things up

* vehicle -> profile

* remove unused non-private abstract method

* Implement edge-to-edge routing for unidir AStar

* Revert "Revert ignored highways for now"

This reverts commit 03978b8.

* Fix test

* Put back test (?)

* Rename publish-github-actions.yml

* Enable LM for small benchmark map and A* measurements for small map

* Remove name, turnCostEnc and getAccess from VehicleTagParser (graphhopper#2713)

* make CustomWeighting.Parameters public, graphhopper#2717

* distance_influence should not get a default value if no value is specified (graphhopper#2716)

* distance_influence should only be sent to server when explicitly specified and the default value of 70 makes this impossible

* fix changelog

* changelog

* CustomModel.getDistanceInfluence: allow null values

* remove comment

* comment

* make CustomWeighting.Parameters constructor public too, graphhopper#2717

* pt: push back mapdb

* remove hasDistanceInfluence, graphhopper#2716

* i18n: updated, graphhopper#2721

* cleanup of ElevationProvider, fixes graphhopper#2642

* average_speed path detail: avoid infinity value (or max JS floats) near bridges etc, graphhopper#2636

* fixup: pt: push back mapdb

* bug fix for graphhopper#2716

* Add GH version to client-hc

* Fix

* make custom areas available in custom models (graphhopper#2725)

* make it possible to use all custom areas in all custom models

* minor comment regarding ID

* set feature.id from feature.properties.id for our countries.geojson, related to graphhopper#2725

* getResourceAsStream implicitly creates a FileSystem required when the file is in the jar, https://stackoverflow.com/q/25032716/194609

* specially handle "NO_EDGE"; fixes graphhopper#2723

* Extract method

* avoid rounding down small speed (graphhopper#2726)

* Maxspeed fix (graphhopper#2727)

* clean up speed and maxspeed handling

* bug fix

* for bike we have to pick maximum max_speed

* fix yet another bug

* Do not check if edge flags are empty before handling node tags

* Return void from TagParser#handleWayTags

* Remove some explicit edge flag usage

* EncodingManager: initializer config is only needed when building

* Fix

* Use EV factory

* Test access and speed instead of just flags.isEmpty() for foot and bike parsers (graphhopper#2728)

* i18n: adding no_NO and updating pl_PL while at it (graphhopper#2730)

* areas: don't enforce empty properties, use separate check for areaID, related to graphhopper#2725

* increase point_hint limit from 100 to 170, fixes graphhopper#2732

* Moving Bokmål locale to the correct nb_NO (graphhopper#2731)

* i18n: moving Bokmål locale to the correct nb_NO

* i18n: fix a missing placeholder in translation and add nb_NO to translationmap

* i18n: lexicographical order, graphhopper#2731

* support for foot:backward and forward, fixes graphhopper#2565

* minor docs update

* move area/EV name check into relevant classes and fix graphhopper#2735

* fix annoying error message if path details are missing

* remove comment (hmm-lib is no longer used)

see graphhopper@789580c

* Split vehicle tag parsers into access, speed and priority (graphhopper#2738)

* Use multi-threading for subnetwork preparation (graphhopper#2737)

* bike: always use 4km/h for railway=platform, discussion in graphhopper#2728

* use custom_models.directory consistent naming regarding custom_areas.directory

* Report rank (by distance to network) of chosen snaps

* Graph speed measurement

* Remove block area (graphhopper#2741)

* Make sure waypoints are not removed during path simplification (graphhopper#2742)

* use FeatureCollection instead of String,Feature Map (graphhopper#2734)

* use FeatureCollection instead of String,Feature Map for CustomModel.areas

* issue

* remove comment

* adapt json and docs

* fix doc

* cleanup

* use GH maps from custom_area_feature_collection branch

* fix tests

* fix graphhopper#2339 (graphhopper#2736)

* removed unused method (Polygon, graphhopper#2741)

* more mapmatching statistics

* Remove no-longer existing extraProfiles field from maps config

* i18n: updated sv_SE (graphhopper#2748)

* Revert "removed unused method (Polygon, graphhopper#2741)"

This reverts commit 95565fd.

* Revert "Remove block area (graphhopper#2741)"

This reverts commit aa71dc2

* Allow small tolerance for waypoint consistency check, graphhopper#2742

* apparently some kind of rounding (?) is going on between the path point list and the snapped waypoint coordinates so the values are only equal with a certain accuracy
* without this fix the GH server can respond with an internal server error (500) and our tests did not cover this so far

* handle 'permit' like 'private', fixes graphhopper#2712 (graphhopper#2749)

* client-hc: add hints to response

* PathDetailsBuilderFactory: avoid modifying request

* client-hc: return hints as text

* move to more recent java versions

* Add request transformer hook to RouteResource

* i18n: updated tr and fix typo in nb_NO (graphhopper#2750)

* minor fix

* client-hc: use Helper.toObject

* readme: use jar from maven central

* Improve error message when using another vehicle than the ones used for the import, fix graphhopper#2758

* CustomModelParser: more explicit verification of method calls, fixes graphhopper#2743

* remove StringEncodedValue support from custom model due to insufficient usage/testing

* Extend Heading Documentation (graphhopper#2714)

* Minor changes for heading docs, graphhopper#2714

* Make sure LM approximation is never worse than beeline (graphhopper#2756)

* remove hike vehicle (graphhopper#2759)

* hike removal

* use roads vehicle to allow roads with hike_rating

* ensure that hike can use higher sac_scale values than foot, i.e. roads vehicle must be used

* Remove block_area (again) (graphhopper#2755)

* Fix snap issue (graphhopper#2752)

* PathDetailsBuilderFactory: avoid modifying request

* snap on edge is sometimes too close to tower node leading to inconsistencies due to GHPoint.equals check in QueryOverlayBuilder

* correction only necessary for Position.EDGE

* fix test setup

* fix repeated test

* Add test and comment

* snapping must be consistent to avoid test failure

* consistent

* fix comment

---------

Co-authored-by: easbar <easbar.mail@posteo.net>

* Extract createSolver methods

* add parsers only once if multiple bike/foot profiles

* Extract test method

* Allow adding node-based CH for profiles with turn costs

* protected

* further lower priority for sidewalk=no, especially for highways not in safe and preferred set, graphhopper#847

* fix bug in conditional handling, graphhopper#1326

* fix comment

* clean up custom models and documentation, graphhopper#2659

* foot vehicle: important fix regarding barrier nodes, bug introduced in graphhopper#2738

* Revert "Allow adding node-based CH for profiles with turn costs"

This reverts commit b2b955d.

* fix bike2.json reference in config example

* try older maven

* improve documentation for windows

* make mvn deploy to Github Actions working again with a special option instead of a version downgrade

* Use way point indices instead of intervals in ResponsePath, graphhopper#2742

* the intervals are only really needed for the simplification, so create them there

* Clarify test: instruction for two-lane (!) u-turn

* use custom weighting, since this should be most common now
* algorithm should not matter (this is tested elsewhere)

* make get+setTags of ReaderElement consistent

* fix follow up snap issue (graphhopper#2769)

* Update snapped point when changing the closest node

* update wayindex and position too

* update query distance too

---------

Co-authored-by: easbar <easbar.mail@posteo.net>

* Allow skipping the creation of ReaderNodes/Ways/Relations for pbfs, skip nodes in first pass of OSM import (graphhopper#2770)

* Show u-turn instruction for plain u-turns (graphhopper#2767)

* 7.0 release - change readme

* use 8.0-SNAPSHOT

* Add path details for the time, distance and weight of the single legs (graphhopper#2768)

* A*: set weight of visited path explicitly

* changelog: set release date

* Reuse the polygon BBox (graphhopper#2685)

Co-authored-by: Thomas Butz <thomas.butz@optitool.de>

* Make use of node tags like 'highway' or 'crossing' (graphhopper#2705)

* Pass all node tags to edge handlers

* Remove node tag count (was only used for analysis)

* crossing EV (graphhopper#2706)

* add tests; fix traffic_signalS; remove zebra as same as uncontrolled; include proposed tags https://wiki.openstreetmap.org/wiki/Proposed_features/Highway_crossing_cleanup

* fix

* fix tests

* minor fix

* minor typo

* node tag whitelist; use get not put in removeTag

* include node tags handling for road_access and fords (road_environment)

* mark only node tags of barrier edge as 'split_node'

* avoid stream and collect

* minor further perf tune

* make barrier edge explicit via tag

* simplify handleNodeTags

* Remove artificial gh:split_node tag and use long hash set instead

* minor rename

* use EdgeKVStorage for node tags storage

* rename EdgeKVStorage to KVStorage as also used to temporarily store node tags for import

* log more infos about node tags; no compact necessary due to KVStorage; limit pointer of KVStorage to positive numbers for now

* rename method to handleBarrierEdge

* fix taggednodecount method

* node tags for the barrier edge should be identical, i.e. use the ref instead of a copy

---------

Co-authored-by: Peter <graphhopper@gmx.de>

* changelog

* pt: remove hardcoded use of FastestWeighting to avoid problems with foot-priority-0 links

* New "backward_xy" variable notation in custom models (graphhopper#2760)

* initial backward_car_access impl

* test+fix when used in CustomModel

* new test regarding the addition order of (bike) VehicleTagParser and selected other TagParser

* New signature for encoded values and tag parsers (graphhopper#2740)

* Add static creators for enum encoded values

* Rename createIntAccess -> createEdgeIntAccess

* bike profile should allow reverse oneway roads and set walking speed (graphhopper#2774)

* bike: allow reverse oneways; mark them as 'get off bike' and slow down to 4km/h

* fix speed issue

* fix test

* create bike_oneway that is always true, except for the reverse direction of a oneway road

* fix tests

* minor cleanup

* initial backward_car_access impl

* test+fix when used in CustomModel

* use modified bike profile

* include custom_models/bike.json in integration test

* for bike test reverse access of oneways; use jackson allow comments feature

* revert changes to jackson parsing with comment

* include bike_priority in bike.json

* make custom models simpler via setting bike speed and priority unconditionally at the beginning

* add get_off_bike parser after bike_access

* comment

* fixed typo

* re-add test

* imports

* minor revert to master for 2 files

* Never treat a highway tagged with cycleway:both as oneway for bicycles (graphhopper#2776)

* include permit->private handling in road_access, graphhopper#2712, graphhopper#2749

* add 4 more enc values to config description

* avoid get_off_bike problem for path, fixes graphhopper#2777

* fix bug in bike custom model

* Improve bicycle handling: Now prioritise cycleways with SLIGHT_PREFER (graphhopper#2785)

* Improve bicycle handling: Now prioritise cycleways with SLIGHT_PREFER, fixes graphhopper#2784

* Add priority handling support for "cycleway:both" i "lane"

* Add priority handling support for "cycleway=opposite_track" as discussed in graphhopper#2786.

* custom_model_files arrays (graphhopper#2787)

* replace custom_model_file with custom_model_files array

* fix changelog

* certain conditional tags allow to ignore max_weight (graphhopper#2788)

* add max_weight_except encoded value; use conditional tagging to set hgv and max_weight; add maxweightrating:hgv parsing for max_weight

* include maxweightrating:hgv for MaxWeightExceptParser too

* Apply suggestions from code review

Co-authored-by: otbutz <tbutz@optitool.de>

* Update MaxWeightExceptParser.java

* Update OSMMaxWeightParser.java

* fix import

---------

Co-authored-by: otbutz <tbutz@optitool.de>

* Check cycleway access tags (graphhopper#2786)

* Check cycleway access

* Test cycleway access

* Test with non-preferred highway type

* Update contributors

* removed parser options block_private and block_fords (graphhopper#2780)

* removed block_private and block_fords

* fix issue number

* exclude private for all models under custom_models

* make intendedValues and others read-only

* adjust benchmarks for graphhopper#2780

* removed motorcycle vehicle (graphhopper#2781)

* removed block_private and block_fords

* fix issue number

* removed motorcycle vehicle

* minor fixes

* minor change

* move curvature part outside of motorcycle

* fix config-example.yml

* hike and cargo_bike: exclude private roads

* custom models: list priority first for no particular reason

* minor tweak

* Revert "removed parser options block_private and block_fords (graphhopper#2780)"

This reverts commit be7209b.

* A*: infinite approximation means the target is unreachable

* Make the MiniGraphUI working again. (graphhopper#2793)

* Use separate logger for OSM warnings

* osm_warning -> osm_warnings

* update graphhopper maps to latest

* maps: avoid URI too long for bigger custom models

* avoid IllegalStateException if duplicate path detail

* bike custom model: fix roundabout

* Prefer bicycle_road/cycleway (graphhopper#2790)

* Prefer bicycle roads and cycle streets

* Handle pushing section priority

* Add unittests

* Simplify check

* Move test into dedicated method

* Update changelog

* i18n: update da_DK (graphhopper#2794)

* Improve surface parser (graphhopper#2792)

* Move synonyms into Surface

* Add support for unhewn_cobblestone

* Handle surface subtypes

* Treat pebblestone as gravel

* Treat grass_paver as grass

* Add support for wooden surfaces

* Test all synonyms

* Check subtypes in dedicated test

* Update changelog

* avoid config mistakes

* Add timeout_ms parameter for routing requests (graphhopper#2795)

* Upgrade to dropwizard 2.1.6 (graphhopper#2653)

* upgrade to dropwizard 2.1.1

* try 2.1.4

* latest 2.1.6

---------

Co-authored-by: easbar <easbar.mail@posteo.net>

* resurrect appveyor

* appveyor: revert part of the change

* upgrade commons-io + junit-bom + osmosis-osm-binary

* bike: differentiate between bad highways (graphhopper#2796)

* bike: there is a difference between avoid highways like trunk and secondary

* add one more test for secondary

* avoid creation of values()

* reduce calling PriorityCode.getValue, code review in graphhopper#2796

* minor test rename

* Update nl and cz translations (graphhopper#2799)

* Update nl and cz translations

* Fix nl translation

* upgrade janino to latest version 3.1.9; remove our workaround for 3.1.6 and below

* cleanup of EnumEncodedValue  (graphhopper#2800)

* remove custom toString in EnumEncodedValue and avoid calling Enum::values()

* API JSON response must not change

* custom toString necessary for Country and HazmatTunnel

* fix imports

* always use unix LF, related graphhopper#2791

* Add root editorconfig (graphhopper#2791)

* Update CONTRIBUTING.md

* Prefer bigger roads for racebike (graphhopper#2802)

* Make the MiniGraphUI working again.

* Improve priority handling for race bikes as discussed in graphhopper#2796

* Adopt expected Monaco test result for race bike profile

* changelog for graphhopper#2796 and graphhopper#2802

* This is a 400 user error, not an ERROR in the logging sense

* Simplify WaySegmentParser.Builder

* Release some memory earlier after reading OSM

* profile name, not vehicle name

* Fix

* Add check for pillar node overflow

* OSMNodeData.nodeKVStorage: add missing create

* ferry: hgv=yes allows car even if car tagging is missing

* B-tree: Make space for values configurable (graphhopper#2814)

* initial working version

* make to and from long more clear

* make it working for negative keys and values

* nextLong(bounds) only for more recent JDKs

* fix javadoc

* Use long for pillar node id stack variables

* use long where it could be a pillar or tower node

* simulate large amount of pillar nodes

* remove second check for pillar nodes

* use 0 as start again

* minor

* make empty value configurable

* changes for review

---------

Co-authored-by: easbar <easbar.mail@posteo.net>

* clarify foot access parser (graphhopper#2801)

* De-prioritise steps for bicycles (graphhopper#2804)

* De-prioritise steps for bicycles, fixes graphhopper#2803 original discovery Also use MIN_SPEED for highway=steps in the mtb profile

* Don't explicitly call setHighwaySpeed for Mountainbike for values which are used in BikeCommonAverageSpeedParser

* De-prioritise steps for bicycles to BAD

* Also initialize the avoidHighwayTags with BAD just in order to avoid confusion.

* Remove steps from the avoidHighwayTags map

* i18n: updated tr (@ihsanguldur) and added new translation for Kazakh kz

* differentiate travel time betas for access vs egress

* Make sure directed edge filter receives real edge

* public CustomModelParser.createWeightingParameters

* hike model: allow private tags that are for motor vehicles only, adds tests of the model, fixes graphhopper#2820

* Update README.md

* Set empty custom model in custom profile constructor (graphhopper#2821)

* Update deploy.md

* number formatting: use ENGLISH instead of FRENCH as it sometimes causes missing symbols in terminals

* Try latest JDK 20 (graphhopper#2789)

* try jdk 20

* try again

* Process callables GHUtility.runConcurrently in batches to save memory (graphhopper#2828)

* Process callables in batches to save memory

* changelog

* Do not re-use Executorservice

* Overhauled Moving Average Elevation Smoothing (graphhopper#2772)

* first implementation which is validated with unit tests

no focus on performance, code beauty or documentation. used for validation and comparison with some real world test areas

* overwrite previous averaging algorithm, added unit tests and made window size configurable

* explain unit test

* incorporate pr feedback from otbutz

* use IntDoubleHashMap to avoid object unboxing

* extended contributor list

* pr feedback: rename config to be more consistent

* pr feedback: code formatting

* pr feedback: having a dedicated class for each implementation and tests

* avoid incorrect urban_density classification for the USA (graphhopper#2832)

* initial workaround for graphhopper#2829

* use enum

* Fix QueryGraph#getEdges

* previously we got an error when we tried to call getEdgeIteratorState with edge IDs running up to QueryGraph#getEdges()

* Country subdivision (state) (graphhopper#2830)

* initial version to include subdivision in Country enum

* minor fix

* use correct PR

* GHUtility cleanup

* allow country comparison via getAlpha3 method

* minor fixes

* clarify iso codes with the help of wikipedia

* use alpha2 for custom model to make it more consistent

* minor fixes

* try separate state instead of country extension

* minor enhancement

* use complete use for getStateCode

* fix

* use getter instead of create

* remove TODO

* for now this method is used only once, so avoid overhead

* shorter

* Use ForkJoinPool for concurrent processing (graphhopper#2833)

* residential should not be ignored but treated as tertiary, graphhopper#2832

* Remove BitUtilBig (graphhopper#2811)

* Fix interchanged parameter names in bit util

* removed BitUtilBig

* cleanup

---------

Co-authored-by: Peter <graphhopper@gmx.de>

* update GH maps to latest

* Clean up country/state selection logic, graphhopper#2830

* default speed limits (graphhopper#2810)

* initial version

* less output

* maxspeed tag vs max_speed name

* less logging

* use urbanDensity in replaceFunction and explicitly set maxspeed only if UNSET_SPEED

* added tests

* replace CountryRule.getMaxSpeed with LegalDefaultSpeeds lib

* tricky. thinking...

* lane support

* surface support

* residential roads have the same limits in Germany

* do not forget the reverse speed

* use same version as osm-legal-default-speeds-jvm

* something is strange with dropwizard tests as they require an explicit dependency on kotlin-stdlib (not kotlin-stdlib-jdk8)

* force okhttp and osm-legal-default-speeds-jvm to use both more recent but same kotlin 1.8.0

* use more recent okio with recommended kotlin 1.6.20; seems to work for osm-legal-default-speeds-jvm too

* make createWeightingParameters public

* separate storage and parser for default max speed and only combine this after import with the maxspeed tag from OSM

* separate close

* default speed library does not support maxspeed:forward and :backward tags

* test regarding living_street is now useless at that level

* comment

* fix problematic forward/backward case

* store osm max_speed and temporarily the default urban+rural from library to improve max_speed afterwards

* reduce overhead a bit and force type

* grow array on get too

* storage: we need a tiny offset

* okhttp 4.11.0 has cleaner deps

* reduce tag count and cache speeds to reduce overhead, see westnordost/osm-legal-default-speeds#7

* configure preliminary GHDirectory

* added maxweight

* avoid default-maxspeed library while OSM parsing

* Revert "avoid default-maxspeed library while OSM parsing"

This reverts commit 8b07594.

* fix setup to use the same GHDirectory instance to avoid problems with missing directory etc

* consider walk as 6kmh

* don't interpret country-dependent speeds in stringToKmh

* call computeIfAbsent for cache; convert maxspeed into kmh before import; fix test for stringToKmh

* fix comment

* added description to config

* add max_speed_estimated boolean encoded value

* use speedlib v1.3

* use statecode to feed speedlib

* updated legal_default_speeds.json

* residential should not be ignored but treated as tertiary, graphhopper#2832

* comment

* Update maps

* typo

* bike: remove hazmat handling, fixes graphhopper#2840

* bug fix for UK speed limit

* use unlimited speed constant for DEU

* Fix compilation

* Fix matrix test

* Fix tests

* Fix compilation

* Fix matrix profiles and add tests

* Fix merge conflict

---------

Co-authored-by: Peter <graphhopper@gmx.de>
Co-authored-by: ratrun <ratrun@gmx.at>
Co-authored-by: easbar <easbar.mail@posteo.net>
Co-authored-by: Michael Zilske <michael.zilske@tu-berlin.de>
Co-authored-by: OlafFlebbeBosch <123375381+OlafFlebbeBosch@users.noreply.github.com>
Co-authored-by: Lukas Weber <32765578+lukasalexanderweber@users.noreply.github.com>
Co-authored-by: otbutz <tbutz@optitool.de>
Co-authored-by: Thomas Butz <thomas.butz@optitool.de>
Co-authored-by: bt90 <btom1990@googlemail.com>
Co-authored-by: Robin <boldtrn@users.noreply.github.com>
Co-authored-by: Christoph Lingg <christoph@lingg.eu>
jp-lopez added a commit to StuartApp/graphhopper-matrix that referenced this pull request Oct 27, 2023
* set feature.id from feature.properties.id for our countries.geojson, related to graphhopper#2725

* getResourceAsStream implicitly creates a FileSystem required when the file is in the jar, https://stackoverflow.com/q/25032716/194609

* specially handle "NO_EDGE"; fixes graphhopper#2723

* Extract method

* avoid rounding down small speed (graphhopper#2726)

* Maxspeed fix (graphhopper#2727)

* clean up speed and maxspeed handling

* bug fix

* for bike we have to pick maximum max_speed

* fix yet another bug

* Do not check if edge flags are empty before handling node tags

* Return void from TagParser#handleWayTags

* Remove some explicit edge flag usage

* EncodingManager: initializer config is only needed when building

* Fix

* Use EV factory

* Test access and speed instead of just flags.isEmpty() for foot and bike parsers (graphhopper#2728)

* i18n: adding no_NO and updating pl_PL while at it (graphhopper#2730)

* areas: don't enforce empty properties, use separate check for areaID, related to graphhopper#2725

* increase point_hint limit from 100 to 170, fixes graphhopper#2732

* Moving Bokmål locale to the correct nb_NO (graphhopper#2731)

* i18n: moving Bokmål locale to the correct nb_NO

* i18n: fix a missing placeholder in translation and add nb_NO to translationmap

* i18n: lexicographical order, graphhopper#2731

* support for foot:backward and forward, fixes graphhopper#2565

* minor docs update

* move area/EV name check into relevant classes and fix graphhopper#2735

* fix annoying error message if path details are missing

* remove comment (hmm-lib is no longer used)

see graphhopper@789580c

* Split vehicle tag parsers into access, speed and priority (graphhopper#2738)

* Use multi-threading for subnetwork preparation (graphhopper#2737)

* bike: always use 4km/h for railway=platform, discussion in graphhopper#2728

* use custom_models.directory consistent naming regarding custom_areas.directory

* Report rank (by distance to network) of chosen snaps

* Graph speed measurement

* Remove block area (graphhopper#2741)

* Make sure waypoints are not removed during path simplification (graphhopper#2742)

* use FeatureCollection instead of String,Feature Map (graphhopper#2734)

* use FeatureCollection instead of String,Feature Map for CustomModel.areas

* issue

* remove comment

* adapt json and docs

* fix doc

* cleanup

* use GH maps from custom_area_feature_collection branch

* fix tests

* fix graphhopper#2339 (graphhopper#2736)

* removed unused method (Polygon, graphhopper#2741)

* more mapmatching statistics

* Remove no-longer existing extraProfiles field from maps config

* i18n: updated sv_SE (graphhopper#2748)

* Revert "removed unused method (Polygon, graphhopper#2741)"

This reverts commit 95565fd.

* Revert "Remove block area (graphhopper#2741)"

This reverts commit aa71dc2

* Allow small tolerance for waypoint consistency check, graphhopper#2742

* apparently some kind of rounding (?) is going on between the path point list and the snapped waypoint coordinates so the values are only equal with a certain accuracy
* without this fix the GH server can respond with an internal server error (500) and our tests did not cover this so far

* handle 'permit' like 'private', fixes graphhopper#2712 (graphhopper#2749)

* client-hc: add hints to response

* PathDetailsBuilderFactory: avoid modifying request

* client-hc: return hints as text

* move to more recent java versions

* Add request transformer hook to RouteResource

* i18n: updated tr and fix typo in nb_NO (graphhopper#2750)

* minor fix

* client-hc: use Helper.toObject

* readme: use jar from maven central

* Improve error message when using another vehicle than the ones used for the import, fix graphhopper#2758

* CustomModelParser: more explicit verification of method calls, fixes graphhopper#2743

* remove StringEncodedValue support from custom model due to insufficient usage/testing

* Extend Heading Documentation (graphhopper#2714)

* Minor changes for heading docs, graphhopper#2714

* Make sure LM approximation is never worse than beeline (graphhopper#2756)

* remove hike vehicle (graphhopper#2759)

* hike removal

* use roads vehicle to allow roads with hike_rating

* ensure that hike can use higher sac_scale values than foot, i.e. roads vehicle must be used

* Remove block_area (again) (graphhopper#2755)

* Fix snap issue (graphhopper#2752)

* PathDetailsBuilderFactory: avoid modifying request

* snap on edge is sometimes too close to tower node leading to inconsistencies due to GHPoint.equals check in QueryOverlayBuilder

* correction only necessary for Position.EDGE

* fix test setup

* fix repeated test

* Add test and comment

* snapping must be consistent to avoid test failure

* consistent

* fix comment

---------

Co-authored-by: easbar <easbar.mail@posteo.net>

* Extract createSolver methods

* add parsers only once if multiple bike/foot profiles

* Extract test method

* Allow adding node-based CH for profiles with turn costs

* protected

* further lower priority for sidewalk=no, especially for highways not in safe and preferred set, graphhopper#847

* fix bug in conditional handling, graphhopper#1326

* fix comment

* clean up custom models and documentation, graphhopper#2659

* foot vehicle: important fix regarding barrier nodes, bug introduced in graphhopper#2738

* Revert "Allow adding node-based CH for profiles with turn costs"

This reverts commit b2b955d.

* fix bike2.json reference in config example

* try older maven

* improve documentation for windows

* make mvn deploy to Github Actions working again with a special option instead of a version downgrade

* Use way point indices instead of intervals in ResponsePath, graphhopper#2742

* the intervals are only really needed for the simplification, so create them there

* Clarify test: instruction for two-lane (!) u-turn

* use custom weighting, since this should be most common now
* algorithm should not matter (this is tested elsewhere)

* make get+setTags of ReaderElement consistent

* fix follow up snap issue (graphhopper#2769)

* Update snapped point when changing the closest node

* update wayindex and position too

* update query distance too

---------

Co-authored-by: easbar <easbar.mail@posteo.net>

* Allow skipping the creation of ReaderNodes/Ways/Relations for pbfs, skip nodes in first pass of OSM import (graphhopper#2770)

* Show u-turn instruction for plain u-turns (graphhopper#2767)

* 7.0 release - change readme

* use 8.0-SNAPSHOT

* Add path details for the time, distance and weight of the single legs (graphhopper#2768)

* A*: set weight of visited path explicitly

* changelog: set release date

* Reuse the polygon BBox (graphhopper#2685)

Co-authored-by: Thomas Butz <thomas.butz@optitool.de>

* Make use of node tags like 'highway' or 'crossing' (graphhopper#2705)

* Pass all node tags to edge handlers

* Remove node tag count (was only used for analysis)

* crossing EV (graphhopper#2706)

* add tests; fix traffic_signalS; remove zebra as same as uncontrolled; include proposed tags https://wiki.openstreetmap.org/wiki/Proposed_features/Highway_crossing_cleanup

* fix

* fix tests

* minor fix

* minor typo

* node tag whitelist; use get not put in removeTag

* include node tags handling for road_access and fords (road_environment)

* mark only node tags of barrier edge as 'split_node'

* avoid stream and collect

* minor further perf tune

* make barrier edge explicit via tag

* simplify handleNodeTags

* Remove artificial gh:split_node tag and use long hash set instead

* minor rename

* use EdgeKVStorage for node tags storage

* rename EdgeKVStorage to KVStorage as also used to temporarily store node tags for import

* log more infos about node tags; no compact necessary due to KVStorage; limit pointer of KVStorage to positive numbers for now

* rename method to handleBarrierEdge

* fix taggednodecount method

* node tags for the barrier edge should be identical, i.e. use the ref instead of a copy

---------

Co-authored-by: Peter <graphhopper@gmx.de>

* changelog

* pt: remove hardcoded use of FastestWeighting to avoid problems with foot-priority-0 links

* New "backward_xy" variable notation in custom models (graphhopper#2760)

* initial backward_car_access impl

* test+fix when used in CustomModel

* new test regarding the addition order of (bike) VehicleTagParser and selected other TagParser

* New signature for encoded values and tag parsers (graphhopper#2740)

* Add static creators for enum encoded values

* Rename createIntAccess -> createEdgeIntAccess

* bike profile should allow reverse oneway roads and set walking speed (graphhopper#2774)

* bike: allow reverse oneways; mark them as 'get off bike' and slow down to 4km/h

* fix speed issue

* fix test

* create bike_oneway that is always true, except for the reverse direction of a oneway road

* fix tests

* minor cleanup

* initial backward_car_access impl

* test+fix when used in CustomModel

* use modified bike profile

* include custom_models/bike.json in integration test

* for bike test reverse access of oneways; use jackson allow comments feature

* revert changes to jackson parsing with comment

* include bike_priority in bike.json

* make custom models simpler via setting bike speed and priority unconditionally at the beginning

* add get_off_bike parser after bike_access

* comment

* fixed typo

* re-add test

* imports

* minor revert to master for 2 files

* Never treat a highway tagged with cycleway:both as oneway for bicycles (graphhopper#2776)

* include permit->private handling in road_access, graphhopper#2712, graphhopper#2749

* add 4 more enc values to config description

* avoid get_off_bike problem for path, fixes graphhopper#2777

* fix bug in bike custom model

* Improve bicycle handling: Now prioritise cycleways with SLIGHT_PREFER (graphhopper#2785)

* Improve bicycle handling: Now prioritise cycleways with SLIGHT_PREFER, fixes graphhopper#2784

* Add priority handling support for "cycleway:both" i "lane"

* Add priority handling support for "cycleway=opposite_track" as discussed in graphhopper#2786.

* custom_model_files arrays (graphhopper#2787)

* replace custom_model_file with custom_model_files array

* fix changelog

* certain conditional tags allow to ignore max_weight (graphhopper#2788)

* add max_weight_except encoded value; use conditional tagging to set hgv and max_weight; add maxweightrating:hgv parsing for max_weight

* include maxweightrating:hgv for MaxWeightExceptParser too

* Apply suggestions from code review

Co-authored-by: otbutz <tbutz@optitool.de>

* Update MaxWeightExceptParser.java

* Update OSMMaxWeightParser.java

* fix import

---------

Co-authored-by: otbutz <tbutz@optitool.de>

* Check cycleway access tags (graphhopper#2786)

* Check cycleway access

* Test cycleway access

* Test with non-preferred highway type

* Update contributors

* removed parser options block_private and block_fords (graphhopper#2780)

* removed block_private and block_fords

* fix issue number

* exclude private for all models under custom_models

* make intendedValues and others read-only

* adjust benchmarks for graphhopper#2780

* removed motorcycle vehicle (graphhopper#2781)

* removed block_private and block_fords

* fix issue number

* removed motorcycle vehicle

* minor fixes

* minor change

* move curvature part outside of motorcycle

* fix config-example.yml

* hike and cargo_bike: exclude private roads

* custom models: list priority first for no particular reason

* minor tweak

* Revert "removed parser options block_private and block_fords (graphhopper#2780)"

This reverts commit be7209b.

* A*: infinite approximation means the target is unreachable

* Make the MiniGraphUI working again. (graphhopper#2793)

* Use separate logger for OSM warnings

* osm_warning -> osm_warnings

* update graphhopper maps to latest

* maps: avoid URI too long for bigger custom models

* avoid IllegalStateException if duplicate path detail

* bike custom model: fix roundabout

* Prefer bicycle_road/cycleway (graphhopper#2790)

* Prefer bicycle roads and cycle streets

* Handle pushing section priority

* Add unittests

* Simplify check

* Move test into dedicated method

* Update changelog

* i18n: update da_DK (graphhopper#2794)

* Improve surface parser (graphhopper#2792)

* Move synonyms into Surface

* Add support for unhewn_cobblestone

* Handle surface subtypes

* Treat pebblestone as gravel

* Treat grass_paver as grass

* Add support for wooden surfaces

* Test all synonyms

* Check subtypes in dedicated test

* Update changelog

* avoid config mistakes

* Add timeout_ms parameter for routing requests (graphhopper#2795)

* Upgrade to dropwizard 2.1.6 (graphhopper#2653)

* upgrade to dropwizard 2.1.1

* try 2.1.4

* latest 2.1.6

---------

Co-authored-by: easbar <easbar.mail@posteo.net>

* resurrect appveyor

* appveyor: revert part of the change

* upgrade commons-io + junit-bom + osmosis-osm-binary

* bike: differentiate between bad highways (graphhopper#2796)

* bike: there is a difference between avoid highways like trunk and secondary

* add one more test for secondary

* avoid creation of values()

* reduce calling PriorityCode.getValue, code review in graphhopper#2796

* minor test rename

* Update nl and cz translations (graphhopper#2799)

* Update nl and cz translations

* Fix nl translation

* upgrade janino to latest version 3.1.9; remove our workaround for 3.1.6 and below

* cleanup of EnumEncodedValue  (graphhopper#2800)

* remove custom toString in EnumEncodedValue and avoid calling Enum::values()

* API JSON response must not change

* custom toString necessary for Country and HazmatTunnel

* fix imports

* always use unix LF, related graphhopper#2791

* Add root editorconfig (graphhopper#2791)

* Update CONTRIBUTING.md

* Prefer bigger roads for racebike (graphhopper#2802)

* Make the MiniGraphUI working again.

* Improve priority handling for race bikes as discussed in graphhopper#2796

* Adopt expected Monaco test result for race bike profile

* changelog for graphhopper#2796 and graphhopper#2802

* This is a 400 user error, not an ERROR in the logging sense

* Simplify WaySegmentParser.Builder

* Release some memory earlier after reading OSM

* profile name, not vehicle name

* Fix

* Add check for pillar node overflow

* OSMNodeData.nodeKVStorage: add missing create

* ferry: hgv=yes allows car even if car tagging is missing

* B-tree: Make space for values configurable (graphhopper#2814)

* initial working version

* make to and from long more clear

* make it working for negative keys and values

* nextLong(bounds) only for more recent JDKs

* fix javadoc

* Use long for pillar node id stack variables

* use long where it could be a pillar or tower node

* simulate large amount of pillar nodes

* remove second check for pillar nodes

* use 0 as start again

* minor

* make empty value configurable

* changes for review

---------

Co-authored-by: easbar <easbar.mail@posteo.net>

* clarify foot access parser (graphhopper#2801)

* De-prioritise steps for bicycles (graphhopper#2804)

* De-prioritise steps for bicycles, fixes graphhopper#2803 original discovery Also use MIN_SPEED for highway=steps in the mtb profile

* Don't explicitly call setHighwaySpeed for Mountainbike for values which are used in BikeCommonAverageSpeedParser

* De-prioritise steps for bicycles to BAD

* Also initialize the avoidHighwayTags with BAD just in order to avoid confusion.

* Remove steps from the avoidHighwayTags map

* i18n: updated tr (@ihsanguldur) and added new translation for Kazakh kz

* differentiate travel time betas for access vs egress

* Make sure directed edge filter receives real edge

* public CustomModelParser.createWeightingParameters

* hike model: allow private tags that are for motor vehicles only, adds tests of the model, fixes graphhopper#2820

* Update README.md

* Set empty custom model in custom profile constructor (graphhopper#2821)

* Update deploy.md

* number formatting: use ENGLISH instead of FRENCH as it sometimes causes missing symbols in terminals

* Try latest JDK 20 (graphhopper#2789)

* try jdk 20

* try again

* Process callables GHUtility.runConcurrently in batches to save memory (graphhopper#2828)

* Process callables in batches to save memory

* changelog

* Do not re-use Executorservice

* Overhauled Moving Average Elevation Smoothing (graphhopper#2772)

* first implementation which is validated with unit tests

no focus on performance, code beauty or documentation. used for validation and comparison with some real world test areas

* overwrite previous averaging algorithm, added unit tests and made window size configurable

* explain unit test

* incorporate pr feedback from otbutz

* use IntDoubleHashMap to avoid object unboxing

* extended contributor list

* pr feedback: rename config to be more consistent

* pr feedback: code formatting

* pr feedback: having a dedicated class for each implementation and tests

* avoid incorrect urban_density classification for the USA (graphhopper#2832)

* initial workaround for graphhopper#2829

* use enum

* Fix QueryGraph#getEdges

* previously we got an error when we tried to call getEdgeIteratorState with edge IDs running up to QueryGraph#getEdges()

* Country subdivision (state) (graphhopper#2830)

* initial version to include subdivision in Country enum

* minor fix

* use correct PR

* GHUtility cleanup

* allow country comparison via getAlpha3 method

* minor fixes

* clarify iso codes with the help of wikipedia

* use alpha2 for custom model to make it more consistent

* minor fixes

* try separate state instead of country extension

* minor enhancement

* use complete use for getStateCode

* fix

* use getter instead of create

* remove TODO

* for now this method is used only once, so avoid overhead

* shorter

* Use ForkJoinPool for concurrent processing (graphhopper#2833)

* residential should not be ignored but treated as tertiary, graphhopper#2832

* Remove BitUtilBig (graphhopper#2811)

* Fix interchanged parameter names in bit util

* removed BitUtilBig

* cleanup

---------

Co-authored-by: Peter <graphhopper@gmx.de>

* update GH maps to latest

* Clean up country/state selection logic, graphhopper#2830

* default speed limits (graphhopper#2810)

* initial version

* less output

* maxspeed tag vs max_speed name

* less logging

* use urbanDensity in replaceFunction and explicitly set maxspeed only if UNSET_SPEED

* added tests

* replace CountryRule.getMaxSpeed with LegalDefaultSpeeds lib

* tricky. thinking...

* lane support

* surface support

* residential roads have the same limits in Germany

* do not forget the reverse speed

* use same version as osm-legal-default-speeds-jvm

* something is strange with dropwizard tests as they require an explicit dependency on kotlin-stdlib (not kotlin-stdlib-jdk8)

* force okhttp and osm-legal-default-speeds-jvm to use both more recent but same kotlin 1.8.0

* use more recent okio with recommended kotlin 1.6.20; seems to work for osm-legal-default-speeds-jvm too

* make createWeightingParameters public

* separate storage and parser for default max speed and only combine this after import with the maxspeed tag from OSM

* separate close

* default speed library does not support maxspeed:forward and :backward tags

* test regarding living_street is now useless at that level

* comment

* fix problematic forward/backward case

* store osm max_speed and temporarily the default urban+rural from library to improve max_speed afterwards

* reduce overhead a bit and force type

* grow array on get too

* storage: we need a tiny offset

* okhttp 4.11.0 has cleaner deps

* reduce tag count and cache speeds to reduce overhead, see westnordost/osm-legal-default-speeds#7

* configure preliminary GHDirectory

* added maxweight

* avoid default-maxspeed library while OSM parsing

* Revert "avoid default-maxspeed library while OSM parsing"

This reverts commit 8b07594.

* fix setup to use the same GHDirectory instance to avoid problems with missing directory etc

* consider walk as 6kmh

* don't interpret country-dependent speeds in stringToKmh

* call computeIfAbsent for cache; convert maxspeed into kmh before import; fix test for stringToKmh

* fix comment

* added description to config

* add max_speed_estimated boolean encoded value

* use speedlib v1.3

* use statecode to feed speedlib

* updated legal_default_speeds.json

* residential should not be ignored but treated as tertiary, graphhopper#2832

* comment

* Update maps

* typo

* bike: remove hazmat handling, fixes graphhopper#2840

* bug fix for UK speed limit

* use unlimited speed constant for DEU

* Use junction density to determine road network density (graphhopper#2842)

* Update config example and skip country requirement, for graphhopper#2842

* fix bug for single forward or backward maxspeed

* bike: reduce elevation influence

* bike: bug fix

* countries: avoid problems for BE and NL

* turn cost: reduce object creation and throw error if more than 1 int is needed

* updated GH Maps

* bike elevation: reduce speed for extreme slopes like https://graphhopper.com/maps/?point=49.965202%252C11.57992&point=49.968355%252C11.578118&profile=bike

* Make car speed parser bad surfaces consistent with surface encoded value (graphhopper#2843)

* Do not ignore maxspeed:forward/backward when they are larger than maxpeed (graphhopper#2844)

* hide the 'vehicle' EVs and vehicle names, related to graphhopper#2841

* Use fallback speed also for ways that are neither highways nor ferries (graphhopper#2845)

* Make RoadEnvironment.FERRY overrule RoadEnvironment.FORD also for node tags (graphhopper#2846)

* route=ferry means it's a ferry even when there is also a highway tag

* Add wood and fine_gravel to badSurfaceSpeedMap

* Remove leftovers from encoder splitting in foot+wheelchair speed parsers

* Calculate urban density directly after OSM import

* should be available when we create weightings for the first time, like in prepare subnetworks

* increase precision for car_average_speed to factor=2 and 7 bits

* Improve road density calculation for long tunnels or motorways

* throw error for too small speed values (graphhopper#2847)

* move setSpeed to CarAverageSpeedParser

* throw exception if too low speed

* no maxPossibleSpeed

* fix a few comments

* Update AbstractAverageSpeedParser.java

* Update AbstractAverageSpeedParser.java

* fix tests for 7186a61

* Remove headingPenaltyMillis (graphhopper#2563)


Co-authored-by: Peter <graphhopper@gmx.de>

* ferry speed calculator (graphhopper#2849)

* Use same definition for ferries for road environment and speed parsers (graphhopper#2853)

* Use speed_factor=2 in examples

* Quickfix for maxspeed=1, graphhopper#2847

* internal custom models (graphhopper#2854)

* No more loop edges (graphhopper#2862)

* LandmarkStorageTest: clean up, related to graphhopper#2864

* Remove Weighting#calcWeightWithAccess (graphhopper#2864)

* Remove optimization in CH iterator (graphhopper#2869)

* heading penalty ignored for custom weighting (graphhopper#2852)

* heading_penalty parameter should be picked and properly merged for custom weighting too

* use heading penalty for weight only

* consider custom_model.heading_penalty not as public API and copy from heading_penalty for low level API too

* minor

* firefox sends that it needs this header

* make it possible to use internal and external custom models at the same time, for graphhopper#2854

* Simplify turn cost storage + add versioning

* prepend instead of append new turn cost entries (easier to code and we do the same for edges in base graph)
* extract search method (no need to code it twice for get/set)

* Properly use encoded value in turn cost storage, removes update limitation

* Remove no-longer failing tests, graphhopper#1574

* These tests no longer seem to fail when we revert the corresponding fix (set precision in DijkstraBidirectionCH to 0)
* There is still testStallOnDemandViaVirtuaNode_issue1574 which describes the problem in more detail anyway

* Remove unclear test, graphhopper#1582

I was not able to reproduce this old bug by reverting the corresponding change in QueryOverlayBuilder, so it's impossible to keep it reproducible like this -> simply removed it for now. The problem should be covered by our randomized tests (but I was not able to find a new example on the quick)

* Github packages cleanup try

* Change last 30 to last 300 packages

* Stop using DefaultTurnCostProvider and some access flags for low-level testing (graphhopper#2870)

* Remove edgeHasNoAccess from Weighting interface (graphhopper#2872)

* encoded value name a bit stricter

* Remove shortest weighting from DefaultWeightingFactory class (graphhopper#2865)

* heading_penalty parameter should be picked and properly merged for custom weighting too

* remove shortest weighting

* keep ShortestWeighting in jar

* keep default constructor

* fix imports

* fix imports

* comments from review

* changelog

---------

Co-authored-by: easbar <easbar.mail@posteo.net>

* minor docs improvement

* Use a different action (graphhopper#2876)

* Use a different action

* Change the version

* Fix error logging for RouteResource (graphhopper#2837)

* use WebApplicationException

* Set message for MultiException

* Do not log server-side stack trace when ghResponse has errors

* type=gpx seems to be only supported for GET; return XML content if there is an error

* use different media type

* add logging but to info and no stacktrace

* log not twice. for POST we implicitly use MultiExceptionMapper

---------

Co-authored-by: easbar <easbar.mail@posteo.net>

* Remove fastest weighting from DefaultWeightingFactory class (graphhopper#2866)

* heading_penalty parameter should be picked and properly merged for custom weighting too

* remove shortest weighting

* remove fastest weighting

* merged remove_shortest

* removed classes PriorityWeighting and ShortFastestWeighting

* cleanup

* removed CustomProfile class

* remove old CustomProfile usage

* Minor changes during review

* review

* handle wheelchair problem later

* updated profiles.md

* now no need for a third run with weighting=custom

---------

Co-authored-by: easbar <easbar.mail@posteo.net>

* Resolve custom model files and areas in core, close graphhopper#2874

* Remove more access flags from tests

* No more access for buildRandomGraph

* Revert "firefox sends that it needs this header" due to graphhopper/graphhopper-maps@e04892a

* Remove max_turn_costs encoder parameter (graphhopper#2880)

* isochrone: fix wrong termination condition

* Fix deprecated usage of Maven Antrun plugin

* Remove turn cost storage optimization for edge-based CH

* Use int instead of byte storage for turn costs

* Add external boolean EV

* Add getter for encoded values string

* include osm date in response, replaces graphhopper#2818 (graphhopper#2877)

* Use boolean turn restriction enc instead of decimal turn cost enc (graphhopper#2882)

* LM: minor cleanup

* Separate turn cost and edge EncodedValues (graphhopper#2884)

* separate turn from normal EncodedValue

* changelog

* update GH maps

* i18n: added uz

* i18n: updated fa, he, hu_HU, sk

* i18n: updated translation keys

* 8.0 release - change readme

* Fix compile

* Fix test

* Fix route resource test

---------

Co-authored-by: Peter <graphhopper@gmx.de>
Co-authored-by: Michael Zilske <michael.zilske@tu-berlin.de>
Co-authored-by: easbar <easbar.mail@posteo.net>
Co-authored-by: OlafFlebbeBosch <123375381+OlafFlebbeBosch@users.noreply.github.com>
Co-authored-by: Lukas Weber <32765578+lukasalexanderweber@users.noreply.github.com>
Co-authored-by: otbutz <tbutz@optitool.de>
Co-authored-by: Thomas Butz <thomas.butz@optitool.de>
Co-authored-by: ratrun <ratrun@gmx.at>
Co-authored-by: bt90 <btom1990@googlemail.com>
Co-authored-by: Robin <boldtrn@users.noreply.github.com>
Co-authored-by: Christoph Lingg <christoph@lingg.eu>
Co-authored-by: Rok Carl <rokcarl@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants