Mock Version: 2.15 ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target x86_64 --nodeps /builddir/build/SPECS/python-py-staticmaps.spec'], chrootPath='/var/lib/mock/fedora-rawhide-x86_64-1641018783.036512/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'}shell=Falselogger=timeout=0uid=1000gid=135user='mockbuild'nspawn_args=['--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.ag1gz2gq:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11']unshare_net=TrueprintOutput=True) Using nspawn with args ['--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.ag1gz2gq:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11'] Executing command: ['/usr/bin/systemd-nspawn', '-q', '-M', 'af824db3ccd84c73b5e1e1ff58717faa', '-D', '/var/lib/mock/fedora-rawhide-x86_64-1641018783.036512/root', '-a', '-u', 'mockbuild', '--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.ag1gz2gq:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11', '--console=pipe', '--setenv=TERM=vt100', '--setenv=SHELL=/bin/bash', '--setenv=HOME=/builddir', '--setenv=HOSTNAME=mock', '--setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin', '--setenv=PROMPT_COMMAND=printf "\\033]0;\\007"', '--setenv=PS1= \\s-\\v\\$ ', '--setenv=LANG=C.UTF-8', '--resolv-conf=off', 'bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target x86_64 --nodeps /builddir/build/SPECS/python-py-staticmaps.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8', 'SYSTEMD_NSPAWN_TMPFS_TMP': '0'} and shell False Building target platforms: x86_64 Building for target x86_64 setting SOURCE_DATE_EPOCH=1640822400 Wrote: /builddir/build/SRPMS/python-py-staticmaps-0.4.0-1.fc36.src.rpm Child return code was: 0 ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -br --target x86_64 --nodeps /builddir/build/SPECS/python-py-staticmaps.spec'], chrootPath='/var/lib/mock/fedora-rawhide-x86_64-1641018783.036512/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'}shell=Falselogger=timeout=0uid=1000gid=135user='mockbuild'nspawn_args=['--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.ag1gz2gq:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11']unshare_net=TrueraiseExc=FalseprintOutput=True) Using nspawn with args ['--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.ag1gz2gq:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11'] Executing command: ['/usr/bin/systemd-nspawn', '-q', '-M', '6a49ae040d0244449ed055451bb50ac8', '-D', '/var/lib/mock/fedora-rawhide-x86_64-1641018783.036512/root', '-a', '-u', 'mockbuild', '--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.ag1gz2gq:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11', '--console=pipe', '--setenv=TERM=vt100', '--setenv=SHELL=/bin/bash', '--setenv=HOME=/builddir', '--setenv=HOSTNAME=mock', '--setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin', '--setenv=PROMPT_COMMAND=printf "\\033]0;\\007"', '--setenv=PS1= \\s-\\v\\$ ', '--setenv=LANG=C.UTF-8', '--resolv-conf=off', 'bash', '--login', '-c', '/usr/bin/rpmbuild -br --target x86_64 --nodeps /builddir/build/SPECS/python-py-staticmaps.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8', 'SYSTEMD_NSPAWN_TMPFS_TMP': '0'} and shell False Building target platforms: x86_64 Building for target x86_64 setting SOURCE_DATE_EPOCH=1640822400 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.rLLbv5 + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + rm -rf py-staticmaps-0.4.0 + /usr/bin/gzip -dc /builddir/build/SOURCES/py-staticmaps-0.4.0.tar.gz + /usr/bin/tar -xof - + STATUS=0 + '[' 0 -ne 0 ']' + cd py-staticmaps-0.4.0 + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + RPM_EC=0 ++ jobs -p + exit 0 Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.kJhRkY + umask 022 + cd /builddir/build/BUILD + cd py-staticmaps-0.4.0 + echo python3-devel + echo 'python3dist(pip) >= 19' + echo 'python3dist(packaging)' + '[' -f pyproject.toml ']' + '[' -f setup.py ']' + echo 'python3dist(setuptools) >= 40.8' + echo 'python3dist(wheel)' + rm -rfv '*.dist-info/' + '[' -f /usr/bin/python3 ']' + RPM_TOXENV=py310 + HOSTNAME=rpmbuild + /usr/bin/python3 -s /usr/lib/rpm/redhat/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 -r Handling setuptools >= 40.8 from default build backend Requirement not satisfied: setuptools >= 40.8 Handling wheel from default build backend Requirement not satisfied: wheel Exiting dependency generation pass: build backend + RPM_EC=0 ++ jobs -p + exit 0 Wrote: /builddir/build/SRPMS/python-py-staticmaps-0.4.0-1.fc36.buildreqs.nosrc.rpm Child return code was: 11 Dynamic buildrequires detected Going to install missing buildrequires. See root.log for details. ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -br --target x86_64 --nodeps /builddir/build/SPECS/python-py-staticmaps.spec'], chrootPath='/var/lib/mock/fedora-rawhide-x86_64-1641018783.036512/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'}shell=Falselogger=timeout=0uid=1000gid=135user='mockbuild'nspawn_args=['--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.ag1gz2gq:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11']unshare_net=TrueraiseExc=FalseprintOutput=True) Using nspawn with args ['--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.ag1gz2gq:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11'] Executing command: ['/usr/bin/systemd-nspawn', '-q', '-M', 'c96cbf52707d4d51979a336e78bf6f39', '-D', '/var/lib/mock/fedora-rawhide-x86_64-1641018783.036512/root', '-a', '-u', 'mockbuild', '--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.ag1gz2gq:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11', '--console=pipe', '--setenv=TERM=vt100', '--setenv=SHELL=/bin/bash', '--setenv=HOME=/builddir', '--setenv=HOSTNAME=mock', '--setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin', '--setenv=PROMPT_COMMAND=printf "\\033]0;\\007"', '--setenv=PS1= \\s-\\v\\$ ', '--setenv=LANG=C.UTF-8', '--resolv-conf=off', 'bash', '--login', '-c', '/usr/bin/rpmbuild -br --target x86_64 --nodeps /builddir/build/SPECS/python-py-staticmaps.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8', 'SYSTEMD_NSPAWN_TMPFS_TMP': '0'} and shell False Building target platforms: x86_64 Building for target x86_64 setting SOURCE_DATE_EPOCH=1640822400 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.ZUdCeZ + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + rm -rf py-staticmaps-0.4.0 + /usr/bin/gzip -dc /builddir/build/SOURCES/py-staticmaps-0.4.0.tar.gz + /usr/bin/tar -xof - + STATUS=0 + '[' 0 -ne 0 ']' + cd py-staticmaps-0.4.0 + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + RPM_EC=0 ++ jobs -p + exit 0 Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.ssea72 + umask 022 + cd /builddir/build/BUILD + cd py-staticmaps-0.4.0 + echo python3-devel + echo 'python3dist(pip) >= 19' + echo 'python3dist(packaging)' + '[' -f pyproject.toml ']' + '[' -f setup.py ']' + echo 'python3dist(setuptools) >= 40.8' + echo 'python3dist(wheel)' + rm -rfv '*.dist-info/' + '[' -f /usr/bin/python3 ']' + RPM_TOXENV=py310 + HOSTNAME=rpmbuild + /usr/bin/python3 -s /usr/lib/rpm/redhat/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 -r Handling setuptools >= 40.8 from default build backend Requirement satisfied: setuptools >= 40.8 (installed: setuptools 59.6.0) Handling wheel from default build backend Requirement satisfied: wheel (installed: wheel 0.37.0) warning: no previously-included files matching '__pycache__' found under directory '*' warning: no previously-included files matching '*.py[co]' found under directory '*' HOOK STDOUT: HOOK STDOUT: # py-staticmaps HOOK STDOUT: A python module to create static map images (PNG, SVG) with markers, geodesic lines, etc. HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ## Features HOOK STDOUT: HOOK STDOUT: - Map objects: pin-style markers, image (PNG) markers, polylines, polygons, (geodesic) circles HOOK STDOUT: - Automatic computation of best center + zoom from the added map objects HOOK STDOUT: - Several pre-configured map tile providers HOOK STDOUT: - Proper tile provider attributions display HOOK STDOUT: - On-disc caching of map tile images for faster drawing and reduced load on the tile servers HOOK STDOUT: - Non-anti-aliased drawing via `PILLOW` HOOK STDOUT: - Anti-aliased drawing via `pycairo` (optional; only if `pycairo` is installed properly) HOOK STDOUT: - SVG creation via `svgwrite` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ## Installation HOOK STDOUT: HOOK STDOUT: ### SVG + non-anti-aliased PNG version HOOK STDOUT: HOOK STDOUT: ```shell HOOK STDOUT: pip install py-staticmaps HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: ### SVG + anti-aliased PNG version (via Cairo) HOOK STDOUT: HOOK STDOUT: ```shell HOOK STDOUT: pip install py-staticmaps[cairo] HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: `py-staticmaps` uses `pycairo` for creating anti-aliased raster-graphics, so make sure `libcairo2` is installed on your system (on Ubuntu just install the `libcairo2-dev` package, i.e. `sudo apt install libcairo2-dev`). HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ## Examples HOOK STDOUT: HOOK STDOUT: Note: PNG support (e.g. `context.render_cairo(...)`) is only available if the `pycairo` module is installed. HOOK STDOUT: HOOK STDOUT: ### Markers and Geodesic Lines HOOK STDOUT: HOOK STDOUT: ```python HOOK STDOUT: import staticmaps HOOK STDOUT: HOOK STDOUT: context = staticmaps.Context() HOOK STDOUT: context.set_tile_provider(staticmaps.tile_provider_StamenToner) HOOK STDOUT: HOOK STDOUT: frankfurt = staticmaps.create_latlng(50.110644, 8.682092) HOOK STDOUT: newyork = staticmaps.create_latlng(40.712728, -74.006015) HOOK STDOUT: HOOK STDOUT: context.add_object(staticmaps.Line([frankfurt, newyork], color=staticmaps.BLUE, width=4)) HOOK STDOUT: context.add_object(staticmaps.Marker(frankfurt, color=staticmaps.GREEN, size=12)) HOOK STDOUT: context.add_object(staticmaps.Marker(newyork, color=staticmaps.RED, size=12)) HOOK STDOUT: HOOK STDOUT: # render non-anti-aliased png HOOK STDOUT: image = context.render_pillow(800, 500) HOOK STDOUT: image.save("frankfurt_newyork.pillow.png") HOOK STDOUT: HOOK STDOUT: # render anti-aliased png (this only works if pycairo is installed) HOOK STDOUT: image = context.render_cairo(800, 500) HOOK STDOUT: image.write_to_png("frankfurt_newyork.cairo.png") HOOK STDOUT: HOOK STDOUT: # render svg HOOK STDOUT: svg_image = context.render_svg(800, 500) HOOK STDOUT: with open("frankfurt_newyork.svg", "w", encoding="utf-8") as f: HOOK STDOUT: svg_image.write(f, pretty=True) HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### Transparent Polygons HOOK STDOUT: HOOK STDOUT: ```python HOOK STDOUT: import staticmaps HOOK STDOUT: HOOK STDOUT: context = staticmaps.Context() HOOK STDOUT: context.set_tile_provider(staticmaps.tile_provider_OSM) HOOK STDOUT: HOOK STDOUT: freiburg_polygon = [ HOOK STDOUT: (47.96881, 7.79045), HOOK STDOUT: (47.96866, 7.78610), HOOK STDOUT: (47.97134, 7.77874), HOOK STDOUT: ... HOOK STDOUT: ] HOOK STDOUT: HOOK STDOUT: context.add_object( HOOK STDOUT: staticmaps.Area( HOOK STDOUT: [staticmaps.create_latlng(lat, lng) for lat, lng in freiburg_polygon], HOOK STDOUT: fill_color=staticmaps.parse_color("#00FF003F"), HOOK STDOUT: width=2, HOOK STDOUT: color=staticmaps.BLUE, HOOK STDOUT: ) HOOK STDOUT: ) HOOK STDOUT: HOOK STDOUT: # render non-anti-aliased png HOOK STDOUT: image = context.render_pillow(800, 500) HOOK STDOUT: image.save("freiburg_area.pillow.png") HOOK STDOUT: HOOK STDOUT: # render anti-aliased png (this only works if pycairo is installed) HOOK STDOUT: image = context.render_cairo(800, 500) HOOK STDOUT: image.write_to_png("freiburg_area.cairo.png") HOOK STDOUT: HOOK STDOUT: # render svg HOOK STDOUT: svg_image = context.render_svg(800, 500) HOOK STDOUT: with open("freiburg_area.svg", "w", encoding="utf-8") as f: HOOK STDOUT: svg_image.write(f, pretty=True) HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### Drawing a GPX Track + Image Marker (PNG) HOOK STDOUT: HOOK STDOUT: ```python HOOK STDOUT: import sys HOOK STDOUT: HOOK STDOUT: import gpxpy HOOK STDOUT: import staticmaps HOOK STDOUT: HOOK STDOUT: context = staticmaps.Context() HOOK STDOUT: context.set_tile_provider(staticmaps.tile_provider_ArcGISWorldImagery) HOOK STDOUT: HOOK STDOUT: with open(sys.argv[1], "r") as file: HOOK STDOUT: gpx = gpxpy.parse(file) HOOK STDOUT: HOOK STDOUT: for track in gpx.tracks: HOOK STDOUT: for segment in track.segments: HOOK STDOUT: line = [staticmaps.create_latlng(p.latitude, p.longitude) for p in segment.points] HOOK STDOUT: context.add_object(staticmaps.Line(line)) HOOK STDOUT: HOOK STDOUT: for p in gpx.walk(only_points=True): HOOK STDOUT: pos = staticmaps.create_latlng(p.latitude, p.longitude) HOOK STDOUT: marker = staticmaps.ImageMarker(pos, "start.png", origin_x=27, origin_y=35) HOOK STDOUT: context.add_object(marker) HOOK STDOUT: break HOOK STDOUT: HOOK STDOUT: # render non-anti-aliased png HOOK STDOUT: image = context.render_pillow(800, 500) HOOK STDOUT: image.save("draw_gpx.pillow.png") HOOK STDOUT: HOOK STDOUT: # render anti-aliased png (this only works if pycairo is installed) HOOK STDOUT: image = context.render_cairo(800, 500) HOOK STDOUT: image.write_to_png("draw_gpx.cairo.png") HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### US State Capitals HOOK STDOUT: HOOK STDOUT: ```python HOOK STDOUT: import json HOOK STDOUT: import requests HOOK STDOUT: import staticmaps HOOK STDOUT: HOOK STDOUT: context = staticmaps.Context() HOOK STDOUT: context.set_tile_provider(staticmaps.tile_provider_OSM) HOOK STDOUT: HOOK STDOUT: URL = ( HOOK STDOUT: "https://gist.githubusercontent.com/jpriebe/d62a45e29f24e843c974/" HOOK STDOUT: "raw/b1d3066d245e742018bce56e41788ac7afa60e29/us_state_capitals.json" HOOK STDOUT: ) HOOK STDOUT: response = requests.get(URL) HOOK STDOUT: for _, data in json.loads(response.text).items(): HOOK STDOUT: capital = staticmaps.create_latlng(float(data["lat"]), float(data["long"])) HOOK STDOUT: context.add_object(staticmaps.Marker(capital, size=5)) HOOK STDOUT: HOOK STDOUT: # render non-anti-aliased png HOOK STDOUT: image = context.render_pillow(800, 500) HOOK STDOUT: image.save("us_capitals.pillow.png") HOOK STDOUT: HOOK STDOUT: # render anti-aliased png (this only works if pycairo is installed) HOOK STDOUT: image = context.render_cairo(800, 500) HOOK STDOUT: image.write_to_png("us_capitals.cairo.png") HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### Geodesic Circles HOOK STDOUT: HOOK STDOUT: ```python HOOK STDOUT: import staticmaps HOOK STDOUT: HOOK STDOUT: context = staticmaps.Context() HOOK STDOUT: context.set_tile_provider(staticmaps.tile_provider_StamenToner) HOOK STDOUT: HOOK STDOUT: center1 = staticmaps.create_latlng(66, 0) HOOK STDOUT: center2 = staticmaps.create_latlng(0, 0) HOOK STDOUT: HOOK STDOUT: context.add_object(staticmaps.Circle(center1, 2000, fill_color=staticmaps.TRANSPARENT, color=staticmaps.RED, width=2)) HOOK STDOUT: context.add_object(staticmaps.Circle(center2, 2000, fill_color=staticmaps.TRANSPARENT, color=staticmaps.GREEN, width=2)) HOOK STDOUT: context.add_object(staticmaps.Marker(center1, color=staticmaps.RED)) HOOK STDOUT: context.add_object(staticmaps.Marker(center2, color=staticmaps.GREEN)) HOOK STDOUT: HOOK STDOUT: # render non-anti-aliased png HOOK STDOUT: image = context.render_pillow(800, 500) HOOK STDOUT: image.save("geodesic_circles.pillow.png") HOOK STDOUT: HOOK STDOUT: # render anti-aliased png (this only works if pycairo is installed) HOOK STDOUT: image = context.render_cairo(800, 600) HOOK STDOUT: image.write_to_png("geodesic_circles.cairo.png") HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### Other Examples HOOK STDOUT: HOOK STDOUT: Please take a look at the command line program which uses the `staticmaps` package: `staticmaps/cli.py` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### Dependencies HOOK STDOUT: HOOK STDOUT: `py-staticmaps` uses HOOK STDOUT: HOOK STDOUT: - `PILLOW` for rendering raster-graphics HOOK STDOUT: - `pycairo` for rendering antialiased raster-graphics (optional!) HOOK STDOUT: - `svgwrite` for writing SVG files HOOK STDOUT: - `s2sphere` for geo coordinates handling HOOK STDOUT: - `geographiclib` for geodesic computations HOOK STDOUT: - `appdirs` for finding the user's default cache directory HOOK STDOUT: - `requests` for downloading tile files HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ## License HOOK STDOUT: HOOK STDOUT: [MIT](LICENSE) © 2020-2021 Florian Pigorsch HOOK STDOUT: HOOK STDOUT: running egg_info HOOK STDOUT: writing py_staticmaps.egg-info/PKG-INFO HOOK STDOUT: writing dependency_links to py_staticmaps.egg-info/dependency_links.txt HOOK STDOUT: writing entry points to py_staticmaps.egg-info/entry_points.txt HOOK STDOUT: writing requirements to py_staticmaps.egg-info/requires.txt HOOK STDOUT: writing top-level names to py_staticmaps.egg-info/top_level.txt HOOK STDOUT: reading manifest file 'py_staticmaps.egg-info/SOURCES.txt' HOOK STDOUT: reading manifest template 'MANIFEST.in' HOOK STDOUT: adding license file 'LICENSE' HOOK STDOUT: writing manifest file 'py_staticmaps.egg-info/SOURCES.txt' Handling wheel from get_requires_for_build_wheel Requirement satisfied: wheel (installed: wheel 0.37.0) warning: no previously-included files matching '__pycache__' found under directory '*' warning: no previously-included files matching '*.py[co]' found under directory '*' HOOK STDOUT: HOOK STDOUT: # py-staticmaps HOOK STDOUT: A python module to create static map images (PNG, SVG) with markers, geodesic lines, etc. HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ## Features HOOK STDOUT: HOOK STDOUT: - Map objects: pin-style markers, image (PNG) markers, polylines, polygons, (geodesic) circles HOOK STDOUT: - Automatic computation of best center + zoom from the added map objects HOOK STDOUT: - Several pre-configured map tile providers HOOK STDOUT: - Proper tile provider attributions display HOOK STDOUT: - On-disc caching of map tile images for faster drawing and reduced load on the tile servers HOOK STDOUT: - Non-anti-aliased drawing via `PILLOW` HOOK STDOUT: - Anti-aliased drawing via `pycairo` (optional; only if `pycairo` is installed properly) HOOK STDOUT: - SVG creation via `svgwrite` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ## Installation HOOK STDOUT: HOOK STDOUT: ### SVG + non-anti-aliased PNG version HOOK STDOUT: HOOK STDOUT: ```shell HOOK STDOUT: pip install py-staticmaps HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: ### SVG + anti-aliased PNG version (via Cairo) HOOK STDOUT: HOOK STDOUT: ```shell HOOK STDOUT: pip install py-staticmaps[cairo] HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: `py-staticmaps` uses `pycairo` for creating anti-aliased raster-graphics, so make sure `libcairo2` is installed on your system (on Ubuntu just install the `libcairo2-dev` package, i.e. `sudo apt install libcairo2-dev`). HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ## Examples HOOK STDOUT: HOOK STDOUT: Note: PNG support (e.g. `context.render_cairo(...)`) is only available if the `pycairo` module is installed. HOOK STDOUT: HOOK STDOUT: ### Markers and Geodesic Lines HOOK STDOUT: HOOK STDOUT: ```python HOOK STDOUT: import staticmaps HOOK STDOUT: HOOK STDOUT: context = staticmaps.Context() HOOK STDOUT: context.set_tile_provider(staticmaps.tile_provider_StamenToner) HOOK STDOUT: HOOK STDOUT: frankfurt = staticmaps.create_latlng(50.110644, 8.682092) HOOK STDOUT: newyork = staticmaps.create_latlng(40.712728, -74.006015) HOOK STDOUT: HOOK STDOUT: context.add_object(staticmaps.Line([frankfurt, newyork], color=staticmaps.BLUE, width=4)) HOOK STDOUT: context.add_object(staticmaps.Marker(frankfurt, color=staticmaps.GREEN, size=12)) HOOK STDOUT: context.add_object(staticmaps.Marker(newyork, color=staticmaps.RED, size=12)) HOOK STDOUT: HOOK STDOUT: # render non-anti-aliased png HOOK STDOUT: image = context.render_pillow(800, 500) HOOK STDOUT: image.save("frankfurt_newyork.pillow.png") HOOK STDOUT: HOOK STDOUT: # render anti-aliased png (this only works if pycairo is installed) HOOK STDOUT: image = context.render_cairo(800, 500) HOOK STDOUT: image.write_to_png("frankfurt_newyork.cairo.png") HOOK STDOUT: HOOK STDOUT: # render svg HOOK STDOUT: svg_image = context.render_svg(800, 500) HOOK STDOUT: with open("frankfurt_newyork.svg", "w", encoding="utf-8") as f: HOOK STDOUT: svg_image.write(f, pretty=True) HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### Transparent Polygons HOOK STDOUT: HOOK STDOUT: ```python HOOK STDOUT: import staticmaps HOOK STDOUT: HOOK STDOUT: context = staticmaps.Context() HOOK STDOUT: context.set_tile_provider(staticmaps.tile_provider_OSM) HOOK STDOUT: HOOK STDOUT: freiburg_polygon = [ HOOK STDOUT: (47.96881, 7.79045), HOOK STDOUT: (47.96866, 7.78610), HOOK STDOUT: (47.97134, 7.77874), HOOK STDOUT: ... HOOK STDOUT: ] HOOK STDOUT: HOOK STDOUT: context.add_object( HOOK STDOUT: staticmaps.Area( HOOK STDOUT: [staticmaps.create_latlng(lat, lng) for lat, lng in freiburg_polygon], HOOK STDOUT: fill_color=staticmaps.parse_color("#00FF003F"), HOOK STDOUT: width=2, HOOK STDOUT: color=staticmaps.BLUE, HOOK STDOUT: ) HOOK STDOUT: ) HOOK STDOUT: HOOK STDOUT: # render non-anti-aliased png HOOK STDOUT: image = context.render_pillow(800, 500) HOOK STDOUT: image.save("freiburg_area.pillow.png") HOOK STDOUT: HOOK STDOUT: # render anti-aliased png (this only works if pycairo is installed) HOOK STDOUT: image = context.render_cairo(800, 500) HOOK STDOUT: image.write_to_png("freiburg_area.cairo.png") HOOK STDOUT: HOOK STDOUT: # render svg HOOK STDOUT: svg_image = context.render_svg(800, 500) HOOK STDOUT: with open("freiburg_area.svg", "w", encoding="utf-8") as f: HOOK STDOUT: svg_image.write(f, pretty=True) HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### Drawing a GPX Track + Image Marker (PNG) HOOK STDOUT: HOOK STDOUT: ```python HOOK STDOUT: import sys HOOK STDOUT: HOOK STDOUT: import gpxpy HOOK STDOUT: import staticmaps HOOK STDOUT: HOOK STDOUT: context = staticmaps.Context() HOOK STDOUT: context.set_tile_provider(staticmaps.tile_provider_ArcGISWorldImagery) HOOK STDOUT: HOOK STDOUT: with open(sys.argv[1], "r") as file: HOOK STDOUT: gpx = gpxpy.parse(file) HOOK STDOUT: HOOK STDOUT: for track in gpx.tracks: HOOK STDOUT: for segment in track.segments: HOOK STDOUT: line = [staticmaps.create_latlng(p.latitude, p.longitude) for p in segment.points] HOOK STDOUT: context.add_object(staticmaps.Line(line)) HOOK STDOUT: HOOK STDOUT: for p in gpx.walk(only_points=True): HOOK STDOUT: pos = staticmaps.create_latlng(p.latitude, p.longitude) HOOK STDOUT: marker = staticmaps.ImageMarker(pos, "start.png", origin_x=27, origin_y=35) HOOK STDOUT: context.add_object(marker) HOOK STDOUT: break HOOK STDOUT: HOOK STDOUT: # render non-anti-aliased png HOOK STDOUT: image = context.render_pillow(800, 500) HOOK STDOUT: image.save("draw_gpx.pillow.png") HOOK STDOUT: HOOK STDOUT: # render anti-aliased png (this only works if pycairo is installed) HOOK STDOUT: image = context.render_cairo(800, 500) HOOK STDOUT: image.write_to_png("draw_gpx.cairo.png") HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### US State Capitals HOOK STDOUT: HOOK STDOUT: ```python HOOK STDOUT: import json HOOK STDOUT: import requests HOOK STDOUT: import staticmaps HOOK STDOUT: HOOK STDOUT: context = staticmaps.Context() HOOK STDOUT: context.set_tile_provider(staticmaps.tile_provider_OSM) HOOK STDOUT: HOOK STDOUT: URL = ( HOOK STDOUT: "https://gist.githubusercontent.com/jpriebe/d62a45e29f24e843c974/" HOOK STDOUT: "raw/b1d3066d245e742018bce56e41788ac7afa60e29/us_state_capitals.json" HOOK STDOUT: ) HOOK STDOUT: response = requests.get(URL) HOOK STDOUT: for _, data in json.loads(response.text).items(): HOOK STDOUT: capital = staticmaps.create_latlng(float(data["lat"]), float(data["long"])) HOOK STDOUT: context.add_object(staticmaps.Marker(capital, size=5)) HOOK STDOUT: HOOK STDOUT: # render non-anti-aliased png HOOK STDOUT: image = context.render_pillow(800, 500) HOOK STDOUT: image.save("us_capitals.pillow.png") HOOK STDOUT: HOOK STDOUT: # render anti-aliased png (this only works if pycairo is installed) HOOK STDOUT: image = context.render_cairo(800, 500) HOOK STDOUT: image.write_to_png("us_capitals.cairo.png") HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### Geodesic Circles HOOK STDOUT: HOOK STDOUT: ```python HOOK STDOUT: import staticmaps HOOK STDOUT: HOOK STDOUT: context = staticmaps.Context() HOOK STDOUT: context.set_tile_provider(staticmaps.tile_provider_StamenToner) HOOK STDOUT: HOOK STDOUT: center1 = staticmaps.create_latlng(66, 0) HOOK STDOUT: center2 = staticmaps.create_latlng(0, 0) HOOK STDOUT: HOOK STDOUT: context.add_object(staticmaps.Circle(center1, 2000, fill_color=staticmaps.TRANSPARENT, color=staticmaps.RED, width=2)) HOOK STDOUT: context.add_object(staticmaps.Circle(center2, 2000, fill_color=staticmaps.TRANSPARENT, color=staticmaps.GREEN, width=2)) HOOK STDOUT: context.add_object(staticmaps.Marker(center1, color=staticmaps.RED)) HOOK STDOUT: context.add_object(staticmaps.Marker(center2, color=staticmaps.GREEN)) HOOK STDOUT: HOOK STDOUT: # render non-anti-aliased png HOOK STDOUT: image = context.render_pillow(800, 500) HOOK STDOUT: image.save("geodesic_circles.pillow.png") HOOK STDOUT: HOOK STDOUT: # render anti-aliased png (this only works if pycairo is installed) HOOK STDOUT: image = context.render_cairo(800, 600) HOOK STDOUT: image.write_to_png("geodesic_circles.cairo.png") HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### Other Examples HOOK STDOUT: HOOK STDOUT: Please take a look at the command line program which uses the `staticmaps` package: `staticmaps/cli.py` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### Dependencies HOOK STDOUT: HOOK STDOUT: `py-staticmaps` uses HOOK STDOUT: HOOK STDOUT: - `PILLOW` for rendering raster-graphics HOOK STDOUT: - `pycairo` for rendering antialiased raster-graphics (optional!) HOOK STDOUT: - `svgwrite` for writing SVG files HOOK STDOUT: - `s2sphere` for geo coordinates handling HOOK STDOUT: - `geographiclib` for geodesic computations HOOK STDOUT: - `appdirs` for finding the user's default cache directory HOOK STDOUT: - `requests` for downloading tile files HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ## License HOOK STDOUT: HOOK STDOUT: [MIT](LICENSE) © 2020-2021 Florian Pigorsch HOOK STDOUT: HOOK STDOUT: running dist_info HOOK STDOUT: writing py_staticmaps.egg-info/PKG-INFO HOOK STDOUT: writing dependency_links to py_staticmaps.egg-info/dependency_links.txt HOOK STDOUT: writing entry points to py_staticmaps.egg-info/entry_points.txt HOOK STDOUT: writing requirements to py_staticmaps.egg-info/requires.txt HOOK STDOUT: writing top-level names to py_staticmaps.egg-info/top_level.txt HOOK STDOUT: reading manifest file 'py_staticmaps.egg-info/SOURCES.txt' HOOK STDOUT: reading manifest template 'MANIFEST.in' HOOK STDOUT: adding license file 'LICENSE' HOOK STDOUT: writing manifest file 'py_staticmaps.egg-info/SOURCES.txt' HOOK STDOUT: creating '/builddir/build/BUILD/py-staticmaps-0.4.0/py_staticmaps.dist-info' HOOK STDOUT: adding license file "LICENSE" (matched pattern "LICEN[CS]E*") Handling appdirs from wheel metadata: Requires-Dist Requirement not satisfied: appdirs Handling geographiclib from wheel metadata: Requires-Dist Requirement not satisfied: geographiclib Handling PILLOW from wheel metadata: Requires-Dist Requirement not satisfied: PILLOW Handling python-slugify from wheel metadata: Requires-Dist Requirement not satisfied: python-slugify Handling requests from wheel metadata: Requires-Dist Requirement not satisfied: requests Handling s2sphere from wheel metadata: Requires-Dist Requirement not satisfied: s2sphere Handling svgwrite from wheel metadata: Requires-Dist Requirement not satisfied: svgwrite Handling pycairo ; extra == 'cairo' from wheel metadata: Requires-Dist Ignoring alien requirement: pycairo ; extra == 'cairo' Handling black ; extra == 'dev' from wheel metadata: Requires-Dist Ignoring alien requirement: black ; extra == 'dev' Handling flake8 ; extra == 'dev' from wheel metadata: Requires-Dist Ignoring alien requirement: flake8 ; extra == 'dev' Handling mypy ; extra == 'dev' from wheel metadata: Requires-Dist Ignoring alien requirement: mypy ; extra == 'dev' Handling pylint ; extra == 'dev' from wheel metadata: Requires-Dist Ignoring alien requirement: pylint ; extra == 'dev' Handling pytest ; extra == 'dev' from wheel metadata: Requires-Dist Ignoring alien requirement: pytest ; extra == 'dev' Handling twine ; extra == 'dev' from wheel metadata: Requires-Dist Ignoring alien requirement: twine ; extra == 'dev' Handling gpxpy ; extra == 'examples' from wheel metadata: Requires-Dist Ignoring alien requirement: gpxpy ; extra == 'examples' + RPM_EC=0 ++ jobs -p + exit 0 Wrote: /builddir/build/SRPMS/python-py-staticmaps-0.4.0-1.fc36.buildreqs.nosrc.rpm Child return code was: 11 Dynamic buildrequires detected Going to install missing buildrequires. See root.log for details. ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -br --target x86_64 --nodeps /builddir/build/SPECS/python-py-staticmaps.spec'], chrootPath='/var/lib/mock/fedora-rawhide-x86_64-1641018783.036512/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'}shell=Falselogger=timeout=0uid=1000gid=135user='mockbuild'nspawn_args=['--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.ag1gz2gq:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11']unshare_net=TrueraiseExc=FalseprintOutput=True) Using nspawn with args ['--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.ag1gz2gq:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11'] Executing command: ['/usr/bin/systemd-nspawn', '-q', '-M', '92fa734882f0467fb5e705d1fd47ae0d', '-D', '/var/lib/mock/fedora-rawhide-x86_64-1641018783.036512/root', '-a', '-u', 'mockbuild', '--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.ag1gz2gq:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11', '--console=pipe', '--setenv=TERM=vt100', '--setenv=SHELL=/bin/bash', '--setenv=HOME=/builddir', '--setenv=HOSTNAME=mock', '--setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin', '--setenv=PROMPT_COMMAND=printf "\\033]0;\\007"', '--setenv=PS1= \\s-\\v\\$ ', '--setenv=LANG=C.UTF-8', '--resolv-conf=off', 'bash', '--login', '-c', '/usr/bin/rpmbuild -br --target x86_64 --nodeps /builddir/build/SPECS/python-py-staticmaps.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8', 'SYSTEMD_NSPAWN_TMPFS_TMP': '0'} and shell False Building target platforms: x86_64 Building for target x86_64 setting SOURCE_DATE_EPOCH=1640822400 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.G6hMpZ + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + rm -rf py-staticmaps-0.4.0 + /usr/bin/gzip -dc /builddir/build/SOURCES/py-staticmaps-0.4.0.tar.gz + /usr/bin/tar -xof - + STATUS=0 + '[' 0 -ne 0 ']' + cd py-staticmaps-0.4.0 + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + RPM_EC=0 ++ jobs -p + exit 0 Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.OytVZr + umask 022 + cd /builddir/build/BUILD + cd py-staticmaps-0.4.0 + echo python3-devel + echo 'python3dist(pip) >= 19' + echo 'python3dist(packaging)' + '[' -f pyproject.toml ']' + '[' -f setup.py ']' + echo 'python3dist(setuptools) >= 40.8' + echo 'python3dist(wheel)' + rm -rfv '*.dist-info/' + '[' -f /usr/bin/python3 ']' + RPM_TOXENV=py310 + HOSTNAME=rpmbuild + /usr/bin/python3 -s /usr/lib/rpm/redhat/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 -r Handling setuptools >= 40.8 from default build backend Requirement satisfied: setuptools >= 40.8 (installed: setuptools 59.6.0) Handling wheel from default build backend Requirement satisfied: wheel (installed: wheel 0.37.0) warning: no previously-included files matching '__pycache__' found under directory '*' warning: no previously-included files matching '*.py[co]' found under directory '*' HOOK STDOUT: HOOK STDOUT: # py-staticmaps HOOK STDOUT: A python module to create static map images (PNG, SVG) with markers, geodesic lines, etc. HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ## Features HOOK STDOUT: HOOK STDOUT: - Map objects: pin-style markers, image (PNG) markers, polylines, polygons, (geodesic) circles HOOK STDOUT: - Automatic computation of best center + zoom from the added map objects HOOK STDOUT: - Several pre-configured map tile providers HOOK STDOUT: - Proper tile provider attributions display HOOK STDOUT: - On-disc caching of map tile images for faster drawing and reduced load on the tile servers HOOK STDOUT: - Non-anti-aliased drawing via `PILLOW` HOOK STDOUT: - Anti-aliased drawing via `pycairo` (optional; only if `pycairo` is installed properly) HOOK STDOUT: - SVG creation via `svgwrite` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ## Installation HOOK STDOUT: HOOK STDOUT: ### SVG + non-anti-aliased PNG version HOOK STDOUT: HOOK STDOUT: ```shell HOOK STDOUT: pip install py-staticmaps HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: ### SVG + anti-aliased PNG version (via Cairo) HOOK STDOUT: HOOK STDOUT: ```shell HOOK STDOUT: pip install py-staticmaps[cairo] HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: `py-staticmaps` uses `pycairo` for creating anti-aliased raster-graphics, so make sure `libcairo2` is installed on your system (on Ubuntu just install the `libcairo2-dev` package, i.e. `sudo apt install libcairo2-dev`). HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ## Examples HOOK STDOUT: HOOK STDOUT: Note: PNG support (e.g. `context.render_cairo(...)`) is only available if the `pycairo` module is installed. HOOK STDOUT: HOOK STDOUT: ### Markers and Geodesic Lines HOOK STDOUT: HOOK STDOUT: ```python HOOK STDOUT: import staticmaps HOOK STDOUT: HOOK STDOUT: context = staticmaps.Context() HOOK STDOUT: context.set_tile_provider(staticmaps.tile_provider_StamenToner) HOOK STDOUT: HOOK STDOUT: frankfurt = staticmaps.create_latlng(50.110644, 8.682092) HOOK STDOUT: newyork = staticmaps.create_latlng(40.712728, -74.006015) HOOK STDOUT: HOOK STDOUT: context.add_object(staticmaps.Line([frankfurt, newyork], color=staticmaps.BLUE, width=4)) HOOK STDOUT: context.add_object(staticmaps.Marker(frankfurt, color=staticmaps.GREEN, size=12)) HOOK STDOUT: context.add_object(staticmaps.Marker(newyork, color=staticmaps.RED, size=12)) HOOK STDOUT: HOOK STDOUT: # render non-anti-aliased png HOOK STDOUT: image = context.render_pillow(800, 500) HOOK STDOUT: image.save("frankfurt_newyork.pillow.png") HOOK STDOUT: HOOK STDOUT: # render anti-aliased png (this only works if pycairo is installed) HOOK STDOUT: image = context.render_cairo(800, 500) HOOK STDOUT: image.write_to_png("frankfurt_newyork.cairo.png") HOOK STDOUT: HOOK STDOUT: # render svg HOOK STDOUT: svg_image = context.render_svg(800, 500) HOOK STDOUT: with open("frankfurt_newyork.svg", "w", encoding="utf-8") as f: HOOK STDOUT: svg_image.write(f, pretty=True) HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### Transparent Polygons HOOK STDOUT: HOOK STDOUT: ```python HOOK STDOUT: import staticmaps HOOK STDOUT: HOOK STDOUT: context = staticmaps.Context() HOOK STDOUT: context.set_tile_provider(staticmaps.tile_provider_OSM) HOOK STDOUT: HOOK STDOUT: freiburg_polygon = [ HOOK STDOUT: (47.96881, 7.79045), HOOK STDOUT: (47.96866, 7.78610), HOOK STDOUT: (47.97134, 7.77874), HOOK STDOUT: ... HOOK STDOUT: ] HOOK STDOUT: HOOK STDOUT: context.add_object( HOOK STDOUT: staticmaps.Area( HOOK STDOUT: [staticmaps.create_latlng(lat, lng) for lat, lng in freiburg_polygon], HOOK STDOUT: fill_color=staticmaps.parse_color("#00FF003F"), HOOK STDOUT: width=2, HOOK STDOUT: color=staticmaps.BLUE, HOOK STDOUT: ) HOOK STDOUT: ) HOOK STDOUT: HOOK STDOUT: # render non-anti-aliased png HOOK STDOUT: image = context.render_pillow(800, 500) HOOK STDOUT: image.save("freiburg_area.pillow.png") HOOK STDOUT: HOOK STDOUT: # render anti-aliased png (this only works if pycairo is installed) HOOK STDOUT: image = context.render_cairo(800, 500) HOOK STDOUT: image.write_to_png("freiburg_area.cairo.png") HOOK STDOUT: HOOK STDOUT: # render svg HOOK STDOUT: svg_image = context.render_svg(800, 500) HOOK STDOUT: with open("freiburg_area.svg", "w", encoding="utf-8") as f: HOOK STDOUT: svg_image.write(f, pretty=True) HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### Drawing a GPX Track + Image Marker (PNG) HOOK STDOUT: HOOK STDOUT: ```python HOOK STDOUT: import sys HOOK STDOUT: HOOK STDOUT: import gpxpy HOOK STDOUT: import staticmaps HOOK STDOUT: HOOK STDOUT: context = staticmaps.Context() HOOK STDOUT: context.set_tile_provider(staticmaps.tile_provider_ArcGISWorldImagery) HOOK STDOUT: HOOK STDOUT: with open(sys.argv[1], "r") as file: HOOK STDOUT: gpx = gpxpy.parse(file) HOOK STDOUT: HOOK STDOUT: for track in gpx.tracks: HOOK STDOUT: for segment in track.segments: HOOK STDOUT: line = [staticmaps.create_latlng(p.latitude, p.longitude) for p in segment.points] HOOK STDOUT: context.add_object(staticmaps.Line(line)) HOOK STDOUT: HOOK STDOUT: for p in gpx.walk(only_points=True): HOOK STDOUT: pos = staticmaps.create_latlng(p.latitude, p.longitude) HOOK STDOUT: marker = staticmaps.ImageMarker(pos, "start.png", origin_x=27, origin_y=35) HOOK STDOUT: context.add_object(marker) HOOK STDOUT: break HOOK STDOUT: HOOK STDOUT: # render non-anti-aliased png HOOK STDOUT: image = context.render_pillow(800, 500) HOOK STDOUT: image.save("draw_gpx.pillow.png") HOOK STDOUT: HOOK STDOUT: # render anti-aliased png (this only works if pycairo is installed) HOOK STDOUT: image = context.render_cairo(800, 500) HOOK STDOUT: image.write_to_png("draw_gpx.cairo.png") HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### US State Capitals HOOK STDOUT: HOOK STDOUT: ```python HOOK STDOUT: import json HOOK STDOUT: import requests HOOK STDOUT: import staticmaps HOOK STDOUT: HOOK STDOUT: context = staticmaps.Context() HOOK STDOUT: context.set_tile_provider(staticmaps.tile_provider_OSM) HOOK STDOUT: HOOK STDOUT: URL = ( HOOK STDOUT: "https://gist.githubusercontent.com/jpriebe/d62a45e29f24e843c974/" HOOK STDOUT: "raw/b1d3066d245e742018bce56e41788ac7afa60e29/us_state_capitals.json" HOOK STDOUT: ) HOOK STDOUT: response = requests.get(URL) HOOK STDOUT: for _, data in json.loads(response.text).items(): HOOK STDOUT: capital = staticmaps.create_latlng(float(data["lat"]), float(data["long"])) HOOK STDOUT: context.add_object(staticmaps.Marker(capital, size=5)) HOOK STDOUT: HOOK STDOUT: # render non-anti-aliased png HOOK STDOUT: image = context.render_pillow(800, 500) HOOK STDOUT: image.save("us_capitals.pillow.png") HOOK STDOUT: HOOK STDOUT: # render anti-aliased png (this only works if pycairo is installed) HOOK STDOUT: image = context.render_cairo(800, 500) HOOK STDOUT: image.write_to_png("us_capitals.cairo.png") HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### Geodesic Circles HOOK STDOUT: HOOK STDOUT: ```python HOOK STDOUT: import staticmaps HOOK STDOUT: HOOK STDOUT: context = staticmaps.Context() HOOK STDOUT: context.set_tile_provider(staticmaps.tile_provider_StamenToner) HOOK STDOUT: HOOK STDOUT: center1 = staticmaps.create_latlng(66, 0) HOOK STDOUT: center2 = staticmaps.create_latlng(0, 0) HOOK STDOUT: HOOK STDOUT: context.add_object(staticmaps.Circle(center1, 2000, fill_color=staticmaps.TRANSPARENT, color=staticmaps.RED, width=2)) HOOK STDOUT: context.add_object(staticmaps.Circle(center2, 2000, fill_color=staticmaps.TRANSPARENT, color=staticmaps.GREEN, width=2)) HOOK STDOUT: context.add_object(staticmaps.Marker(center1, color=staticmaps.RED)) HOOK STDOUT: context.add_object(staticmaps.Marker(center2, color=staticmaps.GREEN)) HOOK STDOUT: HOOK STDOUT: # render non-anti-aliased png HOOK STDOUT: image = context.render_pillow(800, 500) HOOK STDOUT: image.save("geodesic_circles.pillow.png") HOOK STDOUT: HOOK STDOUT: # render anti-aliased png (this only works if pycairo is installed) HOOK STDOUT: image = context.render_cairo(800, 600) HOOK STDOUT: image.write_to_png("geodesic_circles.cairo.png") HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### Other Examples HOOK STDOUT: HOOK STDOUT: Please take a look at the command line program which uses the `staticmaps` package: `staticmaps/cli.py` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### Dependencies HOOK STDOUT: HOOK STDOUT: `py-staticmaps` uses HOOK STDOUT: HOOK STDOUT: - `PILLOW` for rendering raster-graphics HOOK STDOUT: - `pycairo` for rendering antialiased raster-graphics (optional!) HOOK STDOUT: - `svgwrite` for writing SVG files HOOK STDOUT: - `s2sphere` for geo coordinates handling HOOK STDOUT: - `geographiclib` for geodesic computations HOOK STDOUT: - `appdirs` for finding the user's default cache directory HOOK STDOUT: - `requests` for downloading tile files HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ## License HOOK STDOUT: HOOK STDOUT: [MIT](LICENSE) © 2020-2021 Florian Pigorsch HOOK STDOUT: HOOK STDOUT: running egg_info HOOK STDOUT: writing py_staticmaps.egg-info/PKG-INFO HOOK STDOUT: writing dependency_links to py_staticmaps.egg-info/dependency_links.txt HOOK STDOUT: writing entry points to py_staticmaps.egg-info/entry_points.txt HOOK STDOUT: writing requirements to py_staticmaps.egg-info/requires.txt HOOK STDOUT: writing top-level names to py_staticmaps.egg-info/top_level.txt HOOK STDOUT: reading manifest file 'py_staticmaps.egg-info/SOURCES.txt' HOOK STDOUT: reading manifest template 'MANIFEST.in' HOOK STDOUT: adding license file 'LICENSE' HOOK STDOUT: writing manifest file 'py_staticmaps.egg-info/SOURCES.txt' Handling wheel from get_requires_for_build_wheel Requirement satisfied: wheel (installed: wheel 0.37.0) warning: no previously-included files matching '__pycache__' found under directory '*' warning: no previously-included files matching '*.py[co]' found under directory '*' HOOK STDOUT: HOOK STDOUT: # py-staticmaps HOOK STDOUT: A python module to create static map images (PNG, SVG) with markers, geodesic lines, etc. HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ## Features HOOK STDOUT: HOOK STDOUT: - Map objects: pin-style markers, image (PNG) markers, polylines, polygons, (geodesic) circles HOOK STDOUT: - Automatic computation of best center + zoom from the added map objects HOOK STDOUT: - Several pre-configured map tile providers HOOK STDOUT: - Proper tile provider attributions display HOOK STDOUT: - On-disc caching of map tile images for faster drawing and reduced load on the tile servers HOOK STDOUT: - Non-anti-aliased drawing via `PILLOW` HOOK STDOUT: - Anti-aliased drawing via `pycairo` (optional; only if `pycairo` is installed properly) HOOK STDOUT: - SVG creation via `svgwrite` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ## Installation HOOK STDOUT: HOOK STDOUT: ### SVG + non-anti-aliased PNG version HOOK STDOUT: HOOK STDOUT: ```shell HOOK STDOUT: pip install py-staticmaps HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: ### SVG + anti-aliased PNG version (via Cairo) HOOK STDOUT: HOOK STDOUT: ```shell HOOK STDOUT: pip install py-staticmaps[cairo] HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: `py-staticmaps` uses `pycairo` for creating anti-aliased raster-graphics, so make sure `libcairo2` is installed on your system (on Ubuntu just install the `libcairo2-dev` package, i.e. `sudo apt install libcairo2-dev`). HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ## Examples HOOK STDOUT: HOOK STDOUT: Note: PNG support (e.g. `context.render_cairo(...)`) is only available if the `pycairo` module is installed. HOOK STDOUT: HOOK STDOUT: ### Markers and Geodesic Lines HOOK STDOUT: HOOK STDOUT: ```python HOOK STDOUT: import staticmaps HOOK STDOUT: HOOK STDOUT: context = staticmaps.Context() HOOK STDOUT: context.set_tile_provider(staticmaps.tile_provider_StamenToner) HOOK STDOUT: HOOK STDOUT: frankfurt = staticmaps.create_latlng(50.110644, 8.682092) HOOK STDOUT: newyork = staticmaps.create_latlng(40.712728, -74.006015) HOOK STDOUT: HOOK STDOUT: context.add_object(staticmaps.Line([frankfurt, newyork], color=staticmaps.BLUE, width=4)) HOOK STDOUT: context.add_object(staticmaps.Marker(frankfurt, color=staticmaps.GREEN, size=12)) HOOK STDOUT: context.add_object(staticmaps.Marker(newyork, color=staticmaps.RED, size=12)) HOOK STDOUT: HOOK STDOUT: # render non-anti-aliased png HOOK STDOUT: image = context.render_pillow(800, 500) HOOK STDOUT: image.save("frankfurt_newyork.pillow.png") HOOK STDOUT: HOOK STDOUT: # render anti-aliased png (this only works if pycairo is installed) HOOK STDOUT: image = context.render_cairo(800, 500) HOOK STDOUT: image.write_to_png("frankfurt_newyork.cairo.png") HOOK STDOUT: HOOK STDOUT: # render svg HOOK STDOUT: svg_image = context.render_svg(800, 500) HOOK STDOUT: with open("frankfurt_newyork.svg", "w", encoding="utf-8") as f: HOOK STDOUT: svg_image.write(f, pretty=True) HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### Transparent Polygons HOOK STDOUT: HOOK STDOUT: ```python HOOK STDOUT: import staticmaps HOOK STDOUT: HOOK STDOUT: context = staticmaps.Context() HOOK STDOUT: context.set_tile_provider(staticmaps.tile_provider_OSM) HOOK STDOUT: HOOK STDOUT: freiburg_polygon = [ HOOK STDOUT: (47.96881, 7.79045), HOOK STDOUT: (47.96866, 7.78610), HOOK STDOUT: (47.97134, 7.77874), HOOK STDOUT: ... HOOK STDOUT: ] HOOK STDOUT: HOOK STDOUT: context.add_object( HOOK STDOUT: staticmaps.Area( HOOK STDOUT: [staticmaps.create_latlng(lat, lng) for lat, lng in freiburg_polygon], HOOK STDOUT: fill_color=staticmaps.parse_color("#00FF003F"), HOOK STDOUT: width=2, HOOK STDOUT: color=staticmaps.BLUE, HOOK STDOUT: ) HOOK STDOUT: ) HOOK STDOUT: HOOK STDOUT: # render non-anti-aliased png HOOK STDOUT: image = context.render_pillow(800, 500) HOOK STDOUT: image.save("freiburg_area.pillow.png") HOOK STDOUT: HOOK STDOUT: # render anti-aliased png (this only works if pycairo is installed) HOOK STDOUT: image = context.render_cairo(800, 500) HOOK STDOUT: image.write_to_png("freiburg_area.cairo.png") HOOK STDOUT: HOOK STDOUT: # render svg HOOK STDOUT: svg_image = context.render_svg(800, 500) HOOK STDOUT: with open("freiburg_area.svg", "w", encoding="utf-8") as f: HOOK STDOUT: svg_image.write(f, pretty=True) HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### Drawing a GPX Track + Image Marker (PNG) HOOK STDOUT: HOOK STDOUT: ```python HOOK STDOUT: import sys HOOK STDOUT: HOOK STDOUT: import gpxpy HOOK STDOUT: import staticmaps HOOK STDOUT: HOOK STDOUT: context = staticmaps.Context() HOOK STDOUT: context.set_tile_provider(staticmaps.tile_provider_ArcGISWorldImagery) HOOK STDOUT: HOOK STDOUT: with open(sys.argv[1], "r") as file: HOOK STDOUT: gpx = gpxpy.parse(file) HOOK STDOUT: HOOK STDOUT: for track in gpx.tracks: HOOK STDOUT: for segment in track.segments: HOOK STDOUT: line = [staticmaps.create_latlng(p.latitude, p.longitude) for p in segment.points] HOOK STDOUT: context.add_object(staticmaps.Line(line)) HOOK STDOUT: HOOK STDOUT: for p in gpx.walk(only_points=True): HOOK STDOUT: pos = staticmaps.create_latlng(p.latitude, p.longitude) HOOK STDOUT: marker = staticmaps.ImageMarker(pos, "start.png", origin_x=27, origin_y=35) HOOK STDOUT: context.add_object(marker) HOOK STDOUT: break HOOK STDOUT: HOOK STDOUT: # render non-anti-aliased png HOOK STDOUT: image = context.render_pillow(800, 500) HOOK STDOUT: image.save("draw_gpx.pillow.png") HOOK STDOUT: HOOK STDOUT: # render anti-aliased png (this only works if pycairo is installed) HOOK STDOUT: image = context.render_cairo(800, 500) HOOK STDOUT: image.write_to_png("draw_gpx.cairo.png") HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### US State Capitals HOOK STDOUT: HOOK STDOUT: ```python HOOK STDOUT: import json HOOK STDOUT: import requests HOOK STDOUT: import staticmaps HOOK STDOUT: HOOK STDOUT: context = staticmaps.Context() HOOK STDOUT: context.set_tile_provider(staticmaps.tile_provider_OSM) HOOK STDOUT: HOOK STDOUT: URL = ( HOOK STDOUT: "https://gist.githubusercontent.com/jpriebe/d62a45e29f24e843c974/" HOOK STDOUT: "raw/b1d3066d245e742018bce56e41788ac7afa60e29/us_state_capitals.json" HOOK STDOUT: ) HOOK STDOUT: response = requests.get(URL) HOOK STDOUT: for _, data in json.loads(response.text).items(): HOOK STDOUT: capital = staticmaps.create_latlng(float(data["lat"]), float(data["long"])) HOOK STDOUT: context.add_object(staticmaps.Marker(capital, size=5)) HOOK STDOUT: HOOK STDOUT: # render non-anti-aliased png HOOK STDOUT: image = context.render_pillow(800, 500) HOOK STDOUT: image.save("us_capitals.pillow.png") HOOK STDOUT: HOOK STDOUT: # render anti-aliased png (this only works if pycairo is installed) HOOK STDOUT: image = context.render_cairo(800, 500) HOOK STDOUT: image.write_to_png("us_capitals.cairo.png") HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### Geodesic Circles HOOK STDOUT: HOOK STDOUT: ```python HOOK STDOUT: import staticmaps HOOK STDOUT: HOOK STDOUT: context = staticmaps.Context() HOOK STDOUT: context.set_tile_provider(staticmaps.tile_provider_StamenToner) HOOK STDOUT: HOOK STDOUT: center1 = staticmaps.create_latlng(66, 0) HOOK STDOUT: center2 = staticmaps.create_latlng(0, 0) HOOK STDOUT: HOOK STDOUT: context.add_object(staticmaps.Circle(center1, 2000, fill_color=staticmaps.TRANSPARENT, color=staticmaps.RED, width=2)) HOOK STDOUT: context.add_object(staticmaps.Circle(center2, 2000, fill_color=staticmaps.TRANSPARENT, color=staticmaps.GREEN, width=2)) HOOK STDOUT: context.add_object(staticmaps.Marker(center1, color=staticmaps.RED)) HOOK STDOUT: context.add_object(staticmaps.Marker(center2, color=staticmaps.GREEN)) HOOK STDOUT: HOOK STDOUT: # render non-anti-aliased png HOOK STDOUT: image = context.render_pillow(800, 500) HOOK STDOUT: image.save("geodesic_circles.pillow.png") HOOK STDOUT: HOOK STDOUT: # render anti-aliased png (this only works if pycairo is installed) HOOK STDOUT: image = context.render_cairo(800, 600) HOOK STDOUT: image.write_to_png("geodesic_circles.cairo.png") HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### Other Examples HOOK STDOUT: HOOK STDOUT: Please take a look at the command line program which uses the `staticmaps` package: `staticmaps/cli.py` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### Dependencies HOOK STDOUT: HOOK STDOUT: `py-staticmaps` uses HOOK STDOUT: HOOK STDOUT: - `PILLOW` for rendering raster-graphics HOOK STDOUT: - `pycairo` for rendering antialiased raster-graphics (optional!) HOOK STDOUT: - `svgwrite` for writing SVG files HOOK STDOUT: - `s2sphere` for geo coordinates handling HOOK STDOUT: - `geographiclib` for geodesic computations HOOK STDOUT: - `appdirs` for finding the user's default cache directory HOOK STDOUT: - `requests` for downloading tile files HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ## License HOOK STDOUT: HOOK STDOUT: [MIT](LICENSE) © 2020-2021 Florian Pigorsch HOOK STDOUT: HOOK STDOUT: running dist_info HOOK STDOUT: writing py_staticmaps.egg-info/PKG-INFO HOOK STDOUT: writing dependency_links to py_staticmaps.egg-info/dependency_links.txt HOOK STDOUT: writing entry points to py_staticmaps.egg-info/entry_points.txt HOOK STDOUT: writing requirements to py_staticmaps.egg-info/requires.txt HOOK STDOUT: writing top-level names to py_staticmaps.egg-info/top_level.txt HOOK STDOUT: reading manifest file 'py_staticmaps.egg-info/SOURCES.txt' HOOK STDOUT: reading manifest template 'MANIFEST.in' HOOK STDOUT: adding license file 'LICENSE' HOOK STDOUT: writing manifest file 'py_staticmaps.egg-info/SOURCES.txt' HOOK STDOUT: creating '/builddir/build/BUILD/py-staticmaps-0.4.0/py_staticmaps.dist-info' HOOK STDOUT: adding license file "LICENSE" (matched pattern "LICEN[CS]E*") Handling appdirs from wheel metadata: Requires-Dist Requirement satisfied: appdirs (installed: appdirs 1.4.4) Handling geographiclib from wheel metadata: Requires-Dist Requirement satisfied: geographiclib (installed: geographiclib 1.52) Handling PILLOW from wheel metadata: Requires-Dist Requirement satisfied: PILLOW (installed: PILLOW 8.4.0) Handling python-slugify from wheel metadata: Requires-Dist Requirement satisfied: python-slugify (installed: python-slugify 5.0.2) Handling requests from wheel metadata: Requires-Dist Requirement satisfied: requests (installed: requests 2.26.0) Handling s2sphere from wheel metadata: Requires-Dist Requirement satisfied: s2sphere (installed: s2sphere 0.2.5) Handling svgwrite from wheel metadata: Requires-Dist Requirement satisfied: svgwrite (installed: svgwrite 1.4.1) Handling pycairo ; extra == 'cairo' from wheel metadata: Requires-Dist Ignoring alien requirement: pycairo ; extra == 'cairo' Handling black ; extra == 'dev' from wheel metadata: Requires-Dist Ignoring alien requirement: black ; extra == 'dev' Handling flake8 ; extra == 'dev' from wheel metadata: Requires-Dist Ignoring alien requirement: flake8 ; extra == 'dev' Handling mypy ; extra == 'dev' from wheel metadata: Requires-Dist Ignoring alien requirement: mypy ; extra == 'dev' Handling pylint ; extra == 'dev' from wheel metadata: Requires-Dist Ignoring alien requirement: pylint ; extra == 'dev' Handling pytest ; extra == 'dev' from wheel metadata: Requires-Dist Ignoring alien requirement: pytest ; extra == 'dev' Handling twine ; extra == 'dev' from wheel metadata: Requires-Dist Ignoring alien requirement: twine ; extra == 'dev' Handling gpxpy ; extra == 'examples' from wheel metadata: Requires-Dist Ignoring alien requirement: gpxpy ; extra == 'examples' + RPM_EC=0 ++ jobs -p + exit 0 Wrote: /builddir/build/SRPMS/python-py-staticmaps-0.4.0-1.fc36.buildreqs.nosrc.rpm Child return code was: 11 Dynamic buildrequires detected Going to install missing buildrequires. See root.log for details. ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -ba --noprep --target x86_64 --nodeps /builddir/build/SPECS/python-py-staticmaps.spec'], chrootPath='/var/lib/mock/fedora-rawhide-x86_64-1641018783.036512/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'}shell=Falselogger=timeout=0uid=1000gid=135user='mockbuild'nspawn_args=['--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.ag1gz2gq:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11']unshare_net=TrueprintOutput=True) Using nspawn with args ['--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.ag1gz2gq:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11'] Executing command: ['/usr/bin/systemd-nspawn', '-q', '-M', '0107c3afc8b741438d4e4a34c067d025', '-D', '/var/lib/mock/fedora-rawhide-x86_64-1641018783.036512/root', '-a', '-u', 'mockbuild', '--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.ag1gz2gq:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11', '--console=pipe', '--setenv=TERM=vt100', '--setenv=SHELL=/bin/bash', '--setenv=HOME=/builddir', '--setenv=HOSTNAME=mock', '--setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin', '--setenv=PROMPT_COMMAND=printf "\\033]0;\\007"', '--setenv=PS1= \\s-\\v\\$ ', '--setenv=LANG=C.UTF-8', '--resolv-conf=off', 'bash', '--login', '-c', '/usr/bin/rpmbuild -ba --noprep --target x86_64 --nodeps /builddir/build/SPECS/python-py-staticmaps.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8', 'SYSTEMD_NSPAWN_TMPFS_TMP': '0'} and shell False Building target platforms: x86_64 Building for target x86_64 setting SOURCE_DATE_EPOCH=1640822400 Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.UjxZ6Y + umask 022 + cd /builddir/build/BUILD + cd py-staticmaps-0.4.0 + echo python3-devel + echo 'python3dist(pip) >= 19' + echo 'python3dist(packaging)' + '[' -f pyproject.toml ']' + '[' -f setup.py ']' + echo 'python3dist(setuptools) >= 40.8' + echo 'python3dist(wheel)' + rm -rfv py_staticmaps.dist-info/ removed 'py_staticmaps.dist-info/LICENSE' removed 'py_staticmaps.dist-info/METADATA' removed 'py_staticmaps.dist-info/entry_points.txt' removed 'py_staticmaps.dist-info/top_level.txt' removed directory 'py_staticmaps.dist-info/' + '[' -f /usr/bin/python3 ']' + RPM_TOXENV=py310 + HOSTNAME=rpmbuild + /usr/bin/python3 -s /usr/lib/rpm/redhat/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 -r Handling setuptools >= 40.8 from default build backend Requirement satisfied: setuptools >= 40.8 (installed: setuptools 59.6.0) Handling wheel from default build backend Requirement satisfied: wheel (installed: wheel 0.37.0) warning: no previously-included files matching '__pycache__' found under directory '*' warning: no previously-included files matching '*.py[co]' found under directory '*' HOOK STDOUT: HOOK STDOUT: # py-staticmaps HOOK STDOUT: A python module to create static map images (PNG, SVG) with markers, geodesic lines, etc. HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ## Features HOOK STDOUT: HOOK STDOUT: - Map objects: pin-style markers, image (PNG) markers, polylines, polygons, (geodesic) circles HOOK STDOUT: - Automatic computation of best center + zoom from the added map objects HOOK STDOUT: - Several pre-configured map tile providers HOOK STDOUT: - Proper tile provider attributions display HOOK STDOUT: - On-disc caching of map tile images for faster drawing and reduced load on the tile servers HOOK STDOUT: - Non-anti-aliased drawing via `PILLOW` HOOK STDOUT: - Anti-aliased drawing via `pycairo` (optional; only if `pycairo` is installed properly) HOOK STDOUT: - SVG creation via `svgwrite` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ## Installation HOOK STDOUT: HOOK STDOUT: ### SVG + non-anti-aliased PNG version HOOK STDOUT: HOOK STDOUT: ```shell HOOK STDOUT: pip install py-staticmaps HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: ### SVG + anti-aliased PNG version (via Cairo) HOOK STDOUT: HOOK STDOUT: ```shell HOOK STDOUT: pip install py-staticmaps[cairo] HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: `py-staticmaps` uses `pycairo` for creating anti-aliased raster-graphics, so make sure `libcairo2` is installed on your system (on Ubuntu just install the `libcairo2-dev` package, i.e. `sudo apt install libcairo2-dev`). HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ## Examples HOOK STDOUT: HOOK STDOUT: Note: PNG support (e.g. `context.render_cairo(...)`) is only available if the `pycairo` module is installed. HOOK STDOUT: HOOK STDOUT: ### Markers and Geodesic Lines HOOK STDOUT: HOOK STDOUT: ```python HOOK STDOUT: import staticmaps HOOK STDOUT: HOOK STDOUT: context = staticmaps.Context() HOOK STDOUT: context.set_tile_provider(staticmaps.tile_provider_StamenToner) HOOK STDOUT: HOOK STDOUT: frankfurt = staticmaps.create_latlng(50.110644, 8.682092) HOOK STDOUT: newyork = staticmaps.create_latlng(40.712728, -74.006015) HOOK STDOUT: HOOK STDOUT: context.add_object(staticmaps.Line([frankfurt, newyork], color=staticmaps.BLUE, width=4)) HOOK STDOUT: context.add_object(staticmaps.Marker(frankfurt, color=staticmaps.GREEN, size=12)) HOOK STDOUT: context.add_object(staticmaps.Marker(newyork, color=staticmaps.RED, size=12)) HOOK STDOUT: HOOK STDOUT: # render non-anti-aliased png HOOK STDOUT: image = context.render_pillow(800, 500) HOOK STDOUT: image.save("frankfurt_newyork.pillow.png") HOOK STDOUT: HOOK STDOUT: # render anti-aliased png (this only works if pycairo is installed) HOOK STDOUT: image = context.render_cairo(800, 500) HOOK STDOUT: image.write_to_png("frankfurt_newyork.cairo.png") HOOK STDOUT: HOOK STDOUT: # render svg HOOK STDOUT: svg_image = context.render_svg(800, 500) HOOK STDOUT: with open("frankfurt_newyork.svg", "w", encoding="utf-8") as f: HOOK STDOUT: svg_image.write(f, pretty=True) HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### Transparent Polygons HOOK STDOUT: HOOK STDOUT: ```python HOOK STDOUT: import staticmaps HOOK STDOUT: HOOK STDOUT: context = staticmaps.Context() HOOK STDOUT: context.set_tile_provider(staticmaps.tile_provider_OSM) HOOK STDOUT: HOOK STDOUT: freiburg_polygon = [ HOOK STDOUT: (47.96881, 7.79045), HOOK STDOUT: (47.96866, 7.78610), HOOK STDOUT: (47.97134, 7.77874), HOOK STDOUT: ... HOOK STDOUT: ] HOOK STDOUT: HOOK STDOUT: context.add_object( HOOK STDOUT: staticmaps.Area( HOOK STDOUT: [staticmaps.create_latlng(lat, lng) for lat, lng in freiburg_polygon], HOOK STDOUT: fill_color=staticmaps.parse_color("#00FF003F"), HOOK STDOUT: width=2, HOOK STDOUT: color=staticmaps.BLUE, HOOK STDOUT: ) HOOK STDOUT: ) HOOK STDOUT: HOOK STDOUT: # render non-anti-aliased png HOOK STDOUT: image = context.render_pillow(800, 500) HOOK STDOUT: image.save("freiburg_area.pillow.png") HOOK STDOUT: HOOK STDOUT: # render anti-aliased png (this only works if pycairo is installed) HOOK STDOUT: image = context.render_cairo(800, 500) HOOK STDOUT: image.write_to_png("freiburg_area.cairo.png") HOOK STDOUT: HOOK STDOUT: # render svg HOOK STDOUT: svg_image = context.render_svg(800, 500) HOOK STDOUT: with open("freiburg_area.svg", "w", encoding="utf-8") as f: HOOK STDOUT: svg_image.write(f, pretty=True) HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### Drawing a GPX Track + Image Marker (PNG) HOOK STDOUT: HOOK STDOUT: ```python HOOK STDOUT: import sys HOOK STDOUT: HOOK STDOUT: import gpxpy HOOK STDOUT: import staticmaps HOOK STDOUT: HOOK STDOUT: context = staticmaps.Context() HOOK STDOUT: context.set_tile_provider(staticmaps.tile_provider_ArcGISWorldImagery) HOOK STDOUT: HOOK STDOUT: with open(sys.argv[1], "r") as file: HOOK STDOUT: gpx = gpxpy.parse(file) HOOK STDOUT: HOOK STDOUT: for track in gpx.tracks: HOOK STDOUT: for segment in track.segments: HOOK STDOUT: line = [staticmaps.create_latlng(p.latitude, p.longitude) for p in segment.points] HOOK STDOUT: context.add_object(staticmaps.Line(line)) HOOK STDOUT: HOOK STDOUT: for p in gpx.walk(only_points=True): HOOK STDOUT: pos = staticmaps.create_latlng(p.latitude, p.longitude) HOOK STDOUT: marker = staticmaps.ImageMarker(pos, "start.png", origin_x=27, origin_y=35) HOOK STDOUT: context.add_object(marker) HOOK STDOUT: break HOOK STDOUT: HOOK STDOUT: # render non-anti-aliased png HOOK STDOUT: image = context.render_pillow(800, 500) HOOK STDOUT: image.save("draw_gpx.pillow.png") HOOK STDOUT: HOOK STDOUT: # render anti-aliased png (this only works if pycairo is installed) HOOK STDOUT: image = context.render_cairo(800, 500) HOOK STDOUT: image.write_to_png("draw_gpx.cairo.png") HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### US State Capitals HOOK STDOUT: HOOK STDOUT: ```python HOOK STDOUT: import json HOOK STDOUT: import requests HOOK STDOUT: import staticmaps HOOK STDOUT: HOOK STDOUT: context = staticmaps.Context() HOOK STDOUT: context.set_tile_provider(staticmaps.tile_provider_OSM) HOOK STDOUT: HOOK STDOUT: URL = ( HOOK STDOUT: "https://gist.githubusercontent.com/jpriebe/d62a45e29f24e843c974/" HOOK STDOUT: "raw/b1d3066d245e742018bce56e41788ac7afa60e29/us_state_capitals.json" HOOK STDOUT: ) HOOK STDOUT: response = requests.get(URL) HOOK STDOUT: for _, data in json.loads(response.text).items(): HOOK STDOUT: capital = staticmaps.create_latlng(float(data["lat"]), float(data["long"])) HOOK STDOUT: context.add_object(staticmaps.Marker(capital, size=5)) HOOK STDOUT: HOOK STDOUT: # render non-anti-aliased png HOOK STDOUT: image = context.render_pillow(800, 500) HOOK STDOUT: image.save("us_capitals.pillow.png") HOOK STDOUT: HOOK STDOUT: # render anti-aliased png (this only works if pycairo is installed) HOOK STDOUT: image = context.render_cairo(800, 500) HOOK STDOUT: image.write_to_png("us_capitals.cairo.png") HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### Geodesic Circles HOOK STDOUT: HOOK STDOUT: ```python HOOK STDOUT: import staticmaps HOOK STDOUT: HOOK STDOUT: context = staticmaps.Context() HOOK STDOUT: context.set_tile_provider(staticmaps.tile_provider_StamenToner) HOOK STDOUT: HOOK STDOUT: center1 = staticmaps.create_latlng(66, 0) HOOK STDOUT: center2 = staticmaps.create_latlng(0, 0) HOOK STDOUT: HOOK STDOUT: context.add_object(staticmaps.Circle(center1, 2000, fill_color=staticmaps.TRANSPARENT, color=staticmaps.RED, width=2)) HOOK STDOUT: context.add_object(staticmaps.Circle(center2, 2000, fill_color=staticmaps.TRANSPARENT, color=staticmaps.GREEN, width=2)) HOOK STDOUT: context.add_object(staticmaps.Marker(center1, color=staticmaps.RED)) HOOK STDOUT: context.add_object(staticmaps.Marker(center2, color=staticmaps.GREEN)) HOOK STDOUT: HOOK STDOUT: # render non-anti-aliased png HOOK STDOUT: image = context.render_pillow(800, 500) HOOK STDOUT: image.save("geodesic_circles.pillow.png") HOOK STDOUT: HOOK STDOUT: # render anti-aliased png (this only works if pycairo is installed) HOOK STDOUT: image = context.render_cairo(800, 600) HOOK STDOUT: image.write_to_png("geodesic_circles.cairo.png") HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### Other Examples HOOK STDOUT: HOOK STDOUT: Please take a look at the command line program which uses the `staticmaps` package: `staticmaps/cli.py` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### Dependencies HOOK STDOUT: HOOK STDOUT: `py-staticmaps` uses HOOK STDOUT: HOOK STDOUT: - `PILLOW` for rendering raster-graphics HOOK STDOUT: - `pycairo` for rendering antialiased raster-graphics (optional!) HOOK STDOUT: - `svgwrite` for writing SVG files HOOK STDOUT: - `s2sphere` for geo coordinates handling HOOK STDOUT: - `geographiclib` for geodesic computations HOOK STDOUT: - `appdirs` for finding the user's default cache directory HOOK STDOUT: - `requests` for downloading tile files HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ## License HOOK STDOUT: HOOK STDOUT: [MIT](LICENSE) © 2020-2021 Florian Pigorsch HOOK STDOUT: HOOK STDOUT: running egg_info HOOK STDOUT: creating py_staticmaps.egg-info HOOK STDOUT: writing py_staticmaps.egg-info/PKG-INFO HOOK STDOUT: writing dependency_links to py_staticmaps.egg-info/dependency_links.txt HOOK STDOUT: writing entry points to py_staticmaps.egg-info/entry_points.txt HOOK STDOUT: writing requirements to py_staticmaps.egg-info/requires.txt HOOK STDOUT: writing top-level names to py_staticmaps.egg-info/top_level.txt HOOK STDOUT: writing manifest file 'py_staticmaps.egg-info/SOURCES.txt' HOOK STDOUT: reading manifest file 'py_staticmaps.egg-info/SOURCES.txt' HOOK STDOUT: reading manifest template 'MANIFEST.in' HOOK STDOUT: adding license file 'LICENSE' HOOK STDOUT: writing manifest file 'py_staticmaps.egg-info/SOURCES.txt' Handling wheel from get_requires_for_build_wheel Requirement satisfied: wheel (installed: wheel 0.37.0) warning: no previously-included files matching '__pycache__' found under directory '*' warning: no previously-included files matching '*.py[co]' found under directory '*' HOOK STDOUT: HOOK STDOUT: # py-staticmaps HOOK STDOUT: A python module to create static map images (PNG, SVG) with markers, geodesic lines, etc. HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ## Features HOOK STDOUT: HOOK STDOUT: - Map objects: pin-style markers, image (PNG) markers, polylines, polygons, (geodesic) circles HOOK STDOUT: - Automatic computation of best center + zoom from the added map objects HOOK STDOUT: - Several pre-configured map tile providers HOOK STDOUT: - Proper tile provider attributions display HOOK STDOUT: - On-disc caching of map tile images for faster drawing and reduced load on the tile servers HOOK STDOUT: - Non-anti-aliased drawing via `PILLOW` HOOK STDOUT: - Anti-aliased drawing via `pycairo` (optional; only if `pycairo` is installed properly) HOOK STDOUT: - SVG creation via `svgwrite` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ## Installation HOOK STDOUT: HOOK STDOUT: ### SVG + non-anti-aliased PNG version HOOK STDOUT: HOOK STDOUT: ```shell HOOK STDOUT: pip install py-staticmaps HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: ### SVG + anti-aliased PNG version (via Cairo) HOOK STDOUT: HOOK STDOUT: ```shell HOOK STDOUT: pip install py-staticmaps[cairo] HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: `py-staticmaps` uses `pycairo` for creating anti-aliased raster-graphics, so make sure `libcairo2` is installed on your system (on Ubuntu just install the `libcairo2-dev` package, i.e. `sudo apt install libcairo2-dev`). HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ## Examples HOOK STDOUT: HOOK STDOUT: Note: PNG support (e.g. `context.render_cairo(...)`) is only available if the `pycairo` module is installed. HOOK STDOUT: HOOK STDOUT: ### Markers and Geodesic Lines HOOK STDOUT: HOOK STDOUT: ```python HOOK STDOUT: import staticmaps HOOK STDOUT: HOOK STDOUT: context = staticmaps.Context() HOOK STDOUT: context.set_tile_provider(staticmaps.tile_provider_StamenToner) HOOK STDOUT: HOOK STDOUT: frankfurt = staticmaps.create_latlng(50.110644, 8.682092) HOOK STDOUT: newyork = staticmaps.create_latlng(40.712728, -74.006015) HOOK STDOUT: HOOK STDOUT: context.add_object(staticmaps.Line([frankfurt, newyork], color=staticmaps.BLUE, width=4)) HOOK STDOUT: context.add_object(staticmaps.Marker(frankfurt, color=staticmaps.GREEN, size=12)) HOOK STDOUT: context.add_object(staticmaps.Marker(newyork, color=staticmaps.RED, size=12)) HOOK STDOUT: HOOK STDOUT: # render non-anti-aliased png HOOK STDOUT: image = context.render_pillow(800, 500) HOOK STDOUT: image.save("frankfurt_newyork.pillow.png") HOOK STDOUT: HOOK STDOUT: # render anti-aliased png (this only works if pycairo is installed) HOOK STDOUT: image = context.render_cairo(800, 500) HOOK STDOUT: image.write_to_png("frankfurt_newyork.cairo.png") HOOK STDOUT: HOOK STDOUT: # render svg HOOK STDOUT: svg_image = context.render_svg(800, 500) HOOK STDOUT: with open("frankfurt_newyork.svg", "w", encoding="utf-8") as f: HOOK STDOUT: svg_image.write(f, pretty=True) HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### Transparent Polygons HOOK STDOUT: HOOK STDOUT: ```python HOOK STDOUT: import staticmaps HOOK STDOUT: HOOK STDOUT: context = staticmaps.Context() HOOK STDOUT: context.set_tile_provider(staticmaps.tile_provider_OSM) HOOK STDOUT: HOOK STDOUT: freiburg_polygon = [ HOOK STDOUT: (47.96881, 7.79045), HOOK STDOUT: (47.96866, 7.78610), HOOK STDOUT: (47.97134, 7.77874), HOOK STDOUT: ... HOOK STDOUT: ] HOOK STDOUT: HOOK STDOUT: context.add_object( HOOK STDOUT: staticmaps.Area( HOOK STDOUT: [staticmaps.create_latlng(lat, lng) for lat, lng in freiburg_polygon], HOOK STDOUT: fill_color=staticmaps.parse_color("#00FF003F"), HOOK STDOUT: width=2, HOOK STDOUT: color=staticmaps.BLUE, HOOK STDOUT: ) HOOK STDOUT: ) HOOK STDOUT: HOOK STDOUT: # render non-anti-aliased png HOOK STDOUT: image = context.render_pillow(800, 500) HOOK STDOUT: image.save("freiburg_area.pillow.png") HOOK STDOUT: HOOK STDOUT: # render anti-aliased png (this only works if pycairo is installed) HOOK STDOUT: image = context.render_cairo(800, 500) HOOK STDOUT: image.write_to_png("freiburg_area.cairo.png") HOOK STDOUT: HOOK STDOUT: # render svg HOOK STDOUT: svg_image = context.render_svg(800, 500) HOOK STDOUT: with open("freiburg_area.svg", "w", encoding="utf-8") as f: HOOK STDOUT: svg_image.write(f, pretty=True) HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### Drawing a GPX Track + Image Marker (PNG) HOOK STDOUT: HOOK STDOUT: ```python HOOK STDOUT: import sys HOOK STDOUT: HOOK STDOUT: import gpxpy HOOK STDOUT: import staticmaps HOOK STDOUT: HOOK STDOUT: context = staticmaps.Context() HOOK STDOUT: context.set_tile_provider(staticmaps.tile_provider_ArcGISWorldImagery) HOOK STDOUT: HOOK STDOUT: with open(sys.argv[1], "r") as file: HOOK STDOUT: gpx = gpxpy.parse(file) HOOK STDOUT: HOOK STDOUT: for track in gpx.tracks: HOOK STDOUT: for segment in track.segments: HOOK STDOUT: line = [staticmaps.create_latlng(p.latitude, p.longitude) for p in segment.points] HOOK STDOUT: context.add_object(staticmaps.Line(line)) HOOK STDOUT: HOOK STDOUT: for p in gpx.walk(only_points=True): HOOK STDOUT: pos = staticmaps.create_latlng(p.latitude, p.longitude) HOOK STDOUT: marker = staticmaps.ImageMarker(pos, "start.png", origin_x=27, origin_y=35) HOOK STDOUT: context.add_object(marker) HOOK STDOUT: break HOOK STDOUT: HOOK STDOUT: # render non-anti-aliased png HOOK STDOUT: image = context.render_pillow(800, 500) HOOK STDOUT: image.save("draw_gpx.pillow.png") HOOK STDOUT: HOOK STDOUT: # render anti-aliased png (this only works if pycairo is installed) HOOK STDOUT: image = context.render_cairo(800, 500) HOOK STDOUT: image.write_to_png("draw_gpx.cairo.png") HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### US State Capitals HOOK STDOUT: HOOK STDOUT: ```python HOOK STDOUT: import json HOOK STDOUT: import requests HOOK STDOUT: import staticmaps HOOK STDOUT: HOOK STDOUT: context = staticmaps.Context() HOOK STDOUT: context.set_tile_provider(staticmaps.tile_provider_OSM) HOOK STDOUT: HOOK STDOUT: URL = ( HOOK STDOUT: "https://gist.githubusercontent.com/jpriebe/d62a45e29f24e843c974/" HOOK STDOUT: "raw/b1d3066d245e742018bce56e41788ac7afa60e29/us_state_capitals.json" HOOK STDOUT: ) HOOK STDOUT: response = requests.get(URL) HOOK STDOUT: for _, data in json.loads(response.text).items(): HOOK STDOUT: capital = staticmaps.create_latlng(float(data["lat"]), float(data["long"])) HOOK STDOUT: context.add_object(staticmaps.Marker(capital, size=5)) HOOK STDOUT: HOOK STDOUT: # render non-anti-aliased png HOOK STDOUT: image = context.render_pillow(800, 500) HOOK STDOUT: image.save("us_capitals.pillow.png") HOOK STDOUT: HOOK STDOUT: # render anti-aliased png (this only works if pycairo is installed) HOOK STDOUT: image = context.render_cairo(800, 500) HOOK STDOUT: image.write_to_png("us_capitals.cairo.png") HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### Geodesic Circles HOOK STDOUT: HOOK STDOUT: ```python HOOK STDOUT: import staticmaps HOOK STDOUT: HOOK STDOUT: context = staticmaps.Context() HOOK STDOUT: context.set_tile_provider(staticmaps.tile_provider_StamenToner) HOOK STDOUT: HOOK STDOUT: center1 = staticmaps.create_latlng(66, 0) HOOK STDOUT: center2 = staticmaps.create_latlng(0, 0) HOOK STDOUT: HOOK STDOUT: context.add_object(staticmaps.Circle(center1, 2000, fill_color=staticmaps.TRANSPARENT, color=staticmaps.RED, width=2)) HOOK STDOUT: context.add_object(staticmaps.Circle(center2, 2000, fill_color=staticmaps.TRANSPARENT, color=staticmaps.GREEN, width=2)) HOOK STDOUT: context.add_object(staticmaps.Marker(center1, color=staticmaps.RED)) HOOK STDOUT: context.add_object(staticmaps.Marker(center2, color=staticmaps.GREEN)) HOOK STDOUT: HOOK STDOUT: # render non-anti-aliased png HOOK STDOUT: image = context.render_pillow(800, 500) HOOK STDOUT: image.save("geodesic_circles.pillow.png") HOOK STDOUT: HOOK STDOUT: # render anti-aliased png (this only works if pycairo is installed) HOOK STDOUT: image = context.render_cairo(800, 600) HOOK STDOUT: image.write_to_png("geodesic_circles.cairo.png") HOOK STDOUT: ``` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### Other Examples HOOK STDOUT: HOOK STDOUT: Please take a look at the command line program which uses the `staticmaps` package: `staticmaps/cli.py` HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ### Dependencies HOOK STDOUT: HOOK STDOUT: `py-staticmaps` uses HOOK STDOUT: HOOK STDOUT: - `PILLOW` for rendering raster-graphics HOOK STDOUT: - `pycairo` for rendering antialiased raster-graphics (optional!) HOOK STDOUT: - `svgwrite` for writing SVG files HOOK STDOUT: - `s2sphere` for geo coordinates handling HOOK STDOUT: - `geographiclib` for geodesic computations HOOK STDOUT: - `appdirs` for finding the user's default cache directory HOOK STDOUT: - `requests` for downloading tile files HOOK STDOUT: HOOK STDOUT: HOOK STDOUT: ## License HOOK STDOUT: HOOK STDOUT: [MIT](LICENSE) © 2020-2021 Florian Pigorsch HOOK STDOUT: HOOK STDOUT: running dist_info HOOK STDOUT: writing py_staticmaps.egg-info/PKG-INFO HOOK STDOUT: writing dependency_links to py_staticmaps.egg-info/dependency_links.txt HOOK STDOUT: writing entry points to py_staticmaps.egg-info/entry_points.txt HOOK STDOUT: writing requirements to py_staticmaps.egg-info/requires.txt HOOK STDOUT: writing top-level names to py_staticmaps.egg-info/top_level.txt HOOK STDOUT: reading manifest file 'py_staticmaps.egg-info/SOURCES.txt' HOOK STDOUT: reading manifest template 'MANIFEST.in' HOOK STDOUT: adding license file 'LICENSE' HOOK STDOUT: writing manifest file 'py_staticmaps.egg-info/SOURCES.txt' HOOK STDOUT: creating '/builddir/build/BUILD/py-staticmaps-0.4.0/py_staticmaps.dist-info' HOOK STDOUT: adding license file "LICENSE" (matched pattern "LICEN[CS]E*") Handling appdirs from wheel metadata: Requires-Dist Requirement satisfied: appdirs (installed: appdirs 1.4.4) Handling geographiclib from wheel metadata: Requires-Dist Requirement satisfied: geographiclib (installed: geographiclib 1.52) Handling PILLOW from wheel metadata: Requires-Dist Requirement satisfied: PILLOW (installed: PILLOW 8.4.0) Handling python-slugify from wheel metadata: Requires-Dist Requirement satisfied: python-slugify (installed: python-slugify 5.0.2) Handling requests from wheel metadata: Requires-Dist Requirement satisfied: requests (installed: requests 2.26.0) Handling s2sphere from wheel metadata: Requires-Dist Requirement satisfied: s2sphere (installed: s2sphere 0.2.5) Handling svgwrite from wheel metadata: Requires-Dist Requirement satisfied: svgwrite (installed: svgwrite 1.4.1) Handling pycairo ; extra == 'cairo' from wheel metadata: Requires-Dist Ignoring alien requirement: pycairo ; extra == 'cairo' Handling black ; extra == 'dev' from wheel metadata: Requires-Dist Ignoring alien requirement: black ; extra == 'dev' Handling flake8 ; extra == 'dev' from wheel metadata: Requires-Dist Ignoring alien requirement: flake8 ; extra == 'dev' Handling mypy ; extra == 'dev' from wheel metadata: Requires-Dist Ignoring alien requirement: mypy ; extra == 'dev' Handling pylint ; extra == 'dev' from wheel metadata: Requires-Dist Ignoring alien requirement: pylint ; extra == 'dev' Handling pytest ; extra == 'dev' from wheel metadata: Requires-Dist Ignoring alien requirement: pytest ; extra == 'dev' Handling twine ; extra == 'dev' from wheel metadata: Requires-Dist Ignoring alien requirement: twine ; extra == 'dev' Handling gpxpy ; extra == 'examples' from wheel metadata: Requires-Dist Ignoring alien requirement: gpxpy ; extra == 'examples' + RPM_EC=0 ++ jobs -p + exit 0 Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.jXjhbj + umask 022 + cd /builddir/build/BUILD + cd py-staticmaps-0.4.0 + mkdir -p /builddir/build/BUILD/py-staticmaps-0.4.0/.pyproject-builddir + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1' + TMPDIR=/builddir/build/BUILD/py-staticmaps-0.4.0/.pyproject-builddir + /usr/bin/python3 -m pip wheel --wheel-dir /builddir/build/BUILD/py-staticmaps-0.4.0/pyproject-wheeldir --no-deps --use-pep517 --no-build-isolation --disable-pip-version-check --no-clean --progress-bar off --verbose . Processing /builddir/build/BUILD/py-staticmaps-0.4.0 Preparing metadata (pyproject.toml): started Running command /usr/bin/python3 /usr/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /builddir/build/BUILD/py-staticmaps-0.4.0/.pyproject-builddir/tmp65yq0fi2 # py-staticmaps A python module to create static map images (PNG, SVG) with markers, geodesic lines, etc. ## Features - Map objects: pin-style markers, image (PNG) markers, polylines, polygons, (geodesic) circles - Automatic computation of best center + zoom from the added map objects - Several pre-configured map tile providers - Proper tile provider attributions display - On-disc caching of map tile images for faster drawing and reduced load on the tile servers - Non-anti-aliased drawing via `PILLOW` - Anti-aliased drawing via `pycairo` (optional; only if `pycairo` is installed properly) - SVG creation via `svgwrite` ## Installation ### SVG + non-anti-aliased PNG version ```shell pip install py-staticmaps ``` ### SVG + anti-aliased PNG version (via Cairo) ```shell pip install py-staticmaps[cairo] ``` `py-staticmaps` uses `pycairo` for creating anti-aliased raster-graphics, so make sure `libcairo2` is installed on your system (on Ubuntu just install the `libcairo2-dev` package, i.e. `sudo apt install libcairo2-dev`). ## Examples Note: PNG support (e.g. `context.render_cairo(...)`) is only available if the `pycairo` module is installed. ### Markers and Geodesic Lines ```python import staticmaps context = staticmaps.Context() context.set_tile_provider(staticmaps.tile_provider_StamenToner) frankfurt = staticmaps.create_latlng(50.110644, 8.682092) newyork = staticmaps.create_latlng(40.712728, -74.006015) context.add_object(staticmaps.Line([frankfurt, newyork], color=staticmaps.BLUE, width=4)) context.add_object(staticmaps.Marker(frankfurt, color=staticmaps.GREEN, size=12)) context.add_object(staticmaps.Marker(newyork, color=staticmaps.RED, size=12)) # render non-anti-aliased png image = context.render_pillow(800, 500) image.save("frankfurt_newyork.pillow.png") # render anti-aliased png (this only works if pycairo is installed) image = context.render_cairo(800, 500) image.write_to_png("frankfurt_newyork.cairo.png") # render svg svg_image = context.render_svg(800, 500) with open("frankfurt_newyork.svg", "w", encoding="utf-8") as f: svg_image.write(f, pretty=True) ``` ### Transparent Polygons ```python import staticmaps context = staticmaps.Context() context.set_tile_provider(staticmaps.tile_provider_OSM) freiburg_polygon = [ (47.96881, 7.79045), (47.96866, 7.78610), (47.97134, 7.77874), ... ] context.add_object( staticmaps.Area( [staticmaps.create_latlng(lat, lng) for lat, lng in freiburg_polygon], fill_color=staticmaps.parse_color("#00FF003F"), width=2, color=staticmaps.BLUE, ) ) # render non-anti-aliased png image = context.render_pillow(800, 500) image.save("freiburg_area.pillow.png") # render anti-aliased png (this only works if pycairo is installed) image = context.render_cairo(800, 500) image.write_to_png("freiburg_area.cairo.png") # render svg svg_image = context.render_svg(800, 500) with open("freiburg_area.svg", "w", encoding="utf-8") as f: svg_image.write(f, pretty=True) ``` ### Drawing a GPX Track + Image Marker (PNG) ```python import sys import gpxpy import staticmaps context = staticmaps.Context() context.set_tile_provider(staticmaps.tile_provider_ArcGISWorldImagery) with open(sys.argv[1], "r") as file: gpx = gpxpy.parse(file) for track in gpx.tracks: for segment in track.segments: line = [staticmaps.create_latlng(p.latitude, p.longitude) for p in segment.points] context.add_object(staticmaps.Line(line)) for p in gpx.walk(only_points=True): pos = staticmaps.create_latlng(p.latitude, p.longitude) marker = staticmaps.ImageMarker(pos, "start.png", origin_x=27, origin_y=35) context.add_object(marker) break # render non-anti-aliased png image = context.render_pillow(800, 500) image.save("draw_gpx.pillow.png") # render anti-aliased png (this only works if pycairo is installed) image = context.render_cairo(800, 500) image.write_to_png("draw_gpx.cairo.png") ``` ### US State Capitals ```python import json import requests import staticmaps context = staticmaps.Context() context.set_tile_provider(staticmaps.tile_provider_OSM) URL = ( "https://gist.githubusercontent.com/jpriebe/d62a45e29f24e843c974/" "raw/b1d3066d245e742018bce56e41788ac7afa60e29/us_state_capitals.json" ) response = requests.get(URL) for _, data in json.loads(response.text).items(): capital = staticmaps.create_latlng(float(data["lat"]), float(data["long"])) context.add_object(staticmaps.Marker(capital, size=5)) # render non-anti-aliased png image = context.render_pillow(800, 500) image.save("us_capitals.pillow.png") # render anti-aliased png (this only works if pycairo is installed) image = context.render_cairo(800, 500) image.write_to_png("us_capitals.cairo.png") ``` ### Geodesic Circles ```python import staticmaps context = staticmaps.Context() context.set_tile_provider(staticmaps.tile_provider_StamenToner) center1 = staticmaps.create_latlng(66, 0) center2 = staticmaps.create_latlng(0, 0) context.add_object(staticmaps.Circle(center1, 2000, fill_color=staticmaps.TRANSPARENT, color=staticmaps.RED, width=2)) context.add_object(staticmaps.Circle(center2, 2000, fill_color=staticmaps.TRANSPARENT, color=staticmaps.GREEN, width=2)) context.add_object(staticmaps.Marker(center1, color=staticmaps.RED)) context.add_object(staticmaps.Marker(center2, color=staticmaps.GREEN)) # render non-anti-aliased png image = context.render_pillow(800, 500) image.save("geodesic_circles.pillow.png") # render anti-aliased png (this only works if pycairo is installed) image = context.render_cairo(800, 600) image.write_to_png("geodesic_circles.cairo.png") ``` ### Other Examples Please take a look at the command line program which uses the `staticmaps` package: `staticmaps/cli.py` ### Dependencies `py-staticmaps` uses - `PILLOW` for rendering raster-graphics - `pycairo` for rendering antialiased raster-graphics (optional!) - `svgwrite` for writing SVG files - `s2sphere` for geo coordinates handling - `geographiclib` for geodesic computations - `appdirs` for finding the user's default cache directory - `requests` for downloading tile files ## License [MIT](LICENSE) © 2020-2021 Florian Pigorsch running dist_info creating /builddir/build/BUILD/py-staticmaps-0.4.0/.pyproject-builddir/pip-modern-metadata-7a53x7wr/py_staticmaps.egg-info writing /builddir/build/BUILD/py-staticmaps-0.4.0/.pyproject-builddir/pip-modern-metadata-7a53x7wr/py_staticmaps.egg-info/PKG-INFO writing dependency_links to /builddir/build/BUILD/py-staticmaps-0.4.0/.pyproject-builddir/pip-modern-metadata-7a53x7wr/py_staticmaps.egg-info/dependency_links.txt writing entry points to /builddir/build/BUILD/py-staticmaps-0.4.0/.pyproject-builddir/pip-modern-metadata-7a53x7wr/py_staticmaps.egg-info/entry_points.txt writing requirements to /builddir/build/BUILD/py-staticmaps-0.4.0/.pyproject-builddir/pip-modern-metadata-7a53x7wr/py_staticmaps.egg-info/requires.txt writing top-level names to /builddir/build/BUILD/py-staticmaps-0.4.0/.pyproject-builddir/pip-modern-metadata-7a53x7wr/py_staticmaps.egg-info/top_level.txt writing manifest file '/builddir/build/BUILD/py-staticmaps-0.4.0/.pyproject-builddir/pip-modern-metadata-7a53x7wr/py_staticmaps.egg-info/SOURCES.txt' reading manifest file '/builddir/build/BUILD/py-staticmaps-0.4.0/.pyproject-builddir/pip-modern-metadata-7a53x7wr/py_staticmaps.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files matching '__pycache__' found under directory '*' warning: no previously-included files matching '*.py[co]' found under directory '*' adding license file 'LICENSE' writing manifest file '/builddir/build/BUILD/py-staticmaps-0.4.0/.pyproject-builddir/pip-modern-metadata-7a53x7wr/py_staticmaps.egg-info/SOURCES.txt' creating '/builddir/build/BUILD/py-staticmaps-0.4.0/.pyproject-builddir/pip-modern-metadata-7a53x7wr/py_staticmaps.dist-info' adding license file "LICENSE" (matched pattern "LICEN[CS]E*") Preparing metadata (pyproject.toml): finished with status 'done' Building wheels for collected packages: py-staticmaps Building wheel for py-staticmaps (pyproject.toml): started Running command /usr/bin/python3 /usr/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /builddir/build/BUILD/py-staticmaps-0.4.0/.pyproject-builddir/tmp61cpx8kz # py-staticmaps A python module to create static map images (PNG, SVG) with markers, geodesic lines, etc. ## Features - Map objects: pin-style markers, image (PNG) markers, polylines, polygons, (geodesic) circles - Automatic computation of best center + zoom from the added map objects - Several pre-configured map tile providers - Proper tile provider attributions display - On-disc caching of map tile images for faster drawing and reduced load on the tile servers - Non-anti-aliased drawing via `PILLOW` - Anti-aliased drawing via `pycairo` (optional; only if `pycairo` is installed properly) - SVG creation via `svgwrite` ## Installation ### SVG + non-anti-aliased PNG version ```shell pip install py-staticmaps ``` ### SVG + anti-aliased PNG version (via Cairo) ```shell pip install py-staticmaps[cairo] ``` `py-staticmaps` uses `pycairo` for creating anti-aliased raster-graphics, so make sure `libcairo2` is installed on your system (on Ubuntu just install the `libcairo2-dev` package, i.e. `sudo apt install libcairo2-dev`). ## Examples Note: PNG support (e.g. `context.render_cairo(...)`) is only available if the `pycairo` module is installed. ### Markers and Geodesic Lines ```python import staticmaps context = staticmaps.Context() context.set_tile_provider(staticmaps.tile_provider_StamenToner) frankfurt = staticmaps.create_latlng(50.110644, 8.682092) newyork = staticmaps.create_latlng(40.712728, -74.006015) context.add_object(staticmaps.Line([frankfurt, newyork], color=staticmaps.BLUE, width=4)) context.add_object(staticmaps.Marker(frankfurt, color=staticmaps.GREEN, size=12)) context.add_object(staticmaps.Marker(newyork, color=staticmaps.RED, size=12)) # render non-anti-aliased png image = context.render_pillow(800, 500) image.save("frankfurt_newyork.pillow.png") # render anti-aliased png (this only works if pycairo is installed) image = context.render_cairo(800, 500) image.write_to_png("frankfurt_newyork.cairo.png") # render svg svg_image = context.render_svg(800, 500) with open("frankfurt_newyork.svg", "w", encoding="utf-8") as f: svg_image.write(f, pretty=True) ``` ### Transparent Polygons ```python import staticmaps context = staticmaps.Context() context.set_tile_provider(staticmaps.tile_provider_OSM) freiburg_polygon = [ (47.96881, 7.79045), (47.96866, 7.78610), (47.97134, 7.77874), ... ] context.add_object( staticmaps.Area( [staticmaps.create_latlng(lat, lng) for lat, lng in freiburg_polygon], fill_color=staticmaps.parse_color("#00FF003F"), width=2, color=staticmaps.BLUE, ) ) # render non-anti-aliased png image = context.render_pillow(800, 500) image.save("freiburg_area.pillow.png") # render anti-aliased png (this only works if pycairo is installed) image = context.render_cairo(800, 500) image.write_to_png("freiburg_area.cairo.png") # render svg svg_image = context.render_svg(800, 500) with open("freiburg_area.svg", "w", encoding="utf-8") as f: svg_image.write(f, pretty=True) ``` ### Drawing a GPX Track + Image Marker (PNG) ```python import sys import gpxpy import staticmaps context = staticmaps.Context() context.set_tile_provider(staticmaps.tile_provider_ArcGISWorldImagery) with open(sys.argv[1], "r") as file: gpx = gpxpy.parse(file) for track in gpx.tracks: for segment in track.segments: line = [staticmaps.create_latlng(p.latitude, p.longitude) for p in segment.points] context.add_object(staticmaps.Line(line)) for p in gpx.walk(only_points=True): pos = staticmaps.create_latlng(p.latitude, p.longitude) marker = staticmaps.ImageMarker(pos, "start.png", origin_x=27, origin_y=35) context.add_object(marker) break # render non-anti-aliased png image = context.render_pillow(800, 500) image.save("draw_gpx.pillow.png") # render anti-aliased png (this only works if pycairo is installed) image = context.render_cairo(800, 500) image.write_to_png("draw_gpx.cairo.png") ``` ### US State Capitals ```python import json import requests import staticmaps context = staticmaps.Context() context.set_tile_provider(staticmaps.tile_provider_OSM) URL = ( "https://gist.githubusercontent.com/jpriebe/d62a45e29f24e843c974/" "raw/b1d3066d245e742018bce56e41788ac7afa60e29/us_state_capitals.json" ) response = requests.get(URL) for _, data in json.loads(response.text).items(): capital = staticmaps.create_latlng(float(data["lat"]), float(data["long"])) context.add_object(staticmaps.Marker(capital, size=5)) # render non-anti-aliased png image = context.render_pillow(800, 500) image.save("us_capitals.pillow.png") # render anti-aliased png (this only works if pycairo is installed) image = context.render_cairo(800, 500) image.write_to_png("us_capitals.cairo.png") ``` ### Geodesic Circles ```python import staticmaps context = staticmaps.Context() context.set_tile_provider(staticmaps.tile_provider_StamenToner) center1 = staticmaps.create_latlng(66, 0) center2 = staticmaps.create_latlng(0, 0) context.add_object(staticmaps.Circle(center1, 2000, fill_color=staticmaps.TRANSPARENT, color=staticmaps.RED, width=2)) context.add_object(staticmaps.Circle(center2, 2000, fill_color=staticmaps.TRANSPARENT, color=staticmaps.GREEN, width=2)) context.add_object(staticmaps.Marker(center1, color=staticmaps.RED)) context.add_object(staticmaps.Marker(center2, color=staticmaps.GREEN)) # render non-anti-aliased png image = context.render_pillow(800, 500) image.save("geodesic_circles.pillow.png") # render anti-aliased png (this only works if pycairo is installed) image = context.render_cairo(800, 600) image.write_to_png("geodesic_circles.cairo.png") ``` ### Other Examples Please take a look at the command line program which uses the `staticmaps` package: `staticmaps/cli.py` ### Dependencies `py-staticmaps` uses - `PILLOW` for rendering raster-graphics - `pycairo` for rendering antialiased raster-graphics (optional!) - `svgwrite` for writing SVG files - `s2sphere` for geo coordinates handling - `geographiclib` for geodesic computations - `appdirs` for finding the user's default cache directory - `requests` for downloading tile files ## License [MIT](LICENSE) © 2020-2021 Florian Pigorsch running bdist_wheel running build running build_py creating build creating build/lib creating build/lib/staticmaps copying staticmaps/transformer.py -> build/lib/staticmaps copying staticmaps/tile_provider.py -> build/lib/staticmaps copying staticmaps/tile_downloader.py -> build/lib/staticmaps copying staticmaps/svg_renderer.py -> build/lib/staticmaps copying staticmaps/renderer.py -> build/lib/staticmaps copying staticmaps/pillow_renderer.py -> build/lib/staticmaps copying staticmaps/object.py -> build/lib/staticmaps copying staticmaps/meta.py -> build/lib/staticmaps copying staticmaps/marker.py -> build/lib/staticmaps copying staticmaps/line.py -> build/lib/staticmaps copying staticmaps/image_marker.py -> build/lib/staticmaps copying staticmaps/coordinates.py -> build/lib/staticmaps copying staticmaps/context.py -> build/lib/staticmaps copying staticmaps/color.py -> build/lib/staticmaps copying staticmaps/cli.py -> build/lib/staticmaps copying staticmaps/circle.py -> build/lib/staticmaps copying staticmaps/cairo_renderer.py -> build/lib/staticmaps copying staticmaps/area.py -> build/lib/staticmaps copying staticmaps/__init__.py -> build/lib/staticmaps installing to build/bdist.linux-x86_64/wheel running install running install_lib creating build/bdist.linux-x86_64 creating build/bdist.linux-x86_64/wheel creating build/bdist.linux-x86_64/wheel/staticmaps copying build/lib/staticmaps/__init__.py -> build/bdist.linux-x86_64/wheel/staticmaps copying build/lib/staticmaps/area.py -> build/bdist.linux-x86_64/wheel/staticmaps copying build/lib/staticmaps/cairo_renderer.py -> build/bdist.linux-x86_64/wheel/staticmaps copying build/lib/staticmaps/circle.py -> build/bdist.linux-x86_64/wheel/staticmaps copying build/lib/staticmaps/cli.py -> build/bdist.linux-x86_64/wheel/staticmaps copying build/lib/staticmaps/color.py -> build/bdist.linux-x86_64/wheel/staticmaps copying build/lib/staticmaps/context.py -> build/bdist.linux-x86_64/wheel/staticmaps copying build/lib/staticmaps/coordinates.py -> build/bdist.linux-x86_64/wheel/staticmaps copying build/lib/staticmaps/image_marker.py -> build/bdist.linux-x86_64/wheel/staticmaps copying build/lib/staticmaps/line.py -> build/bdist.linux-x86_64/wheel/staticmaps copying build/lib/staticmaps/marker.py -> build/bdist.linux-x86_64/wheel/staticmaps copying build/lib/staticmaps/meta.py -> build/bdist.linux-x86_64/wheel/staticmaps copying build/lib/staticmaps/object.py -> build/bdist.linux-x86_64/wheel/staticmaps copying build/lib/staticmaps/pillow_renderer.py -> build/bdist.linux-x86_64/wheel/staticmaps copying build/lib/staticmaps/renderer.py -> build/bdist.linux-x86_64/wheel/staticmaps copying build/lib/staticmaps/svg_renderer.py -> build/bdist.linux-x86_64/wheel/staticmaps copying build/lib/staticmaps/tile_downloader.py -> build/bdist.linux-x86_64/wheel/staticmaps copying build/lib/staticmaps/tile_provider.py -> build/bdist.linux-x86_64/wheel/staticmaps copying build/lib/staticmaps/transformer.py -> build/bdist.linux-x86_64/wheel/staticmaps running install_egg_info running egg_info creating py_staticmaps.egg-info writing py_staticmaps.egg-info/PKG-INFO writing dependency_links to py_staticmaps.egg-info/dependency_links.txt writing entry points to py_staticmaps.egg-info/entry_points.txt writing requirements to py_staticmaps.egg-info/requires.txt writing top-level names to py_staticmaps.egg-info/top_level.txt writing manifest file 'py_staticmaps.egg-info/SOURCES.txt' reading manifest file 'py_staticmaps.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files matching '__pycache__' found under directory '*' warning: no previously-included files matching '*.py[co]' found under directory '*' adding license file 'LICENSE' writing manifest file 'py_staticmaps.egg-info/SOURCES.txt' Copying py_staticmaps.egg-info to build/bdist.linux-x86_64/wheel/py_staticmaps-0.4.0-py3.10.egg-info running install_scripts adding license file "LICENSE" (matched pattern "LICEN[CS]E*") creating build/bdist.linux-x86_64/wheel/py_staticmaps-0.4.0.dist-info/WHEEL creating '/builddir/build/BUILD/py-staticmaps-0.4.0/.pyproject-builddir/pip-wheel-vv5kay_5/tmpjo0iuyqj/py_staticmaps-0.4.0-py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it adding 'staticmaps/__init__.py' adding 'staticmaps/area.py' adding 'staticmaps/cairo_renderer.py' adding 'staticmaps/circle.py' adding 'staticmaps/cli.py' adding 'staticmaps/color.py' adding 'staticmaps/context.py' adding 'staticmaps/coordinates.py' adding 'staticmaps/image_marker.py' adding 'staticmaps/line.py' adding 'staticmaps/marker.py' adding 'staticmaps/meta.py' adding 'staticmaps/object.py' adding 'staticmaps/pillow_renderer.py' adding 'staticmaps/renderer.py' adding 'staticmaps/svg_renderer.py' adding 'staticmaps/tile_downloader.py' adding 'staticmaps/tile_provider.py' adding 'staticmaps/transformer.py' adding 'py_staticmaps-0.4.0.dist-info/LICENSE' adding 'py_staticmaps-0.4.0.dist-info/METADATA' adding 'py_staticmaps-0.4.0.dist-info/WHEEL' adding 'py_staticmaps-0.4.0.dist-info/entry_points.txt' adding 'py_staticmaps-0.4.0.dist-info/top_level.txt' adding 'py_staticmaps-0.4.0.dist-info/RECORD' removing build/bdist.linux-x86_64/wheel Building wheel for py-staticmaps (pyproject.toml): finished with status 'done' Created wheel for py-staticmaps: filename=py_staticmaps-0.4.0-py3-none-any.whl size=29631 sha256=f9c9a3f97553db52bb2aa563d6e31291c45e23fda1935abb14607c789c34739b Stored in directory: /builddir/.cache/pip/wheels/9c/e8/e0/41a662af0517ae66521a2b4c24df59201dbdc6a3d6f4c3de6a Successfully built py-staticmaps + RPM_EC=0 ++ jobs -p + exit 0 Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.wAQOdh + umask 022 + cd /builddir/build/BUILD + '[' /builddir/build/BUILDROOT/python-py-staticmaps-0.4.0-1.fc36.x86_64 '!=' / ']' + rm -rf /builddir/build/BUILDROOT/python-py-staticmaps-0.4.0-1.fc36.x86_64 ++ dirname /builddir/build/BUILDROOT/python-py-staticmaps-0.4.0-1.fc36.x86_64 + mkdir -p /builddir/build/BUILDROOT + mkdir /builddir/build/BUILDROOT/python-py-staticmaps-0.4.0-1.fc36.x86_64 + cd py-staticmaps-0.4.0 ++ ls /builddir/build/BUILD/py-staticmaps-0.4.0/pyproject-wheeldir/py_staticmaps-0.4.0-py3-none-any.whl ++ sed -E 's/([^-]+)-([^-]+)-.+\.whl/\1==\2/' ++ xargs basename --multiple + specifier=py_staticmaps==0.4.0 + TMPDIR=/builddir/build/BUILD/py-staticmaps-0.4.0/.pyproject-builddir + /usr/bin/python3 -m pip install --root /builddir/build/BUILDROOT/python-py-staticmaps-0.4.0-1.fc36.x86_64 --no-deps --disable-pip-version-check --progress-bar off --verbose --ignore-installed --no-warn-script-location --no-index --no-cache-dir --find-links /builddir/build/BUILD/py-staticmaps-0.4.0/pyproject-wheeldir py_staticmaps==0.4.0 Using pip 21.3.1 from /usr/lib/python3.10/site-packages/pip (python 3.10) Looking in links: /builddir/build/BUILD/py-staticmaps-0.4.0/pyproject-wheeldir Processing ./pyproject-wheeldir/py_staticmaps-0.4.0-py3-none-any.whl Installing collected packages: py-staticmaps Creating /builddir/build/BUILDROOT/python-py-staticmaps-0.4.0-1.fc36.x86_64/usr/bin changing mode of /builddir/build/BUILDROOT/python-py-staticmaps-0.4.0-1.fc36.x86_64/usr/bin/createstaticmap to 755 Successfully installed py-staticmaps-0.4.0 + '[' -d /builddir/build/BUILDROOT/python-py-staticmaps-0.4.0-1.fc36.x86_64/usr/bin ']' + '[' -f /usr/bin/pathfix3.10.py ']' + pathfix=/usr/bin/pathfix3.10.py + '[' -z s ']' + shebang_flags=-kas + /usr/bin/pathfix3.10.py -pni /usr/bin/python3 -kas /builddir/build/BUILDROOT/python-py-staticmaps-0.4.0-1.fc36.x86_64/usr/bin/createstaticmap /builddir/build/BUILDROOT/python-py-staticmaps-0.4.0-1.fc36.x86_64/usr/bin/createstaticmap: updating + rm -rfv /builddir/build/BUILDROOT/python-py-staticmaps-0.4.0-1.fc36.x86_64/usr/bin/__pycache__ + rm -f /builddir/build/BUILD/pyproject-ghost-distinfo + site_dirs=() + '[' -d /builddir/build/BUILDROOT/python-py-staticmaps-0.4.0-1.fc36.x86_64/usr/lib/python3.10/site-packages ']' + site_dirs+=("/usr/lib/python3.10/site-packages") + '[' /builddir/build/BUILDROOT/python-py-staticmaps-0.4.0-1.fc36.x86_64/usr/lib64/python3.10/site-packages '!=' /builddir/build/BUILDROOT/python-py-staticmaps-0.4.0-1.fc36.x86_64/usr/lib/python3.10/site-packages ']' + '[' -d /builddir/build/BUILDROOT/python-py-staticmaps-0.4.0-1.fc36.x86_64/usr/lib64/python3.10/site-packages ']' + for site_dir in ${site_dirs[@]} + for distinfo in /builddir/build/BUILDROOT/python-py-staticmaps-0.4.0-1.fc36.x86_64$site_dir/*.dist-info + echo '%ghost /usr/lib/python3.10/site-packages/py_staticmaps-0.4.0.dist-info' + sed -i s/pip/rpm/ /builddir/build/BUILDROOT/python-py-staticmaps-0.4.0-1.fc36.x86_64/usr/lib/python3.10/site-packages/py_staticmaps-0.4.0.dist-info/INSTALLER + PYTHONPATH=/usr/lib/rpm/redhat + /usr/bin/python3 -B /usr/lib/rpm/redhat/pyproject_preprocess_record.py --buildroot /builddir/build/BUILDROOT/python-py-staticmaps-0.4.0-1.fc36.x86_64 --record /builddir/build/BUILDROOT/python-py-staticmaps-0.4.0-1.fc36.x86_64/usr/lib/python3.10/site-packages/py_staticmaps-0.4.0.dist-info/RECORD --output /builddir/build/BUILD/pyproject-record + rm -fv /builddir/build/BUILDROOT/python-py-staticmaps-0.4.0-1.fc36.x86_64/usr/lib/python3.10/site-packages/py_staticmaps-0.4.0.dist-info/RECORD removed '/builddir/build/BUILDROOT/python-py-staticmaps-0.4.0-1.fc36.x86_64/usr/lib/python3.10/site-packages/py_staticmaps-0.4.0.dist-info/RECORD' + rm -fv /builddir/build/BUILDROOT/python-py-staticmaps-0.4.0-1.fc36.x86_64/usr/lib/python3.10/site-packages/py_staticmaps-0.4.0.dist-info/REQUESTED removed '/builddir/build/BUILDROOT/python-py-staticmaps-0.4.0-1.fc36.x86_64/usr/lib/python3.10/site-packages/py_staticmaps-0.4.0.dist-info/REQUESTED' ++ wc -l /builddir/build/BUILD/pyproject-ghost-distinfo ++ cut -f1 '-d ' + lines=1 + '[' 1 -ne 1 ']' + /usr/bin/python3 /usr/lib/rpm/redhat/pyproject_save_files.py --output-files /builddir/build/BUILD/pyproject-files --output-modules /builddir/build/BUILD/pyproject-modules --buildroot /builddir/build/BUILDROOT/python-py-staticmaps-0.4.0-1.fc36.x86_64 --sitelib /usr/lib/python3.10/site-packages --sitearch /usr/lib64/python3.10/site-packages --python-version 3.10 --pyproject-record /builddir/build/BUILD/pyproject-record '*' +auto + /usr/bin/find-debuginfo -j2 --strict-build-id -m -i --build-id-seed 0.4.0-1.fc36 --unique-debug-suffix -0.4.0-1.fc36.x86_64 --unique-debug-src-base python-py-staticmaps-0.4.0-1.fc36.x86_64 --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 110000000 -S debugsourcefiles.list /builddir/build/BUILD/py-staticmaps-0.4.0 find: 'debug': No such file or directory + /usr/lib/rpm/check-buildroot + /usr/lib/rpm/redhat/brp-ldconfig + /usr/lib/rpm/brp-compress + /usr/lib/rpm/redhat/brp-strip-lto /usr/bin/strip + /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip + /usr/lib/rpm/check-rpaths + /usr/lib/rpm/redhat/brp-mangle-shebangs + /usr/lib/rpm/redhat/brp-python-bytecompile '' 1 0 Bytecompiling .py files below /builddir/build/BUILDROOT/python-py-staticmaps-0.4.0-1.fc36.x86_64/usr/lib/python3.10 using python3.10 + /usr/lib/rpm/redhat/brp-python-hardlink Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.VtlwNA + umask 022 + cd /builddir/build/BUILD + cd py-staticmaps-0.4.0 + '[' '!' -f /builddir/build/BUILD/pyproject-modules ']' + PATH=/builddir/build/BUILDROOT/python-py-staticmaps-0.4.0-1.fc36.x86_64/usr/bin:/builddir/.local/bin:/builddir/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin + PYTHONPATH=/builddir/build/BUILDROOT/python-py-staticmaps-0.4.0-1.fc36.x86_64/usr/lib64/python3.10/site-packages:/builddir/build/BUILDROOT/python-py-staticmaps-0.4.0-1.fc36.x86_64/usr/lib/python3.10/site-packages + _PYTHONSITE=/builddir/build/BUILDROOT/python-py-staticmaps-0.4.0-1.fc36.x86_64/usr/lib64/python3.10/site-packages:/builddir/build/BUILDROOT/python-py-staticmaps-0.4.0-1.fc36.x86_64/usr/lib/python3.10/site-packages + PYTHONDONTWRITEBYTECODE=1 + /usr/bin/python3 -s /usr/lib/rpm/redhat/import_all_modules.py -f /builddir/build/BUILD/pyproject-modules -t Check import: staticmaps + RPM_EC=0 ++ jobs -p + exit 0 Processing files: python3-py-staticmaps-0.4.0-1.fc36.noarch Provides: python-py-staticmaps = 0.4.0-1.fc36 python3-py-staticmaps = 0.4.0-1.fc36 python3.10-py-staticmaps = 0.4.0-1.fc36 python3.10dist(py-staticmaps) = 0.4 python3dist(py-staticmaps) = 0.4 Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PartialHardlinkSets) <= 4.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 Requires: /usr/bin/python3 python(abi) = 3.10 python3.10dist(appdirs) python3.10dist(geographiclib) python3.10dist(pillow) python3.10dist(python-slugify) python3.10dist(requests) python3.10dist(s2sphere) python3.10dist(svgwrite) Checking for unpackaged file(s): /usr/lib/rpm/check-files /builddir/build/BUILDROOT/python-py-staticmaps-0.4.0-1.fc36.x86_64 Wrote: /builddir/build/SRPMS/python-py-staticmaps-0.4.0-1.fc36.src.rpm Wrote: /builddir/build/RPMS/python3-py-staticmaps-0.4.0-1.fc36.noarch.rpm Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.ZRdfWo + umask 022 + cd /builddir/build/BUILD + cd py-staticmaps-0.4.0 + /usr/bin/rm -rf /builddir/build/BUILDROOT/python-py-staticmaps-0.4.0-1.fc36.x86_64 + RPM_EC=0 ++ jobs -p + exit 0 Child return code was: 0