Skip to main content

Calculates Open Street Map tile coordinates.

Project description

osmtilecalc

Open Street Map Tile Calculator

Calculates Open Street Map tile coordinates required to map the given area at certain zoom level.

Mapped area (bounding box) is a rectangle determined by given location coordinates and the radius parameter in kilometers which is a distance from the location to the corners of the rectangle.

Returns a list of urls pointing to calculated tiles.

Installation

This package is available on PyPI

pip install osmtilecalc

Usage

osmtilecalc latitude longitude radius zoom_level [-h] [-t] [-m]

positional arguments:

latitude Latitude of location in decimal format

longitude Longitude of location in decimal format

radius Radius from location in kilometers

zoom_level Map zoom level (0-21)

optional arguments:

-h, --help Show this help message and exit

-t, --total-only Only show total number of tiles

-m, --miles Change radius unit to US mile

Examples

You can use the osmtilecalc command to calculate your tiles:

$ osm-tile-calc 54.5189 18.5305 5 12
https://c.tile.openstreetmap.org/12/2257/1304.png
https://b.tile.openstreetmap.org/12/2257/1305.png
https://a.tile.openstreetmap.org/12/2258/1304.png
https://c.tile.openstreetmap.org/12/2258/1305.png
https://c.tile.openstreetmap.org/12/2259/1304.png
https://c.tile.openstreetmap.org/12/2259/1305.png

Or you can use the get_urls_for_location function to do it in your code:

>>> from osmtilecalc import get_urls_for_location
>>> get_urls_for_location([54.5189, 18.5305], 5, 11)
['https://b.tile.openstreetmap.org/11/1128/652.png', 'https://b.tile.openstreetmap.org/11/1129/652.png']

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

osmtilecalc-1.0.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

osmtilecalc-1.0.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file osmtilecalc-1.0.0.tar.gz.

File metadata

  • Download URL: osmtilecalc-1.0.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.6.8

File hashes

Hashes for osmtilecalc-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2ce46140a9912437e747926100b609d012011130a95d97f751f1ac39b3e0dcbf
MD5 1ede8f1dfd9debfc0b005d88f1aa236e
BLAKE2b-256 4c6ac8d8982a672dd5f630b2802eefb5402350c414cab054db962d8d4bc66382

See more details on using hashes here.

File details

Details for the file osmtilecalc-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: osmtilecalc-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.6.8

File hashes

Hashes for osmtilecalc-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a4b600ad37048e814e77f04e037dc6a1f72cd6fc33a77b994f13506a9f7111f
MD5 ac94a144858dac2dd799b03a00e0ad9d
BLAKE2b-256 902e7e74ba60764a5545f990b4da63b51e1bc3af14c13d1fdd15440655803340

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