Open Street Map route screenshot
Project description
Описание
Библиотека для создания скриншотов маршрута в Open Street Map
pip install OsmRouteScreenLib
Написана на основе статьи: https://smyt.ru/blog/statc-osm-map-with-python/
Использование
import OsmRouteScreenLib.startup as st
import OsmRouteScreenLib.options as o
options = o.make_options('http://tile-server.domain.com/{zoom}/{x}/{y}.png',
'https://route.domain.com/route/v1/driving/{startPoint};{endPoint}?overview=full&geometries=geojson')
st.get_route_screen_by_points((47.232565,56.141757), (47.220063,56.139836), options)
Доступны следующие опции:
- url_tile: str - путь к тайловому серверу
- url_routing: str - путь к серверу для получения маршрута
- padding: float - отступ карты от краёв маршрута в процентах от 0 до 1
- zoom: int - zoom карты
- output: str - путь к выходному файлу
- line_width: int - ширина линии
- marker_text: str - метки
- show_geodesic: bool - отображать метку с пройденной дистанцией (км)
- split_line: bool - цетовое разделение маршрута
Сборка Ubuntu 22.04
Устанавливаем дополнительные библиотека: sudo apt install libcairo2-dev pkg-config python3-dev
python3 -m venv routing-service source routing-service/bin/activate pip install -r requirements.txt
Публикация пакета
Устанавливаем библиотеки для публикации в pypi.org
pip install setuptools wheel twine
Выполняем в корне проекта
python setup.py sdist bdist_wheel twine upload --repository pypi dist/*
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file OsmRouteScreenLib-0.0.4.tar.gz.
File metadata
- Download URL: OsmRouteScreenLib-0.0.4.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d911a60ace0ec937fc3ff1c1c7a9a37e253427637460d79d3f3c98123f3a0df
|
|
| MD5 |
6679135c80eedb66ad1e26614fb19955
|
|
| BLAKE2b-256 |
3857431d9c9413f9cdde22464d86f3344a8057dfc36f7af8d56fdeb73e4dd0f6
|
File details
Details for the file OsmRouteScreenLib-0.0.4-py3-none-any.whl.
File metadata
- Download URL: OsmRouteScreenLib-0.0.4-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac7c869321aa7252d4f2e12e6fe01646ed56900638a24187fc02eef8d651212a
|
|
| MD5 |
12176358b58e867b9e80170e6472aed4
|
|
| BLAKE2b-256 |
c5cc201691e233b64b287ff2361f8eb0a17821d6bb160b3d8e87cffb4f6c3fe8
|