Simple Python GIS Web Services
Project description
Simple Python GIS Web Services
- Create
mapshader.MapSource
objects and render them as geojson, tiles, or images - This project should still be considered experimental
pip install mapshader
Setup Mapshader Conda Environment
conda create -n mapshader python=3.8
conda activate mapshader
git clone git@github.com:makepath/mapshader.git
cd mapshader
pip install -e .
Run Tests
conda activate mapshader
pytest mapshader/tests -sv
Run Flask Server
conda activate mapshader
python mapshader/flask_app.py
>>> * Serving Flask app "flask_app" (lazy loading)
>>> * Environment: production
>>> WARNING: This is a development server. Do not use it in a production deployment.
>>> Use a production WSGI server instead.
>>> * Debug mode: on
>>> * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
>>> * Restarting with stat
Mapshader Config (YAML)
While mapshader comes with default services to help with testing, users can create their own services via YAML.
my_services.yaml
---
metadata:
version: 1
sources:
- name: Global Elevation Example
key: elevation-example
text: Elevation
description: Global elevation example
geometry_type: raster
shade_how: linear
cmap:
- white
- black
span:
- 58
- 248
raster_padding: 0
raster_interpolate: linear
xfield: geometry
yfield: geometry
filepath: mapshader/tests/fixtures/elevation.tif
transforms:
- name: squeeze
args:
dim: band
- name: cast
args:
dtype: float64
- name: orient_array
- name: flip_coords
args:
dim: y
- name: reproject_raster
args:
epsg: 3857
service_types:
- tile
This configuration file can then be passed to the flask server upon startup:
conda activate mapshader
python mapshader/flask_app.py -f my_services.yaml
>>> * Serving Flask app "flask_app" (lazy loading)
>>> * Environment: production
>>> WARNING: This is a development server. Do not use it in a production deployment.
>>> Use a production WSGI server instead.
>>> * Debug mode: on
>>> * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
>>> * Restarting with stat
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
mapshader-0.1.0.tar.gz
(877.5 kB
view hashes)
Built Distribution
mapshader-0.1.0-py3-none-any.whl
(896.6 kB
view hashes)
Close
Hashes for mapshader-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 962e454580a2c9ae586478ef07a91c6551c1ec1f4b9cb3cde7d5ddd7fc0e9949 |
|
MD5 | 19e9b68232ec59a5b8d244e94708a411 |
|
BLAKE2b-256 | 680e292d1561e16ecb5f6bff0bd2600ced824a3282653f9fc981534c0c7e6cb0 |