abrensch / brouter

configurable OSM offline router with elevation awareness, Java + Android
MIT License
476 stars 115 forks source link

optimizing constant expressions in profile parsing #573

Closed abrensch closed 1 year ago

abrensch commented 1 year ago

This is the patch for the corresponding issue https://github.com/abrensch/brouter/issues/566

It improves the handling of constant expressions in the profile compiler

Visible effect should be that tags that are unused by configuration (e.g. estimated_forest_class) do not appear in the table if process_unused_tags=false

Tested so far via the unit tests only.

Unit tests had found a problem with injected key-values so I had to change the handling of these. An Injected value is now injected as a Number-Expression-Operand of the assign-expression that assigns the variable.

abrensch commented 1 year ago

Repeating my last comment that is hidden in the "resolved conversation":

abrensch commented 1 year ago

Repeating my last comment that is hidden in the "resolved conversation":

Got [your point about injecting keys not defined in the profile]. I reworked the keyValue injection, but in a way that keeps a single data-path and works at parsetime only.

I also added a unit-test, and extended the "ProfileComparator" to support manual testing.

afischerdev commented 1 year ago

Great, this worked again for me and my tests. Only 'consider_traffic' in fastbike profile should be reworked. This is not reachable.