1 7ˆl–Ðz¾”jhŠ}AãNÜl*bÑ¿�þ[r@¬ÛÍJÂã-F@? „„&ÿÁÀ¿?÷#!/usr/bin/env texlua -- -- getmapdl [options] -- -- downloads an OpenStreetMap, Google Maps or Google Street View map -- specified by [options] or parses gpx, gps and kml files to create -- encoded polylines -- -- License: LPPL -- local http = require("socket.http") local ltn12 = require("ltn12") -- local url = require("socket.url") -- avoid bug in luatex v1.0.7 -- copied socket.url's escape function into local function url_escape function url_escape(s) return (string.gsub(s, "([^A-Za-z0-9_])", function(c) return string.format("%%%02x", string.byte(c)) end)) end local OSMURL = "http://open.mapquestapi.com/staticmap/v4/getplacemap" local GMURL = "http://maps.googleapis.com/maps/api/staticmap" local GSVURL = "http://maps.googleapis.com/maps/api/streetview" local KEY = "" local MODE = "" local LOCATION = "" local XSIZE = "" local CENTER = "" local YSIZE = "" local SIZE = "" local SCALE = "" local ZOOM = "" local TYPE = "" local IMAGETYPE = "" local COLOR = "" local NUMBER = "" local VISIBLE = "" local IPATH = "" local FPATH = "" local MARKERS = "" local HEADING = "" local FOV = "" local PITCH = "" local LANGUAGE = "" local GPFILE = "" local KMLFILE = "" local BOUND = 0.1 local OFILE = "getmap" local QUIET = "false" local VERSION = "v1.5a (2018/07/18)" function pversion() print("getmapdl.lua " .. VERSION) print("(C) Josef Kleber License: LPPL") os.exit(0) end function phelp() print([[ getmapdl.lua [options] downloads an OpenStreetMap, Google Maps or Google Street View map specified by [options] or parses gpx, gps and kml files to create encoded polylines Options: -m specify the mode (osm|gm|gsv|gpx2epl|gps2epl|gpx2gps|kml2epl|kml2gps) -l specify a location e.g. 'Bergheimer Straße 110A, 69115 Heidelberg, Germany' -x specify a xsize (600) -y specify a ysize (400) -S short form to specify a size, e.g. 600,400 (osm) or 600x400 (gm) -s specify a scale factor in the range 1692-221871572 (osm) or 1-2 (gm) -z specify a zoom in the range 1-18 (osm) or 0-21 (17) (gm) -t specify map type {map|sathyb} (map) (osm) or {roadmap|satellite|hybrid|terrain} (roadmap) (gm) -i specify image type {png|gif|jpg|jpeg} (png) (osm) or {png|png8|png32|gif|jpg|jpg-baseline} (png) (gm) -c specify icon color (yelow_1) (osm) or (blue) (gm) see: http://open.mapquestapi.com/staticmap/icons.html https://developers.google.com/maps/documentation/staticmaps/#MarkerStyles -n specify the icon number (1) -o specify output basename without file extension (getmap.IMAGETYPE) -q quiet; no output! -v prints version information -h prints help information gm mode only: -L specify the language of map labels (xx language code (en,de,fr,...)) -M specify markers; see: https://developers.google.com/maps/documentation/staticmaps/index#Markers e.g.: &markers=size:mid|color:blue|label:1|address or more of these location and zoom will be ignored if used! -C specify center of the map -V specify a list of visible locations (loc1|loc2) -P specify path from location to location e.g.: &path=weight:7|color:purple|loc1|loc2 -p specify a file holding the path specification (maybe needed for encoded polylines) gsv mode only: -H specify heading (view) (0) (0 -- 360) (east: 90, ...) -T specify the pitch (angle) (0) (-90 -- 90) -F specify horizontal field of view (90) (0 -- 120) The field of view is expressed in degrees and a kind of zoom! gpx2epl, gps2epl and gpx2gps mode only: -G specify the gpx or gps file kml2epl and kml2gps mode only: -K specify the kml file gps2gps mode only: -B specify the bound for reducing way points (default: 0.1) ]]) pversion() end function getmap_error(exitcode, errortext) io.stderr:write ("Error (" .. exitcode .. "): " .. errortext .. "\n") os.exit(exitcode) end function getmap_warning(warningtext) io.stderr:write("WARNING: " .. warningtext .. "\n") end function check_number(var, varname)