Giter VIP home page Giter VIP logo

qwc-elevation-service's Introduction

docker

QWC Elevation Service

Returns elevations.

Configuration

The static config files are stored as JSON files in $CONFIG_PATH with subdirectories for each tenant, e.g. $CONFIG_PATH/default/*.json. The default tenant name is default.

Elevation Service config

  • JSON schema
  • File location: $CONFIG_PATH/<tenant>/elevationConfig.json

Example:

{
  "$schema": "https://raw.githubusercontent.com/qwc-services/qwc-elevation-service/master/schemas/qwc-elevation-service.json",
  "service": "elevation",
  "config": {
    "elevation_dataset": "/vsicurl/https://data.sourcepole.com/srtm_1km_3857.tif"
  }
}

Environment variables

Config options in the config file can be overridden by equivalent uppercase environment variables.

Variable Description
ELEVATION_DATASET path/to/dtm.tif

Usage

Run as

python src/server.py

Requires GDAL Python bindings. python-gdal or python3-gdal packages on Debian/Ubuntu (Note: virtualenv creation requires --system-site-packages option).

API:

  • Runs by default on http://localhost:5002
  • GET: /getelevation?pos=<pos>&crs=<crs>
    • pos: the query position, as x,y
    • crs: the crs of the query position
    • output: a json document with the elevation in meters: {elevation: h}
  • POST: /getheightprofile
    • payload: a json document as follows:

      {
          coordinates: [[x1,y1],[x2,y2],...],
          distances: [<dist_p1_p2>, <dist_p2_p3>, ...],
          projection: <EPSG:XXXX, projection of coordinates>,
          samples: <number of height samples to return>
      }
      
    • output: a json document with heights in meters: {elevations: [h1, h2, ...]}

Docker usage

The docker image can be run with the following command:

docker run -p 5002:9090 sourcepole/qwc-elevation-service
docker parameters Description
-p 5002:9090 Bind port 5002 on the host machine

qwc-elevation-service's People

Contributors

dependabot[bot] avatar husseinkabbout avatar manisandro avatar mwa avatar pka avatar stamogis avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.