Skip to main content

Open Street Map route screenshot

Project description

Описание

Библиотека для создания скриншотов маршрута в Open Street Map

Использование

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')

coordinates = [
    [47.232251, 56.141821],
    [47.232082, 56.141565],
    [47.232037, 56.141592],
    [47.231584, 56.141681],
    [47.230827, 56.14183],
    [47.230783, 56.141767],
    [47.230494, 56.141349],
    [47.230364, 56.141158],
    [47.230213, 56.140941],
    [47.230175, 56.140883],
    [47.230068, 56.14073],
    [47.229908, 56.140522],
    [47.229851, 56.14047],
    [47.2298, 56.140436],
    [47.229752, 56.140416],
    [47.229603, 56.140436],
    [47.229076, 56.140548],
    [47.228904, 56.140602],
    [47.228479, 56.140808],
    [47.2284, 56.140841],
    [47.228301, 56.140874],
    [47.226786, 56.141198],
    [47.226285, 56.141319],
    [47.226067, 56.141259],
    [47.225833, 56.141189],
    [47.225541, 56.141483],
    [47.225303, 56.141697],
    [47.224905, 56.141548],
    [47.224695, 56.141477],
    [47.224094, 56.141286],
    [47.223779, 56.1412],
    [47.223529, 56.141143],
    [47.222659, 56.140979],
    [47.222714, 56.14088],
    [47.222761, 56.140798],
    [47.222839, 56.140654],
    [47.22287, 56.140594],
    [47.222867, 56.140549],
    [47.222809, 56.140515],
    [47.221365, 56.140241],
    [47.22124, 56.14022],
    [47.221188, 56.140211],
    [47.220531, 56.140093],
    [47.220431, 56.140074],
    [47.220365, 56.140047],
    [47.220357, 56.140002],
    [47.220387, 56.139948],
    [47.220449, 56.139836],
    [47.220091, 56.13978]
]

st.get_route_screen_by_points((47.232565,56.141757), (47.220063,56.139836), options)
#st.get_route_screen_by_coordinates(coordinates, options)

Сборка

Устанавливаем дополнительные библиотека: sudo apt install libcairo2-dev pkg-config python3-dev

python3 -m venv routing-service
source routing-service/bin/activate
pip install -r requirements.txt

Примечание: для деактивации набрать deactivate

pip install setuptools wheel twine

Установка библиотеки

Выполнить в корневом проекте библиотеки:

pip install OsmRouteScreenLib

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.1.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.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: OsmRouteScreenLib-0.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 0eafab6d78c8c4e606fe4d14cab87d2ec06e57d7c08f4545598c504487cce9d2
MD5 2882d30c5e592cb8201a0fcd622315e0
BLAKE2b-256 826486a3ce379070d5523ffd8e7781297d3f347a17b15a032b45195352649c1f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for OsmRouteScreenLib-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dc36c39f5154bfcabcba72f6173412bea8b9f26425e6711139c67f5b6fc21704
MD5 1599371bab2ee67d3c89f44096339230
BLAKE2b-256 4518a68d64fd4aa7cc00d48d1660c0e432ef5dee3b73bab2f1545cc3d0a9abab

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