... are used to decide whether an operation should be done in cost-based mode instead of Euclidean mode.
Currently, GIS_OPT_COSTMAP is only checked and set on program initialization, when the CLI parameters are parsed.
We also need a way to trigger cost-based mode whenever a precomputed links map is given via "initial=", and it contains a valid "cost" field!
The implementation plan for this is already in the source code (ca. line 3514, in main program block):
# TODO: TRIGGER COST-BASED MODE HERE IF "COST" ATTRIBUTE IS PRESENT!
# TODO: 1. Check for presence and type of field "cost".
# TODO: 2. Content completeness of field "cost" must be checker earlier: in check_input!
# TODO 3. "cost" field and contents must be generated adhoc, if it does not exist but "costmap=" is specified!
# TODO: 4. Set global var "COST_MODE" to "TRUE" if appropriate.
# TODO: 5. Only model_complete() must ever read $GIS_OPT_COSTMAP!
# TODO: All other tests for $GIS_OPT_COSTMAP must be replaced with $COST_MODE
# TODO: 6. model_complete() must also set COST_MODE as required!
Throughout the code, constructs like this one:
... are used to decide whether an operation should be done in cost-based mode instead of Euclidean mode.
Currently, GIS_OPT_COSTMAP is only checked and set on program initialization, when the CLI parameters are parsed. We also need a way to trigger cost-based mode whenever a precomputed links map is given via "initial=", and it contains a valid "cost" field!
The implementation plan for this is already in the source code (ca. line 3514, in main program block):