2020-12-30T17:22:10,692 Created temporary directory: /tmp/pip-ephem-wheel-cache-_f5p63ei 2020-12-30T17:22:10,695 Created temporary directory: /tmp/pip-req-tracker-kzqijqio 2020-12-30T17:22:10,696 Initialized build tracking at /tmp/pip-req-tracker-kzqijqio 2020-12-30T17:22:10,696 Created build tracker: /tmp/pip-req-tracker-kzqijqio 2020-12-30T17:22:10,696 Entered build tracker: /tmp/pip-req-tracker-kzqijqio 2020-12-30T17:22:10,697 Created temporary directory: /tmp/pip-wheel-w44jup93 2020-12-30T17:22:10,708 1 location(s) to search for versions of py-staticmaps: 2020-12-30T17:22:10,708 * https://pypi.org/simple/py-staticmaps/ 2020-12-30T17:22:10,708 Fetching project page and analyzing links: https://pypi.org/simple/py-staticmaps/ 2020-12-30T17:22:10,709 Getting page https://pypi.org/simple/py-staticmaps/ 2020-12-30T17:22:10,710 Found index url https://pypi.org/simple 2020-12-30T17:22:11,104 Found link https://files.pythonhosted.org/packages/c1/37/92e15225fa11747d61ad303391a6f4a37f24ef272cfee63e712b0cf080e7/py-staticmaps-0.0.1.tar.gz#sha256=71d68975dd0443f6b925eb55f4203671bd84e565e4e8cba3ee1afb94efb46a98 (from https://pypi.org/simple/py-staticmaps/), version: 0.0.1 2020-12-30T17:22:11,104 Found link https://files.pythonhosted.org/packages/a1/98/00d2f6057cf2f541ccf796f5a3847713e9dc51251d7d4554f9caad338d47/py-staticmaps-0.0.2.tar.gz#sha256=cfed70f9b0a2c8130ad4ee73c709763dbae570f75ca038aec8d0242778c7be4f (from https://pypi.org/simple/py-staticmaps/), version: 0.0.2 2020-12-30T17:22:11,104 Found link https://files.pythonhosted.org/packages/e0/53/00551e1cfb8612c4dc0b6e76c7ed776513155245586799d789e4379c3f35/py-staticmaps-0.1.0.tar.gz#sha256=a500406520db2a2754d71824b1b14da5d5eac3731d6059108c686ca9fbf08568 (from https://pypi.org/simple/py-staticmaps/), version: 0.1.0 2020-12-30T17:22:11,105 Found link https://files.pythonhosted.org/packages/c8/cf/d25eb225616779dcec60a5f57f858e0437ac67e8dab8bb97635e02407167/py-staticmaps-0.1.1.tar.gz#sha256=0efe19b1f3bf35283d9aaa0f485bf5f56d9c97c71e5a8ae9190f3ef452bd7bc6 (from https://pypi.org/simple/py-staticmaps/), version: 0.1.1 2020-12-30T17:22:11,105 Found link https://files.pythonhosted.org/packages/92/12/9014b674db3a0a17fe7317d051644bd4a5243f222bc8fa9ab9f3bcc8d330/py-staticmaps-0.2.0.tar.gz#sha256=9043c59e27d419c75e6a8ccdd55d844a20071b796e9dab2ae904fe29c2b1c3bf (from https://pypi.org/simple/py-staticmaps/), version: 0.2.0 2020-12-30T17:22:11,105 Found link https://files.pythonhosted.org/packages/8f/e2/28896c344c786088c7d7ca18f4cf95e3491a37a010f44e398df38224b274/py-staticmaps-0.2.2.tar.gz#sha256=adabc734cbe0ccf904cab17c64b838b83f6264098f9fa39e84c567e4576ffabe (from https://pypi.org/simple/py-staticmaps/), version: 0.2.2 2020-12-30T17:22:11,106 Found link https://files.pythonhosted.org/packages/03/1e/a86e19c1efd133e21d8b541359a15592807d128582147f89539da6529cab/py-staticmaps-0.2.3.tar.gz#sha256=ea54d361350bae1ba7ec2f94389e4582e177fdf6d1d8d37594249d834edf6029 (from https://pypi.org/simple/py-staticmaps/), version: 0.2.3 2020-12-30T17:22:11,110 Given no hashes to check 1 links for project 'py-staticmaps': discarding no candidates 2020-12-30T17:22:11,111 Using version 0.2.3 (newest of versions: 0.2.3) 2020-12-30T17:22:11,115 Collecting py-staticmaps==0.2.3 2020-12-30T17:22:11,117 Created temporary directory: /tmp/pip-unpack-a_0rof_8 2020-12-30T17:22:11,182 Downloading py-staticmaps-0.2.3.tar.gz (15 kB) 2020-12-30T17:22:11,285 Added py-staticmaps==0.2.3 from https://files.pythonhosted.org/packages/03/1e/a86e19c1efd133e21d8b541359a15592807d128582147f89539da6529cab/py-staticmaps-0.2.3.tar.gz#sha256=ea54d361350bae1ba7ec2f94389e4582e177fdf6d1d8d37594249d834edf6029 to build tracker '/tmp/pip-req-tracker-kzqijqio' 2020-12-30T17:22:11,286 Running setup.py (path:/tmp/pip-wheel-w44jup93/py-staticmaps/setup.py) egg_info for package py-staticmaps 2020-12-30T17:22:11,287 Created temporary directory: /tmp/pip-pip-egg-info-oos4z7po 2020-12-30T17:22:11,287 Running command python setup.py egg_info 2020-12-30T17:22:12,278 # py-staticmaps 2020-12-30T17:22:12,278 A python module to create static map images (PNG, SVG) with markers, geodesic lines, etc. 2020-12-30T17:22:12,279 ## Features 2020-12-30T17:22:12,280 - Map objects: pin-style markers, image (PNG) markers, polylines, polygons, (geodesic) circles 2020-12-30T17:22:12,280 - Automatic computation of best center + zoom from the added map objects 2020-12-30T17:22:12,280 - Several pre-configured map tile providers 2020-12-30T17:22:12,280 - Proper tile provider attributions display 2020-12-30T17:22:12,281 - On-disc caching of map tile images for faster drawing and reduced load on the tile servers 2020-12-30T17:22:12,281 - Anti-aliased drawing via `pycairo` 2020-12-30T17:22:12,281 - SVG creation via `svgwrite` 2020-12-30T17:22:12,282 ## Installation 2020-12-30T17:22:12,282 ```shell 2020-12-30T17:22:12,283 pip install py-staticmaps 2020-12-30T17:22:12,283 ``` 2020-12-30T17:22:12,283 `py-staticmaps` uses `pycairo` for creating antialiased 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`). 2020-12-30T17:22:12,284 ## Examples 2020-12-30T17:22:12,285 ### Markers and Geodesic Lines 2020-12-30T17:22:12,286 ```python 2020-12-30T17:22:12,286 import staticmaps 2020-12-30T17:22:12,286 context = staticmaps.Context() 2020-12-30T17:22:12,287 context.set_tile_provider(staticmaps.tile_provider_StamenToner) 2020-12-30T17:22:12,287 frankfurt = staticmaps.create_latlng(50.110644, 8.682092) 2020-12-30T17:22:12,288 newyork = staticmaps.create_latlng(40.712728, -74.006015) 2020-12-30T17:22:12,288 context.add_object(staticmaps.Line([frankfurt, newyork], color=staticmaps.BLUE, width=4)) 2020-12-30T17:22:12,288 context.add_object(staticmaps.Marker(frankfurt, color=staticmaps.GREEN, size=12)) 2020-12-30T17:22:12,289 context.add_object(staticmaps.Marker(newyork, color=staticmaps.RED, size=12)) 2020-12-30T17:22:12,289 # render png 2020-12-30T17:22:12,289 image = context.render_cairo(800, 500) 2020-12-30T17:22:12,290 image.write_to_png("frankfurt_newyork.png") 2020-12-30T17:22:12,290 # render svg 2020-12-30T17:22:12,290 svg_image = context.render_svg(800, 500) 2020-12-30T17:22:12,291 with open("frankfurt_newyork.svg", "w", encoding="utf-8") as f: 2020-12-30T17:22:12,291 svg_image.write(f, pretty=True) 2020-12-30T17:22:12,291 ``` 2020-12-30T17:22:12,292 ### Transparent Polygons 2020-12-30T17:22:12,292 ```python 2020-12-30T17:22:12,293 import staticmaps 2020-12-30T17:22:12,293 context = staticmaps.Context() 2020-12-30T17:22:12,294 context.set_tile_provider(staticmaps.tile_provider_OSM) 2020-12-30T17:22:12,294 freiburg_polygon = [ 2020-12-30T17:22:12,294 (47.96881, 7.79045), 2020-12-30T17:22:12,294 (47.96866, 7.78610), 2020-12-30T17:22:12,295 (47.97134, 7.77874), 2020-12-30T17:22:12,295 ... 2020-12-30T17:22:12,295 ] 2020-12-30T17:22:12,296 context.add_object( 2020-12-30T17:22:12,296 staticmaps.Area( 2020-12-30T17:22:12,296 [staticmaps.create_latlng(lat, lng) for lat, lng in freiburg_polygon], 2020-12-30T17:22:12,296 fill_color=staticmaps.parse_color("#00FF003F"), 2020-12-30T17:22:12,297 width=2, 2020-12-30T17:22:12,297 color=staticmaps.BLUE, 2020-12-30T17:22:12,297 ) 2020-12-30T17:22:12,297 ) 2020-12-30T17:22:12,298 # render png 2020-12-30T17:22:12,298 image = context.render_cairo(800, 500) 2020-12-30T17:22:12,298 image.write_to_png("freiburg_area.png") 2020-12-30T17:22:12,299 # render svg 2020-12-30T17:22:12,299 svg_image = context.render_svg(800, 500) 2020-12-30T17:22:12,299 with open("freiburg_area.svg", "w", encoding="utf-8") as f: 2020-12-30T17:22:12,299 svg_image.write(f, pretty=True) 2020-12-30T17:22:12,300 ``` 2020-12-30T17:22:12,301 ### Drawing a GPX Track + Image Marker (PNG) 2020-12-30T17:22:12,301 ```python 2020-12-30T17:22:12,301 import sys 2020-12-30T17:22:12,302 import gpxpy 2020-12-30T17:22:12,302 import staticmaps 2020-12-30T17:22:12,303 context = staticmaps.Context() 2020-12-30T17:22:12,303 context.set_tile_provider(staticmaps.tile_provider_ArcGISWorldImagery) 2020-12-30T17:22:12,303 with open(sys.argv[1], "r") as file: 2020-12-30T17:22:12,304 gpx = gpxpy.parse(file) 2020-12-30T17:22:12,304 for track in gpx.tracks: 2020-12-30T17:22:12,304 for segment in track.segments: 2020-12-30T17:22:12,305 line = [staticmaps.create_latlng(p.latitude, p.longitude) for p in segment.points] 2020-12-30T17:22:12,305 context.add_object(staticmaps.Line(line)) 2020-12-30T17:22:12,305 for p in gpx.walk(only_points=True): 2020-12-30T17:22:12,305 pos = staticmaps.create_latlng(p.latitude, p.longitude) 2020-12-30T17:22:12,305 marker = staticmaps.ImageMarker(pos, "start.png", origin_x=27, origin_y=35) 2020-12-30T17:22:12,306 context.add_object(marker) 2020-12-30T17:22:12,306 break 2020-12-30T17:22:12,306 image = context.render_cairo(800, 500) 2020-12-30T17:22:12,306 image.write_to_png("draw_gpx.png") 2020-12-30T17:22:12,306 ``` 2020-12-30T17:22:12,307 ### US State Capitals 2020-12-30T17:22:12,308 ```python 2020-12-30T17:22:12,308 import json 2020-12-30T17:22:12,308 import requests 2020-12-30T17:22:12,308 import staticmaps 2020-12-30T17:22:12,309 context = staticmaps.Context() 2020-12-30T17:22:12,309 context.set_tile_provider(staticmaps.tile_provider_OSM) 2020-12-30T17:22:12,309 URL = ( 2020-12-30T17:22:12,310 "https://gist.githubusercontent.com/jpriebe/d62a45e29f24e843c974/" 2020-12-30T17:22:12,310 "raw/b1d3066d245e742018bce56e41788ac7afa60e29/us_state_capitals.json" 2020-12-30T17:22:12,310 ) 2020-12-30T17:22:12,310 response = requests.get(URL) 2020-12-30T17:22:12,310 for _, data in json.loads(response.text).items(): 2020-12-30T17:22:12,311 capital = staticmaps.create_latlng(float(data["lat"]), float(data["long"])) 2020-12-30T17:22:12,311 context.add_object(staticmaps.Marker(capital, size=5)) 2020-12-30T17:22:12,311 image = context.render_cairo(800, 500) 2020-12-30T17:22:12,311 image.write_to_png("us_capitals.png") 2020-12-30T17:22:12,312 ``` 2020-12-30T17:22:12,312 ### Geodesic Circles 2020-12-30T17:22:12,313 ```python 2020-12-30T17:22:12,313 import staticmaps 2020-12-30T17:22:12,313 context = staticmaps.Context() 2020-12-30T17:22:12,314 context.set_tile_provider(staticmaps.tile_provider_StamenToner) 2020-12-30T17:22:12,314 center1 = staticmaps.create_latlng(66, 0) 2020-12-30T17:22:12,314 center2 = staticmaps.create_latlng(0, 0) 2020-12-30T17:22:12,315 context.add_object(staticmaps.Circle(center1, 2000, fill_color=staticmaps.TRANSPARENT, color=staticmaps.RED, width=2)) 2020-12-30T17:22:12,315 context.add_object(staticmaps.Circle(center2, 2000, fill_color=staticmaps.TRANSPARENT, color=staticmaps.GREEN, width=2)) 2020-12-30T17:22:12,315 context.add_object(staticmaps.Marker(center1, color=staticmaps.RED)) 2020-12-30T17:22:12,315 context.add_object(staticmaps.Marker(center2, color=staticmaps.GREEN)) 2020-12-30T17:22:12,316 image = context.render_cairo(800, 600) 2020-12-30T17:22:12,316 image.write_to_png("geodesic_circles.png") 2020-12-30T17:22:12,316 ``` 2020-12-30T17:22:12,316 ### Other Examples 2020-12-30T17:22:12,317 Please take a look at the command line program which uses the `staticmaps` package: `staticmaps/cli.py` 2020-12-30T17:22:12,317 ### Dependencies 2020-12-30T17:22:12,318 `py-staticmaps` uses 2020-12-30T17:22:12,318 - `pycairo` for rendering antialiased raster-graphics 2020-12-30T17:22:12,318 - `svgwrite` for writing SVG files 2020-12-30T17:22:12,319 - `s2sphere` for geo coordinates handling 2020-12-30T17:22:12,319 - `geographiclib` for geodesic computations 2020-12-30T17:22:12,319 - `appdirs` for finding the user's default cache directory 2020-12-30T17:22:12,319 - `requests` for downloading tile files 2020-12-30T17:22:12,320 ## License 2020-12-30T17:22:12,320 [MIT](LICENSE) © 2020 Florian Pigorsch 2020-12-30T17:22:12,321 running egg_info 2020-12-30T17:22:12,321 creating /tmp/pip-pip-egg-info-oos4z7po/py_staticmaps.egg-info 2020-12-30T17:22:12,321 writing /tmp/pip-pip-egg-info-oos4z7po/py_staticmaps.egg-info/PKG-INFO 2020-12-30T17:22:12,321 writing dependency_links to /tmp/pip-pip-egg-info-oos4z7po/py_staticmaps.egg-info/dependency_links.txt 2020-12-30T17:22:12,322 writing entry points to /tmp/pip-pip-egg-info-oos4z7po/py_staticmaps.egg-info/entry_points.txt 2020-12-30T17:22:12,322 writing requirements to /tmp/pip-pip-egg-info-oos4z7po/py_staticmaps.egg-info/requires.txt 2020-12-30T17:22:12,322 writing top-level names to /tmp/pip-pip-egg-info-oos4z7po/py_staticmaps.egg-info/top_level.txt 2020-12-30T17:22:12,322 writing manifest file '/tmp/pip-pip-egg-info-oos4z7po/py_staticmaps.egg-info/SOURCES.txt' 2020-12-30T17:22:12,436 reading manifest file '/tmp/pip-pip-egg-info-oos4z7po/py_staticmaps.egg-info/SOURCES.txt' 2020-12-30T17:22:12,438 reading manifest template 'MANIFEST.in' 2020-12-30T17:22:12,440 warning: no previously-included files matching '__pycache__' found under directory '*' 2020-12-30T17:22:12,441 warning: no previously-included files matching '*.py[co]' found under directory '*' 2020-12-30T17:22:12,443 writing manifest file '/tmp/pip-pip-egg-info-oos4z7po/py_staticmaps.egg-info/SOURCES.txt' 2020-12-30T17:22:12,507 Source in /tmp/pip-wheel-w44jup93/py-staticmaps has version 0.2.3, which satisfies requirement py-staticmaps==0.2.3 from https://files.pythonhosted.org/packages/03/1e/a86e19c1efd133e21d8b541359a15592807d128582147f89539da6529cab/py-staticmaps-0.2.3.tar.gz#sha256=ea54d361350bae1ba7ec2f94389e4582e177fdf6d1d8d37594249d834edf6029 2020-12-30T17:22:12,508 Removed py-staticmaps==0.2.3 from https://files.pythonhosted.org/packages/03/1e/a86e19c1efd133e21d8b541359a15592807d128582147f89539da6529cab/py-staticmaps-0.2.3.tar.gz#sha256=ea54d361350bae1ba7ec2f94389e4582e177fdf6d1d8d37594249d834edf6029 from build tracker '/tmp/pip-req-tracker-kzqijqio' 2020-12-30T17:22:12,511 Building wheels for collected packages: py-staticmaps 2020-12-30T17:22:12,516 Created temporary directory: /tmp/pip-wheel-gzs1ttta 2020-12-30T17:22:12,516 Building wheel for py-staticmaps (setup.py): started 2020-12-30T17:22:12,516 Destination directory: /tmp/pip-wheel-gzs1ttta 2020-12-30T17:22:12,517 Running command /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-wheel-w44jup93/py-staticmaps/setup.py'"'"'; __file__='"'"'/tmp/pip-wheel-w44jup93/py-staticmaps/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-gzs1ttta 2020-12-30T17:22:13,425 # py-staticmaps 2020-12-30T17:22:13,425 A python module to create static map images (PNG, SVG) with markers, geodesic lines, etc. 2020-12-30T17:22:13,426 ## Features 2020-12-30T17:22:13,426 - Map objects: pin-style markers, image (PNG) markers, polylines, polygons, (geodesic) circles 2020-12-30T17:22:13,426 - Automatic computation of best center + zoom from the added map objects 2020-12-30T17:22:13,427 - Several pre-configured map tile providers 2020-12-30T17:22:13,427 - Proper tile provider attributions display 2020-12-30T17:22:13,427 - On-disc caching of map tile images for faster drawing and reduced load on the tile servers 2020-12-30T17:22:13,427 - Anti-aliased drawing via `pycairo` 2020-12-30T17:22:13,427 - SVG creation via `svgwrite` 2020-12-30T17:22:13,428 ## Installation 2020-12-30T17:22:13,429 ```shell 2020-12-30T17:22:13,429 pip install py-staticmaps 2020-12-30T17:22:13,429 ``` 2020-12-30T17:22:13,429 `py-staticmaps` uses `pycairo` for creating antialiased 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`). 2020-12-30T17:22:13,430 ## Examples 2020-12-30T17:22:13,430 ### Markers and Geodesic Lines 2020-12-30T17:22:13,431 ```python 2020-12-30T17:22:13,431 import staticmaps 2020-12-30T17:22:13,431 context = staticmaps.Context() 2020-12-30T17:22:13,431 context.set_tile_provider(staticmaps.tile_provider_StamenToner) 2020-12-30T17:22:13,432 frankfurt = staticmaps.create_latlng(50.110644, 8.682092) 2020-12-30T17:22:13,432 newyork = staticmaps.create_latlng(40.712728, -74.006015) 2020-12-30T17:22:13,433 context.add_object(staticmaps.Line([frankfurt, newyork], color=staticmaps.BLUE, width=4)) 2020-12-30T17:22:13,433 context.add_object(staticmaps.Marker(frankfurt, color=staticmaps.GREEN, size=12)) 2020-12-30T17:22:13,433 context.add_object(staticmaps.Marker(newyork, color=staticmaps.RED, size=12)) 2020-12-30T17:22:13,433 # render png 2020-12-30T17:22:13,434 image = context.render_cairo(800, 500) 2020-12-30T17:22:13,434 image.write_to_png("frankfurt_newyork.png") 2020-12-30T17:22:13,434 # render svg 2020-12-30T17:22:13,434 svg_image = context.render_svg(800, 500) 2020-12-30T17:22:13,435 with open("frankfurt_newyork.svg", "w", encoding="utf-8") as f: 2020-12-30T17:22:13,435 svg_image.write(f, pretty=True) 2020-12-30T17:22:13,435 ``` 2020-12-30T17:22:13,436 ### Transparent Polygons 2020-12-30T17:22:13,436 ```python 2020-12-30T17:22:13,437 import staticmaps 2020-12-30T17:22:13,437 context = staticmaps.Context() 2020-12-30T17:22:13,437 context.set_tile_provider(staticmaps.tile_provider_OSM) 2020-12-30T17:22:13,438 freiburg_polygon = [ 2020-12-30T17:22:13,438 (47.96881, 7.79045), 2020-12-30T17:22:13,438 (47.96866, 7.78610), 2020-12-30T17:22:13,438 (47.97134, 7.77874), 2020-12-30T17:22:13,438 ... 2020-12-30T17:22:13,439 ] 2020-12-30T17:22:13,439 context.add_object( 2020-12-30T17:22:13,439 staticmaps.Area( 2020-12-30T17:22:13,439 [staticmaps.create_latlng(lat, lng) for lat, lng in freiburg_polygon], 2020-12-30T17:22:13,440 fill_color=staticmaps.parse_color("#00FF003F"), 2020-12-30T17:22:13,440 width=2, 2020-12-30T17:22:13,440 color=staticmaps.BLUE, 2020-12-30T17:22:13,440 ) 2020-12-30T17:22:13,440 ) 2020-12-30T17:22:13,441 # render png 2020-12-30T17:22:13,441 image = context.render_cairo(800, 500) 2020-12-30T17:22:13,441 image.write_to_png("freiburg_area.png") 2020-12-30T17:22:13,442 # render svg 2020-12-30T17:22:13,442 svg_image = context.render_svg(800, 500) 2020-12-30T17:22:13,442 with open("freiburg_area.svg", "w", encoding="utf-8") as f: 2020-12-30T17:22:13,442 svg_image.write(f, pretty=True) 2020-12-30T17:22:13,442 ``` 2020-12-30T17:22:13,443 ### Drawing a GPX Track + Image Marker (PNG) 2020-12-30T17:22:13,444 ```python 2020-12-30T17:22:13,444 import sys 2020-12-30T17:22:13,444 import gpxpy 2020-12-30T17:22:13,444 import staticmaps 2020-12-30T17:22:13,445 context = staticmaps.Context() 2020-12-30T17:22:13,445 context.set_tile_provider(staticmaps.tile_provider_ArcGISWorldImagery) 2020-12-30T17:22:13,445 with open(sys.argv[1], "r") as file: 2020-12-30T17:22:13,446 gpx = gpxpy.parse(file) 2020-12-30T17:22:13,446 for track in gpx.tracks: 2020-12-30T17:22:13,446 for segment in track.segments: 2020-12-30T17:22:13,446 line = [staticmaps.create_latlng(p.latitude, p.longitude) for p in segment.points] 2020-12-30T17:22:13,447 context.add_object(staticmaps.Line(line)) 2020-12-30T17:22:13,447 for p in gpx.walk(only_points=True): 2020-12-30T17:22:13,447 pos = staticmaps.create_latlng(p.latitude, p.longitude) 2020-12-30T17:22:13,447 marker = staticmaps.ImageMarker(pos, "start.png", origin_x=27, origin_y=35) 2020-12-30T17:22:13,447 context.add_object(marker) 2020-12-30T17:22:13,448 break 2020-12-30T17:22:13,448 image = context.render_cairo(800, 500) 2020-12-30T17:22:13,448 image.write_to_png("draw_gpx.png") 2020-12-30T17:22:13,448 ``` 2020-12-30T17:22:13,449 ### US State Capitals 2020-12-30T17:22:13,449 ```python 2020-12-30T17:22:13,450 import json 2020-12-30T17:22:13,450 import requests 2020-12-30T17:22:13,450 import staticmaps 2020-12-30T17:22:13,450 context = staticmaps.Context() 2020-12-30T17:22:13,451 context.set_tile_provider(staticmaps.tile_provider_OSM) 2020-12-30T17:22:13,451 URL = ( 2020-12-30T17:22:13,451 "https://gist.githubusercontent.com/jpriebe/d62a45e29f24e843c974/" 2020-12-30T17:22:13,451 "raw/b1d3066d245e742018bce56e41788ac7afa60e29/us_state_capitals.json" 2020-12-30T17:22:13,452 ) 2020-12-30T17:22:13,452 response = requests.get(URL) 2020-12-30T17:22:13,452 for _, data in json.loads(response.text).items(): 2020-12-30T17:22:13,452 capital = staticmaps.create_latlng(float(data["lat"]), float(data["long"])) 2020-12-30T17:22:13,453 context.add_object(staticmaps.Marker(capital, size=5)) 2020-12-30T17:22:13,453 image = context.render_cairo(800, 500) 2020-12-30T17:22:13,453 image.write_to_png("us_capitals.png") 2020-12-30T17:22:13,453 ``` 2020-12-30T17:22:13,454 ### Geodesic Circles 2020-12-30T17:22:13,454 ```python 2020-12-30T17:22:13,455 import staticmaps 2020-12-30T17:22:13,455 context = staticmaps.Context() 2020-12-30T17:22:13,455 context.set_tile_provider(staticmaps.tile_provider_StamenToner) 2020-12-30T17:22:13,456 center1 = staticmaps.create_latlng(66, 0) 2020-12-30T17:22:13,456 center2 = staticmaps.create_latlng(0, 0) 2020-12-30T17:22:13,456 context.add_object(staticmaps.Circle(center1, 2000, fill_color=staticmaps.TRANSPARENT, color=staticmaps.RED, width=2)) 2020-12-30T17:22:13,456 context.add_object(staticmaps.Circle(center2, 2000, fill_color=staticmaps.TRANSPARENT, color=staticmaps.GREEN, width=2)) 2020-12-30T17:22:13,456 context.add_object(staticmaps.Marker(center1, color=staticmaps.RED)) 2020-12-30T17:22:13,457 context.add_object(staticmaps.Marker(center2, color=staticmaps.GREEN)) 2020-12-30T17:22:13,457 image = context.render_cairo(800, 600) 2020-12-30T17:22:13,457 image.write_to_png("geodesic_circles.png") 2020-12-30T17:22:13,457 ``` 2020-12-30T17:22:13,458 ### Other Examples 2020-12-30T17:22:13,459 Please take a look at the command line program which uses the `staticmaps` package: `staticmaps/cli.py` 2020-12-30T17:22:13,459 ### Dependencies 2020-12-30T17:22:13,459 `py-staticmaps` uses 2020-12-30T17:22:13,460 - `pycairo` for rendering antialiased raster-graphics 2020-12-30T17:22:13,460 - `svgwrite` for writing SVG files 2020-12-30T17:22:13,460 - `s2sphere` for geo coordinates handling 2020-12-30T17:22:13,460 - `geographiclib` for geodesic computations 2020-12-30T17:22:13,461 - `appdirs` for finding the user's default cache directory 2020-12-30T17:22:13,461 - `requests` for downloading tile files 2020-12-30T17:22:13,461 ## License 2020-12-30T17:22:13,462 [MIT](LICENSE) © 2020 Florian Pigorsch 2020-12-30T17:22:13,607 running bdist_wheel 2020-12-30T17:22:13,617 running build 2020-12-30T17:22:13,617 running build_py 2020-12-30T17:22:13,752 creating build 2020-12-30T17:22:13,753 creating build/lib 2020-12-30T17:22:13,753 creating build/lib/staticmaps 2020-12-30T17:22:13,755 copying staticmaps/transformer.py -> build/lib/staticmaps 2020-12-30T17:22:13,757 copying staticmaps/image_marker.py -> build/lib/staticmaps 2020-12-30T17:22:13,759 copying staticmaps/tile_provider.py -> build/lib/staticmaps 2020-12-30T17:22:13,761 copying staticmaps/area.py -> build/lib/staticmaps 2020-12-30T17:22:13,763 copying staticmaps/cairo_renderer.py -> build/lib/staticmaps 2020-12-30T17:22:13,765 copying staticmaps/__init__.py -> build/lib/staticmaps 2020-12-30T17:22:13,768 copying staticmaps/color.py -> build/lib/staticmaps 2020-12-30T17:22:13,770 copying staticmaps/meta.py -> build/lib/staticmaps 2020-12-30T17:22:13,772 copying staticmaps/svg_renderer.py -> build/lib/staticmaps 2020-12-30T17:22:13,775 copying staticmaps/tile_downloader.py -> build/lib/staticmaps 2020-12-30T17:22:13,777 copying staticmaps/line.py -> build/lib/staticmaps 2020-12-30T17:22:13,779 copying staticmaps/renderer.py -> build/lib/staticmaps 2020-12-30T17:22:13,781 copying staticmaps/cli.py -> build/lib/staticmaps 2020-12-30T17:22:13,783 copying staticmaps/object.py -> build/lib/staticmaps 2020-12-30T17:22:13,786 copying staticmaps/marker.py -> build/lib/staticmaps 2020-12-30T17:22:13,788 copying staticmaps/context.py -> build/lib/staticmaps 2020-12-30T17:22:13,790 copying staticmaps/circle.py -> build/lib/staticmaps 2020-12-30T17:22:13,793 copying staticmaps/coordinates.py -> build/lib/staticmaps 2020-12-30T17:22:13,800 installing to build/bdist.linux-armv7l/wheel 2020-12-30T17:22:13,800 running install 2020-12-30T17:22:13,801 running install_lib 2020-12-30T17:22:13,806 creating build/bdist.linux-armv7l 2020-12-30T17:22:13,807 creating build/bdist.linux-armv7l/wheel 2020-12-30T17:22:13,809 creating build/bdist.linux-armv7l/wheel/staticmaps 2020-12-30T17:22:13,810 copying build/lib/staticmaps/transformer.py -> build/bdist.linux-armv7l/wheel/staticmaps 2020-12-30T17:22:13,814 copying build/lib/staticmaps/image_marker.py -> build/bdist.linux-armv7l/wheel/staticmaps 2020-12-30T17:22:13,816 copying build/lib/staticmaps/tile_provider.py -> build/bdist.linux-armv7l/wheel/staticmaps 2020-12-30T17:22:13,818 copying build/lib/staticmaps/area.py -> build/bdist.linux-armv7l/wheel/staticmaps 2020-12-30T17:22:13,820 copying build/lib/staticmaps/cairo_renderer.py -> build/bdist.linux-armv7l/wheel/staticmaps 2020-12-30T17:22:13,823 copying build/lib/staticmaps/__init__.py -> build/bdist.linux-armv7l/wheel/staticmaps 2020-12-30T17:22:13,825 copying build/lib/staticmaps/color.py -> build/bdist.linux-armv7l/wheel/staticmaps 2020-12-30T17:22:13,828 copying build/lib/staticmaps/meta.py -> build/bdist.linux-armv7l/wheel/staticmaps 2020-12-30T17:22:13,830 copying build/lib/staticmaps/svg_renderer.py -> build/bdist.linux-armv7l/wheel/staticmaps 2020-12-30T17:22:13,833 copying build/lib/staticmaps/tile_downloader.py -> build/bdist.linux-armv7l/wheel/staticmaps 2020-12-30T17:22:13,836 copying build/lib/staticmaps/line.py -> build/bdist.linux-armv7l/wheel/staticmaps 2020-12-30T17:22:13,838 copying build/lib/staticmaps/renderer.py -> build/bdist.linux-armv7l/wheel/staticmaps 2020-12-30T17:22:13,840 copying build/lib/staticmaps/cli.py -> build/bdist.linux-armv7l/wheel/staticmaps 2020-12-30T17:22:13,843 copying build/lib/staticmaps/object.py -> build/bdist.linux-armv7l/wheel/staticmaps 2020-12-30T17:22:13,845 copying build/lib/staticmaps/marker.py -> build/bdist.linux-armv7l/wheel/staticmaps 2020-12-30T17:22:13,847 copying build/lib/staticmaps/context.py -> build/bdist.linux-armv7l/wheel/staticmaps 2020-12-30T17:22:13,850 copying build/lib/staticmaps/circle.py -> build/bdist.linux-armv7l/wheel/staticmaps 2020-12-30T17:22:13,853 copying build/lib/staticmaps/coordinates.py -> build/bdist.linux-armv7l/wheel/staticmaps 2020-12-30T17:22:13,855 running install_egg_info 2020-12-30T17:22:13,880 running egg_info 2020-12-30T17:22:13,881 writing py_staticmaps.egg-info/PKG-INFO 2020-12-30T17:22:13,883 writing dependency_links to py_staticmaps.egg-info/dependency_links.txt 2020-12-30T17:22:13,885 writing entry points to py_staticmaps.egg-info/entry_points.txt 2020-12-30T17:22:13,886 writing requirements to py_staticmaps.egg-info/requires.txt 2020-12-30T17:22:13,888 writing top-level names to py_staticmaps.egg-info/top_level.txt 2020-12-30T17:22:13,893 reading manifest file 'py_staticmaps.egg-info/SOURCES.txt' 2020-12-30T17:22:13,896 reading manifest template 'MANIFEST.in' 2020-12-30T17:22:13,898 warning: no previously-included files matching '__pycache__' found under directory '*' 2020-12-30T17:22:13,899 warning: no previously-included files matching '*.py[co]' found under directory '*' 2020-12-30T17:22:13,902 writing manifest file 'py_staticmaps.egg-info/SOURCES.txt' 2020-12-30T17:22:13,904 Copying py_staticmaps.egg-info to build/bdist.linux-armv7l/wheel/py_staticmaps-0.2.3-py3.7.egg-info 2020-12-30T17:22:13,920 running install_scripts 2020-12-30T17:22:14,015 adding license file "LICENSE" (matched pattern "LICEN[CS]E*") 2020-12-30T17:22:14,021 creating build/bdist.linux-armv7l/wheel/py_staticmaps-0.2.3.dist-info/WHEEL 2020-12-30T17:22:14,024 creating '/tmp/pip-wheel-gzs1ttta/py_staticmaps-0.2.3-py3-none-any.whl' and adding 'build/bdist.linux-armv7l/wheel' to it 2020-12-30T17:22:14,028 adding 'staticmaps/__init__.py' 2020-12-30T17:22:14,030 adding 'staticmaps/area.py' 2020-12-30T17:22:14,031 adding 'staticmaps/cairo_renderer.py' 2020-12-30T17:22:14,033 adding 'staticmaps/circle.py' 2020-12-30T17:22:14,035 adding 'staticmaps/cli.py' 2020-12-30T17:22:14,036 adding 'staticmaps/color.py' 2020-12-30T17:22:14,038 adding 'staticmaps/context.py' 2020-12-30T17:22:14,039 adding 'staticmaps/coordinates.py' 2020-12-30T17:22:14,041 adding 'staticmaps/image_marker.py' 2020-12-30T17:22:14,042 adding 'staticmaps/line.py' 2020-12-30T17:22:14,044 adding 'staticmaps/marker.py' 2020-12-30T17:22:14,045 adding 'staticmaps/meta.py' 2020-12-30T17:22:14,047 adding 'staticmaps/object.py' 2020-12-30T17:22:14,048 adding 'staticmaps/renderer.py' 2020-12-30T17:22:14,050 adding 'staticmaps/svg_renderer.py' 2020-12-30T17:22:14,051 adding 'staticmaps/tile_downloader.py' 2020-12-30T17:22:14,053 adding 'staticmaps/tile_provider.py' 2020-12-30T17:22:14,054 adding 'staticmaps/transformer.py' 2020-12-30T17:22:14,056 adding 'py_staticmaps-0.2.3.dist-info/LICENSE' 2020-12-30T17:22:14,057 adding 'py_staticmaps-0.2.3.dist-info/METADATA' 2020-12-30T17:22:14,058 adding 'py_staticmaps-0.2.3.dist-info/WHEEL' 2020-12-30T17:22:14,059 adding 'py_staticmaps-0.2.3.dist-info/entry_points.txt' 2020-12-30T17:22:14,060 adding 'py_staticmaps-0.2.3.dist-info/top_level.txt' 2020-12-30T17:22:14,061 adding 'py_staticmaps-0.2.3.dist-info/RECORD' 2020-12-30T17:22:14,063 removing build/bdist.linux-armv7l/wheel 2020-12-30T17:22:14,139 Building wheel for py-staticmaps (setup.py): finished with status 'done' 2020-12-30T17:22:14,141 Created wheel for py-staticmaps: filename=py_staticmaps-0.2.3-py3-none-any.whl size=21603 sha256=1a16e0df0f365cf527c066160712df7be9febf4546ec8037b912b7588fe53f6f 2020-12-30T17:22:14,142 Stored in directory: /tmp/pip-ephem-wheel-cache-_f5p63ei/wheels/94/e3/0e/1a296967e57809b7df4c504ec497e7bccdfdee99e3161fdb83 2020-12-30T17:22:14,144 Successfully built py-staticmaps 2020-12-30T17:22:14,149 Removed build tracker: '/tmp/pip-req-tracker-kzqijqio'