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.2
- v1.2 (8/5/21)
renderer.render()
now ignores PLAs if their type is not specified in the skin Json- Hollows are now supported in areas
- New function,
renderer.validate.vGeoJson()
renderer.validate.vCoords()
now supports lists along with tuples
- The renderer now has a CLI, to show the help page do
python -m renderer -h
renderer.render()
now supports float maxZoomRanges- New functions:
renderer.tools.plaJson.toGeoJson()
andrenderer.tools.geoJson.toNodePlaJson()
- these are for translating our custom format of storing geographical format to geoJson
- (btw why we're not using geoJson is because its harder to store nodes)
- internal-use files have been moved to
renderer/internals/
- removed
renderer.tools.plaJson.toTiles()
as it's a duplicate ofrenderer.tools.plaJson.renderedIn()
renderer.tools.coord.toTiles()
now supports tuples ascoords
parameter
- v1.3 (coming soon)
- Long label breaking
- Validating from CLI (& more)
- Fixing texts for once
- Skin installer
- 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)
Other stats
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.2.tar.gz
(605.2 kB
view hashes)
Built Distribution
tile_renderer-1.2-py3-none-any.whl
(613.8 kB
view hashes)
Close
Hashes for tile_renderer-1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3658e978448d6643dde128a585fa8e7f75e4acd82c2c7737564ce95af0da24b1 |
|
MD5 | a5a67dbdab8ba366238e2e260ec32252 |
|
BLAKE2b-256 | 034b70a9db34181fa83e8b911f492066f0722bcaae9143677d4b523f16e69daa |