All Projects â†’ GIScience â†’ openelevationservice

GIScience / openelevationservice

Licence: Apache-2.0 license
🌄 A GeoJSON based service to query SRTM elevation for points/lines.

Programming Languages

python
139335 projects - #7 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to openelevationservice

open route service
An encapsulation made around openrouteservice API for Dart and Flutter projects. Made for easy generation of Routes and Directions on Maps, Isochrones, Time-Distance Matrix, Pelias Geocoding, POIs, Elevation and routing Optimizations using their amazing API.
Stars: ✭ 20 (-54.55%)
Mutual labels:  elevation-data, openrouteservice
google maps
🗺 An unofficial Google Maps Platform client library for the Rust programming language.
Stars: ✭ 40 (-9.09%)
Mutual labels:  elevation, elevation-data
osm2geojson
Tool to convert open street map xml to geojson
Stars: ✭ 17 (-61.36%)
Mutual labels:  geojson
terraformer-wkt-parser
Well-Known Text parser for Terraformer
Stars: ✭ 66 (+50%)
Mutual labels:  geojson
rayshaderanimate
Animate GPX data on a 3D map
Stars: ✭ 27 (-38.64%)
Mutual labels:  elevation-data
geocoder
Web app interface for geocoding addresses in CSV files.
Stars: ✭ 17 (-61.36%)
Mutual labels:  geojson
ip2location-nginx
Nginx module that allows user to lookup for geolocation information using IP2Location database.
Stars: ✭ 33 (-25%)
Mutual labels:  elevation
geojson.specs
a Geojson utility for validating data using Clojure(script)'s spec (RFC 7946)
Stars: ✭ 18 (-59.09%)
Mutual labels:  geojson
turf-async
Demonstrating how to use Turf.js with web workers to run geoprocesses asynchronously
Stars: ✭ 50 (+13.64%)
Mutual labels:  geojson
geojson
Library for serializing the GeoJSON vector GIS file format
Stars: ✭ 171 (+288.64%)
Mutual labels:  geojson
linked-places-format
Linked Places format is used to describe attestations of places in a standard way, primarily for linking gazetteer datasets.
Stars: ✭ 54 (+22.73%)
Mutual labels:  geojson
geofiddle
Geometric conversions between different formats and projections
Stars: ✭ 15 (-65.91%)
Mutual labels:  geojson
IP2Location-C-Library
IP2Location C library enables the user to find the country, region, city, coordinates, zip code, time zone, ISP, domain name, connection type, area code, weather station code, weather station name, mobile, usage types, etc that any IP address or hostname originates from.
Stars: ✭ 37 (-15.91%)
Mutual labels:  elevation
geojson-to-sqlite
CLI tool for converting GeoJSON files to SQLite (with SpatiaLite)
Stars: ✭ 41 (-6.82%)
Mutual labels:  geojson
pyturf
A modular geospatial engine written in python
Stars: ✭ 15 (-65.91%)
Mutual labels:  geojson
go-elevations
SRTM parser for golang
Stars: ✭ 17 (-61.36%)
Mutual labels:  elevation
geojson-to-wfs-t-2
A lightweight javascript module to format WFS-T-2 statements from GeoJSON features
Stars: ✭ 21 (-52.27%)
Mutual labels:  geojson
geofeatures2
A lightweight, high performance geometry library in Swift.
Stars: ✭ 18 (-59.09%)
Mutual labels:  geojson
osm-geojson
🔰 Get GeoJSON of a OpenStreetMap's relation from the API.
Stars: ✭ 42 (-4.55%)
Mutual labels:  geojson
vaguely-rude-places
The map of Vaguely Rude Place Names
Stars: ✭ 19 (-56.82%)
Mutual labels:  geojson
Build status Documentation Status

Quickstart

Description

openelevationservice is a Flask application which extracts elevation from various elevation datasets for Point or LineString 2D geometries and returns 3D geometries in various formats.

Supported formats are:

  • GeoJSON
  • Polyline, i.e. list of vertices
  • Google's encoded polyline
  • Point, i.e. one vertex

For general support and questions, please contact our forum. After successful installation, you can also find a API documentation locally at https://localhost:5000/apidocs, provided via flasgger.

For issues and improvement suggestions, use the repo's issue tracker.

This service is part of the GIScience software stack, crafted at HeiGIT institute at the University of Heidelberg.

You can also use our free API via (also check Endpoints for usage):

Installation

You can either run this service on a host machine (like your PC) in a virtual environment or via docker (recommended).

Docker installation

Prerequisites
Run Docker container
  1. Customize ops_settings_docker.sample.yml to your needs and name it ops_settings_docker.yml
  2. Build container sudo docker-compose up -d
  3. Create the database
sudo docker exec -it <container ID> bash -c "source /oes_venv/bin/activate; export OES_LOGLEVEL=DEBUG; flask create"
  1. Download SRTM data
sudo docker exec -it <container ID> bash -c "source /oes_venv/bin/activate; export OES_LOGLEVEL=DEBUG; flask download --xyrange=0,0,73,25"

The optional xyrange parameter specfies the minx,miny,maxx,maxy indices of the available tiles, default is 0,0,73,25. You can see a representation of indices in the map on the CGIAR website.

Note, that you need to have credentials to access the FTP site , which you can request here.

  1. Import SRTM data
sudo docker exec  -it <container ID> bash -c "source /oes_venv/bin/activate; flask importdata"

The import command will import whatever .tif files it finds in ./tiles. Now, it's time to grab a coffee, this might take a while. Expect a few hours for a remote database connection with HDD's and the global dataset.

After it's all finished, the service will listen on port 5020 of your host machine, unless specified differently in docker-compose.yml.

Conventional installation

This tutorial assumes a Ubuntu system.

Max OSX should be similar, if not the same. Windows is of course possible, but many of the commands will have to be altered.

Prerequisites
  • Python 3.6 or higher
  • PostGIS installation on the host machine (solely needed for raster2pgsql)
  • (Optional) Remote PostGIS installation (if you want to use a different data server)
Create virtual environment

First, customize ./openelevationservice/server/ops_settings.sample.yml and name it ops_settings.yml.

Then you can set up the environment:

cd openelevationservice
# Either via virtualenv, venv package or conda
python3.6 -m venv .venv
# or
virtualenv python=python3.6 .venv
# or
conda create -n oes python=3.6

# Activate virtual env (or equivalent conda command)
source .venv/bin/activate
# Add FLASK_APP environment variable
# For conda, see here: https://conda.io/docs/user-guide/tasks/manage-environments.html#macos-and-linux
echo "export FLASK_APP=manage" >> .venv/bin/activate
# Install required packages
pip install -r requirements.txt

When your environment is set up, you can run the import process and start the server:

# inside the repo root directory
flask create
# rather as a background/nohup job, will download 27 GB
flask download --xyrange=0,0,73,25
flask importdata

# Start the server
flask run

The service will now listen on `http://localhost:5000.

Endpoints

The default base url is http://localhost:5000/.

The openelevationservice exposes 2 endpoints:

  • /elevation/line: used for LineString geometries
  • /elevation/point: used for single Point geometries
Endpoint Method(s) allowed Parameter Default Values
/elevation/line POST format_in -- geojson, polyline, encodedpolyline5, encodedpolyline6
geometry -- depends on format_in
format_out geojson geojson, polyline, encodedpolyline5, encodedpolyline6
dataset srtm srtm (so far)
/elevation/point GET, POST format_in -- geojson, point
geometry -- depends on format_in
format_out geojson geojson, point
dataset srtm srtm (so far)

For more detailed information, please visit the API documentation.

When hosted locally, visit https://localhost:5000/apidocs.

Environment variables

openelevationservice recognizes the following environment variables:

variable function Default Values
OES_LOGLEVEL Sets the level of logging output INFO DEBUG, INFO, WARNING, ERROR
APP_SETTINGS Controls the behavior of config.py openelevationservice.server.config.ProductionConfig

ProductionConfig,

DevelopmentConfig

FLASK_APP Sets the app manage  
FLASK_ENV Development/Production server development production, development
TESTING Sets flask testing environment None true

In the case of the Docker setup, you don't need to worry about environment variables for the most part.

CLI

The flask command line interface has a few additional commands:

  • flask create: creates a table for CGIAR data
  • `flask download --xyrange=0,73,0,25: downloads CGIAR data and limits the X, Y indices optionally with xyrange
  • flask importdata: imports CGIAR tiles it finds in ./tiles/
  • flask drop: drops CGIAR table

Testing

The testing framework is nosetests, which makes it very easy to run the tests:

TESTING=true nosetests -v

Usage

GET point

curl -XGET https://localhost:5000/elevation/point?geometry=13.349762,38.11295

POST point as GeoJSON

curl -XPOST http://localhost:5000/elevation/point \
  -H 'Content-Type: application/json' \
  -d '{
    "format_in": "geojson",
    "format_out": "geojson",
    "geometry": {
      "coordinates": [13.349762, 38.11295],
      "type": "Point"
    }
  }'

POST LineString as polyline

curl -XPOST http://localhost:5000/elevation/line \
  -H 'Content-Type: application/json' \
  -d '{
    "format_in": "polyline",
    "format_out": "encodedpolyline",
    "geometry": [[13.349762, 38.11295],
                 [12.638397, 37.645772]]
  }'
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].