Leaflet.js tile renderer
Project description
tile-renderer
Leaflet.js 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.1
- v1.1 (2/5/21)
- Added log prefixes to
renderer.render()
andrenderer.tileMerge()
- Improved curved line drawing
renderer.py
is now split into a packagerenderer.utils
renamed torenderer.validate
- all functions of
renderer.tools
andrenderer.validate
renamed - method descriptions added to all functions except those in
renderer.internal
- New function:
renderer.misc.getSkin()
- New logging system that does not clog your terminal
- changed colour library from
colorama
toblessed
- fixed
renderer.mergeTiles()
, especially in determining which zooms to merge and retrieving images - fixed
renderer.misc.getSkin()
- Added log prefixes to
- v1.2 (coming soon)
- holes in areas
- PLA to GeoJson, GML parser (maybe more who knows)
- 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.1.0.1.tar.gz
(29.8 kB
view hashes)
Built Distribution
Close
Hashes for tile_renderer-1.1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87888f2499f499d8b0a73dd2133d1e094c9bcf20ee1471750a90ca6140661b43 |
|
MD5 | 3a566cbec81bb171b5cab86bedafd7c3 |
|
BLAKE2b-256 | 46be240fa2ec344d0cb44ee666bc8571d0996c505b36c10a1f457b95ea0b9523 |