Skip to main content

adaptwms

Lightweight OpenStreetMap adapter for WMS services

What it is?

Basically it is adapter translating requests in so called Slippy Map format (used by OpenStreetMap, takes zoom level and XY tile indexes) into requests to external WMS service (takes bounding box in form of two points in some coordinate system of area to render).

To give an example , let's say you need to supply to external map viewer an URL in format:

https://tile.openstreetmap.org/{z}/{x}/{y}.png

All x,y and z are natural numbers. But the service you want to access gives you interface that requires this format:

https://external.service/wms?BBOX=0.0%2C0.0%2C1.0%2C1.0&SRS=EPSG%3A3857&WIDTH=256&HEIGHT=256&SERVICE=WMS

However in this case BBOX contains set of 4 floating point numbers for 2 (x0, y0) and (x1, y1) points limiting the area to render. This is a kind of problems this program is trying to solve.

What is supported?

These are the known constraints:

  • WMS service you use must allow unauthenticated access (there is no way for passing credentials in any form at the moment)
  • it must support EPSG:3857 coordinate system

How to use it...

...if I don't have experience with Django

This makes use of this Github project and demo project it supplies. Best for testing, or temporary deployement.

  1. Make sure you have Python and pip installed
  2. Clone repo: git clone git@github.com:v3l0c1r4pt0r/adaptwms.git and enter it: cd adaptwms
  3. Install all requirements: pip install -r requirements.txt
  4. Run development server with: ./manage.py runserver
  5. Open http://127.0.0.1:8000/ in your browser

TODO: write

...if I do have some experience with Django

This makes use of pip package available on PyPI and Django project that you have, or want to set up. Best for production environments.

  1. Make sure you have Python and pip installed
  2. Start new django project: django-admin startproject demo ., where demo is its name, or use existing one
  3. Install adaptwms from PyPI: pip install adaptwms
  4. Add adaptwms to your INSTALLED_APPS in settings.py
  5. Add path("adaptwms/", adaptwms.views.adapter_view), to your urlpatterns in urls.py (same could be done for adaptwms.views.InterfaceView.as_view() if you want to have interactive generator for adaptwms URLs)
  6. Run development server with: ./manage.py runserver
  7. Open http://127.0.0.1:8000/ in your browser

Metadata

Release files for adaptwms 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for adaptwms 0.1.2
File Size Uploaded
adaptwms-0.1.2.tar.gz 7.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for adaptwms 0.1.2
File Interpreter ABI Platform
adaptwms-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 17.5 kB

Release files / adaptwms-0.1.2.tar.gz

Download URL adaptwms-0.1.2.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f56322cfd0b5feffdf5ba2f60a59abf73d6e46f8c7911f56275e0cf3289e1012
BLAKE2b-256 checksum
How to use checksums
498a97c7e5735464a002959919e39f4fb0de208edc9eeefd48acf628e7ae8bec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.4 Linux/5.15.0-1040-azure

Release files / adaptwms-0.1.2-py3-none-any.whl

Download URL adaptwms-0.1.2-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a9ee40dc911cfab49e41c73620b62a9b8cb22269ef411dc34cf816979201ee13
BLAKE2b-256 checksum
How to use checksums
c6ad8bf3ad499a9cb8843278da7239b6f83a8a85b4b312640369226bf098b53c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.4 Linux/5.15.0-1040-azure

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page