#!/bin/bash
# usage:
#   poi2selection-all "files" targetdirectory area.ovl
#
# "files" auch mit Wildcard, z.B. "*.asc" (don't forget quotes)
# alle POI regional begrenzen (per OVL areas / umgebende Polygonzge) und
# in zweitem Verzeichnis speichern

if [ $# -ne 3 ]; then
  echo 'Syntax: poi2selection-all "files" targetdirectory area.ovl'
  echo 'Example: poi2selection-all "*.asc" poi-sammlung-umgebung/ umgebung.ovl'
  exit
fi

hash poi2selection

wildcard=$1
target=$2
area=$3

mkdir "$target"

for name in $wildcard; do
	poi2selection $area < "$name" > "$target/$name"
done
