Lightweight OpenStreetMap adapter for WMS services as Django app
Project description
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.
- Make sure you have Python and pip installed
- Clone repo:
git clone git@github.com:v3l0c1r4pt0r/adaptwms.git
and enter it:cd adaptwms
- Install all requirements:
pip install -r requirements.txt
- Run development server with:
./manage.py runserver
- 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.
- Make sure you have Python and pip installed
- Start new django project:
django-admin startproject demo .
, where demo is its name, or use existing one - Install adaptwms from PyPI:
pip install adaptwms
- Add
adaptwms
to yourINSTALLED_APPS
in settings.py - Add
path("adaptwms/", adaptwms.views.adapter_view),
to your urlpatterns in urls.py (same could be done foradaptwms.views.InterfaceView.as_view()
if you want to have interactive generator for adaptwms URLs) - Run development server with:
./manage.py runserver
- Open
http://127.0.0.1:8000/
in your browser
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file adaptwms-0.1.2.tar.gz
.
File metadata
- Download URL: adaptwms-0.1.2.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.4 Linux/5.15.0-1040-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f56322cfd0b5feffdf5ba2f60a59abf73d6e46f8c7911f56275e0cf3289e1012 |
|
MD5 | 99c4799138f87a7ee8f0e6914bddcb6f |
|
BLAKE2b-256 | 498a97c7e5735464a002959919e39f4fb0de208edc9eeefd48acf628e7ae8bec |
File details
Details for the file adaptwms-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: adaptwms-0.1.2-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.4 Linux/5.15.0-1040-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9ee40dc911cfab49e41c73620b62a9b8cb22269ef411dc34cf816979201ee13 |
|
MD5 | 192f2405380a7a5152ec200234b3f97b |
|
BLAKE2b-256 | c6ad8bf3ad499a9cb8843278da7239b6f83a8a85b4b312640369226bf098b53c |