Drapery Documentation Contents

Drapery

Drapery is a Python library and CLI tool to convert 2D geometries to 3D given an elevation source.

https://travis-ci.org/mrahnis/drapery.svg?branch=master https://ci.appveyor.com/api/projects/status/eyh3s753a0r2vexl?svg=true Documentation Status

Installation

https://img.shields.io/pypi/v/drapery.svg https://anaconda.org/mrahnis/drapery/badges/version.svg

To install from the Python Package Index:

$pip install drapery

To install from Anaconda Cloud:

If you are starting from scratch the first thing to do is install the Anaconda Python distribution, add the necessary channels to obtain the dependencies and install drapery.

$conda config --append channels conda-forge
$conda install drapery -c mrahnis

To install from the source distribution execute the setup script in the drapery directory:

$python setup.py install

Examples

To do

License

BSD

Documentation

Latest html

Drapery Manual

drapery

drapery Package

drapery Package

Subpackages

ops Package
sample Module
drapery.ops.sample.drape(raster, feature)

Convert a 2D feature to a 3D feature by sampling a raster

Parameters:
  • raster (rasterio) – raster to provide the z coordinate
  • feature (dict) – fiona feature record to convert
Returns:

shapely Point or LineString of xyz coordinate triples

Return type:

result (Point or Linestring)

drapery.ops.sample.sample(raster, coords)

Sample a raster at given coordinates

Given a list of coordinates, return a list of x,y,z triples with z coordinates sampled from an input raster

Parameters:
  • raster (rasterio) – raster dataset to sample
  • coords – array of tuples containing coordinate pairs (x,y) or triples (x,y,z)
Returns:

array of tuples containing coordinate triples (x,y,z)

Return type:

result

Indices and tables