adamfranco / curvature

Find roads that are the most curvy or twisty based on Open Street Map (OSM) data.
http://roadcurvature.com/
225 stars 39 forks source link

Added three identical example chains #34

Closed Fonsan closed 8 years ago

Fonsan commented 8 years ago

These should be @adamfranco defaults

Since we have coupled the iterator logic with the actual processing of each processor the callback version calls process every time with a new list with one element

I have verified with a smaller dataset (Fiji) that the output is identical from all 3 scripts

Fonsan commented 8 years ago

I realised that the callback_chain_example is not compatible with the Head post processor since the process method is called multiple times, even if we fixed Head to use a internal state it would not be efficient and stop iterating over the input, we need to define a standard on how to communicate a abort signal

adamfranco commented 8 years ago

One little thing to fix would be to add some relative-path logic to the shell-piping example pp-example.sh so that the script can be called from any directory:

# Store our the program path.
pushd `dirname $0` > /dev/null
my_path=`pwd -P`
popd > /dev/null
script_path=`dirname $my_path`
script_path="${script_path}/bin"

$script_path/....
Fonsan commented 8 years ago

Fixed