Skip to main content

Simple Python GIS Web Services

Project description

Mapshader

Test Suite Status PyPI version Downloads License

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
mapshader serve

>>> * 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
mapshader serve 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


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.3.tar.gz (956.2 kB view details)

Uploaded Source

Built Distribution

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

mapshader-0.1.3-py3-none-any.whl (982.7 kB view details)

Uploaded Python 3

File details

Details for the file mapshader-0.1.3.tar.gz.

File metadata

  • Download URL: mapshader-0.1.3.tar.gz
  • Upload date:
  • Size: 956.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for mapshader-0.1.3.tar.gz
Algorithm Hash digest
SHA256 4d2d82a65c7e321ac45e34b18647bdb5146d42873a437d4065dca232a5226a3c
MD5 849221ecd608a5962de4491bc22e6d40
BLAKE2b-256 95a0b20df86fd08bb78338e240258f51268213d3ba27815d93c3dac6d904682f

See more details on using hashes here.

File details

Details for the file mapshader-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: mapshader-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 982.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for mapshader-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6aa9f7ec4992add2c6cdfde1c068e2a21ee1a46f957c0c16ac1dc8040b398ee5
MD5 f10aa74df72e010a5880bf8cbc0ce8aa
BLAKE2b-256 db5aa89c356196155e1a537ef3283b70b8c7d354d2922999f85dbc888c7e44bd

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