Skip to content

Commit

Permalink
Merge pull request #143 from pelias/revert-134-joxit/wof-extract
Browse files Browse the repository at this point in the history
Revert "feat(wof_extract) Remove dependency on gnu parallel"
  • Loading branch information
missinglink authored Oct 9, 2018
2 parents 67092cc + 61583c9 commit 0e2121d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions cmd/wof_extract.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd );
# note: set WOF_DIR env var to override
WOF_DIR=${WOF_DIR:-'/data/whosonfirst-data/data'};

# Set number of cores used by xargs. Default is host number of cpu cores
NB_CORES=${NB_CORES:-$(getconf _NPROCESSORS_ONLN)}

# requires command: jq - Command-line JSON processor
# on ubuntu: sudo apt-get install jq

Expand All @@ -27,7 +24,13 @@ if [[ ! -f "${JQ_BIN}" || ! -x "${JQ_BIN}" ]]; then
exit 1;
fi

XARGS_CMD="xargs -n 1 -P ${NB_CORES}";
# parellize execution on systems which support it
XARGS_CMD='xargs';
PARALLEL_BIN=$(which parallel) || true
if [[ -f "${PARALLEL_BIN}" || -x "${PARALLEL_BIN}" ]]; then
echo "info: using parallel execution" 1>&2;
XARGS_CMD='parallel --no-notice --group --keep-order --jobs +0';
fi

# filter records by placetype
# removing any file names from the stream whose body does not match the pattern
Expand Down

0 comments on commit 0e2121d

Please sign in to comment.