osmq

openstreetmap for command line
git clone https://logand.com/git/osmq.git/
Log | Files | Refs

osmq (554B)


      1 #!/usr/bin/env bash
      2 set -euo pipefail
      3 read \
      4     LAT \
      5     LON \
      6     REST \
      7     <<<$(curl \
      8              -s \
      9              "https://nominatim.openstreetmap.org/search?format=json&q=$*" \
     10              | jq \
     11                    -r \
     12                    'map([.lat, .lon, .display_name] | join(" ")) | join("\n")' \
     13              | fzf -0 -1 --with-nth=3..)
     14 stty raw -echo
     15 tput civis
     16 function finish {
     17     tput cnorm
     18     stty -raw echo
     19 }
     20 trap finish EXIT
     21 osmtile \
     22     tty \
     23     "${OSMQ_CACHE:-$HOME/.cache/osmq}" \
     24     ${OSMQ_ZOOM:-10} \
     25     $LAT \
     26     $LON