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: v2.2
-
v2.1 (6/4/22)
- Added SkinBuilder, a utility class for building skins Pythonically
- Moved bulk of rendering code to ComponentStyle classes
- Redid stud drawing
- Fix text overlapping with _prevent_text_overlap
- most mathtools functions now use Coord and TileCoord
- logging improvements
- _TextObjects now store their bounds instead of their width/heights
- new dashing algorithm
mathtools.dash()
- offset function
mathtools.offset()
- redid rendering for LineText so that they can go around corners
- fixed arrow offset
- debug switch to show additional debug Information
- tweaked skin
-
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
(For ray functionality dopip install ray
) - Write a node JSON file and a component 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
import json
def read_file(path): # extract from JSON as dict
with open(path, "r") as f:
data = json.load(f)
f.close()
return data
nodes = renderer.NodeList(read_file("path_to_your_nodes_file/blah.nodes.pla"))
comps = renderer.ComponentList(read_file("path_to_your_components_file/blah.comps.pla"),
read_file("path_to_your_nodes_file/blah.nodes.pla"))
if __name__ == "__main__": renderer.render(comps, nodes, 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:
# renderer.render(comps, nodes, 1, 2, 8, save_dir=Path("your_folder_name/"))
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-2.1.tar.gz
(620.6 kB
view hashes)
Built Distribution
tile_renderer-2.1-py3-none-any.whl
(628.9 kB
view hashes)
Close
Hashes for tile_renderer-2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 908693b055954664613f9539c30bb54dc36c60a518d624b973af2df2adb39e2b |
|
MD5 | 41be30b18f090e1918ff0eca780f69cf |
|
BLAKE2b-256 | a93c7966d3bf73c1619062a8517e0fa2bb4e22326996bb7d8d40fe67e60a6cc0 |