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.0
- v2.0 (23/12/21)
- "PLA" is no longer defined as "a set of components" but a file type (
.pla
)- Components are called... Components
- Component JSON files have a
.comps.pla
suffix - Node JSON files have a
.nodes.pla
suffix
- The CLI format has changed substantially to follow PEP8 naming conventions
- The entire codebase has been reformatted to follow PEP8 naming conventions
- Skins, components and nodes (& their list counterparts) now have their own classes, to make the code cleaner
- Coords and TileCoords are now NamedTuples
pathlib.Path
is now being used instead of raw strings- Ray multiprocessing integration (3.8 and 3.9 only)
- Text rendering is now separated from the main rendering task
- Rendering logs will no longer use the same line but rather will output one log per line
- Builders:
- Default IDs can now be set
- PyAutoGUI is now used to automatically write the default ID
- Commands now start with "."
- ... and many more I probably forgot lol
- Default IDs can now be set
internals.internal
is now typed- Loggers and texts (for later rendering) now have their own private classes
- Several functions in
mathtools
(lines_intersect
,point_in_poly
,poly_center
) are now quicker to run (mostly using NumPy)- SymPy is no longer a dependency (yey)
misc
no longer exists (misc.getSkin
is nowSkin.from_name
)tools
is now split up into 6 files- Many functions in
validate
are now in their respective object classes - Made the CLI actually work (:P)
- "PLA" is no longer defined as "a set of components" but a file type (
- 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 # important!!
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:
# if __name__ == "__main__": renderer.render(comps, nodes, 1, 2, 8, save_dir=Path("your_folder_name/"))
# Too slow? Increase the number of processes
# if __name__ == "__main__": renderer.render(comps, nodes, 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-2.0.tar.gz
(613.4 kB
view hashes)
Built Distribution
tile_renderer-2.0-py3-none-any.whl
(621.0 kB
view hashes)
Close
Hashes for tile_renderer-2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a00e9806f65dd17d189b493d0c7f9b9e9c76a0ad34cdf8db50e026dfdcf014d |
|
MD5 | ff4d83b3bbe9701e6bf0ae719998e08b |
|
BLAKE2b-256 | 90e3fc602bc6cbfcf0e4f21c8d4ee64da8ddb61b44f4355ec5c7a28fbd59c4c2 |