#!/bin/bash
# usage:
#   poi2gmapsurl type zoomlevel < poi.asc > url.asc
#
# type h(hybrid) k(keyhole sat) m(Karte)
# zoom=17, nah
#
# frank334, 5.11.2006

if [ $# -ne 2 ]; then
  echo "usage: poi2gmapsurl type zoomlevel < poi.asc > output"
  echo "type h(hybrid) k(keyhole sat) m(Karte)"
  echo "zoom=17, nah"
  exit
fi

typ=$1
zoom=$2

while read line; do

lat=`echo $line | cut -d "," -f 2`
long=`echo $line | cut -d "," -f 1`
label=`echo $line | cut -d "," -f 3`

echo "http://maps.google.com/maps?q="$lat"+"$long"+("$label")&t="$typ"&z="$zoom

done
