Tile maps rendered with Vispy
Project description
Vismap
Provides a ViewBox for creating maps with
Vispy. The view automatically gets its tiles
from a TileProvider based on the zoom level.
Several tile providers are bundled with this project; adding a tile provider
simply requires knowing the URL at which to grab a tile, and providing the
attribution text for the tiles. You can add your own data to the map by
creating SceneVisuals and setting the parent to the created view.scene
.
Run the provided example to check out how interacting with
the map works. The script is installed as vismap-example
if you install
vismap; so from your command line just run
vismap-example
Use the left and right arrow keys to change the tile provider.
Vismap provides you with a map on which to plot your own data. An example map:
What's the Point?
The idea is to be able to display real-time geographical data on top of a map–for example, radar data. This project provides the view which automatically fills the map based on the current zoom level, and also provides transforms, so you can actually view data on top of the map. The transforms are located in vismap/transforms.py.
Currently, two transforms are provided: MercatorTransform
and
RelativeMercatorTransform
. Use the MercatorTransform
when your data is
naturally represented in longitude/latitude pairs. For example, the following
will draw a line from Norman, OK to Oklahoma City, OK:
from vismap import Canvas, MercatorTransform
import vispy.scene.visuals as visuals
from vispy import app
import numpy as np
c = Canvas()
c.show()
line = visuals.Line(np.array([[-97.4395, 35.2226], [-97.5164, 35.4676]]),
parent=c.view.scene)
line.transform = MercatorTransform() # the magic line!
app.run()
The RelativeMercatorTransform
is for plotting data that is naturally
expressed in units of length, but would be nice if it were centered somewhere
geographically. The motivating use case is radar data: it makes sense to think
of the data in meters, relative to a specific latitude and longitude.
When you are using these transforms, make sure you always remember to add the visual to the correct scene, otherwise the data will not show up and it will probably be confusing.
Installing
Vismap is available via pip:
pip install vismap
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file vismap-0.2.1.tar.gz
.
File metadata
- Download URL: vismap-0.2.1.tar.gz
- Upload date:
- Size: 216.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 281456c5edafe54f8f28a05de0bc9302468be8616780716df8d138635473867b |
|
MD5 | 92da08bafcf10e59123368d3f3c6c6b2 |
|
BLAKE2b-256 | 0c8905597433055e8fbb5004ee543b3bae43fd1b10b5c8f426bf08e077645c09 |
File details
Details for the file vismap-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: vismap-0.2.1-py3-none-any.whl
- Upload date:
- Size: 217.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f704ffafb0878d4a2509a049dd8ac0fc2c51200839c106ac368ed8ddd441c514 |
|
MD5 | d4f306ec7f7535e2505725becb819b1a |
|
BLAKE2b-256 | 3880b19159f0a6197968812bc7ede82d82b4fced42a3d6a0b0a3a420968b1d13 |