Leaflet.js streetmap tile renderer
Project description
tile-renderer
Leaflet.js streetmap tile renderer, made by 7d
Note: renderer is complete, but not the skin or the tutorials.
Documentation: https://tile-renderer.readthedocs.io/en/latest/
Current version: v1.3
- v1.3 (26/6/21)
- New subcommands in CLI:
validate
andvdir
, to validate JSON filesmerge
to mergeplabuilder
for the new PLA builder
- Area centertext will now break up into multiple lines
- New PLA builder
- additionally, builders now have their own submodule
- New subcommands in CLI:
- Past changelogs can be found in https://tile-renderer.readthedocs.io/en/latest/changelog.html
Usage (simple)
- Download or clone this repo; or run
pip install tile-renderer
- Write a node JSON file and a PLA JSON file. (Tutorial coming soon) Or, use the example files provided in
data
. - In your file, run the renderer. Here is an example code:
import renderer # important!!
import json
def readFile(dir): # extract from JSON as dict
with open(dir, "r") as f:
data = json.load(f)
f.close()
return data
pla = readFile("path_to_your_PLA_file/pla.json")
nodes = readFile("path_to_your_nodes_file/nodes.json")
skin = renderer.misc.getSkin("default")
if __name__ == "__main__": renderer.render(pla, nodes, skin, 1, 2, 8)
# renders tiles at zoom levels 1 and 2 with the max zoom tile covering 8 units
# Don't like clogging the main directory? Create a new folder and use this instead:
# if __name__ == "__main__": renderer.render(pla, nodes, skin, 1, 2, 8, saveDir="your_folder_name/")
# Too slow? Increase the number of processes
# if __name__ == "__main__": renderer.render(pla, nodes, skin, 1, 2, 8, processes=5)
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
tile-renderer-1.3.1.tar.gz
(607.4 kB
view hashes)
Built Distribution
tile_renderer-1.3.1-py3-none-any.whl
(618.0 kB
view hashes)
Close
Hashes for tile_renderer-1.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7aa4966eeef29b31c656a1944c3c6f04e84f853c5c4780fb34c4050b766a52c7 |
|
MD5 | 1b00a575375158dd24695f79bb9afc03 |
|
BLAKE2b-256 | 4293e11d9eeea26e1751250d5fb05d7ebb44f5f98cc4d88905e580d0719c7d77 |