Skip to main content

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 - отображать метку с пройденной дистанцией (км)

Сборка 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

OsmRouteScreenLib-0.0.3.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

OsmRouteScreenLib-0.0.3-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file OsmRouteScreenLib-0.0.3.tar.gz.

File metadata

  • Download URL: OsmRouteScreenLib-0.0.3.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for OsmRouteScreenLib-0.0.3.tar.gz
Algorithm Hash digest
SHA256 29d7f444bf604232e09cf82b8059048f6ae3fb7cf5a74a86bc3f8ba7a18b0993
MD5 d25842c8494144e32c6421a20c34b974
BLAKE2b-256 e5dad12d70c7cb74e1680485492e43b96a41732730eda80822778a7b3f3ebca5

See more details on using hashes here.

File details

Details for the file OsmRouteScreenLib-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for OsmRouteScreenLib-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e3bfdd8eef72386d2321dccb76ed828db884f5655347c7f96b1fe7894769f434
MD5 66860222960d8d538914deeb00578dc9
BLAKE2b-256 1c7ee598c64820506d1909e895e6bd7083d056e831357aa4d51d20d4dbe3f135

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page