A bit like PostGIS ST_SummaryStats for files on disk
Project description
A bit like the PostGIS ST_SummaryStats function for rasters on your filesystem. Mostly we’re just stringing together some awesome libraries:
Install
Activate your project virtual environment, and then:
pip install winston
If you just want to use the command-line features, you could:
pip install --user winston
Usage
On the command-line:
winston --help
For example, to get stats for all WKTs in a text file for a given raster:
winston some_file.tif -f wkts.txt
or just for one point, including raster metadata:
winston /path/to/data/*.tif -w 'POINT (-4.483545 54.150744)' -m
Since we require rasterio, you can also use the rio command-line tool to inspect your rasters:
rio insp /path/to/geo.tif
Read more in the Rasterio docs.
You can also use Winston as a module:
>>> import rasterio >>> from winston.stats import summary >>> src = rasterio.open('/path/to/raster.tif') >>> print summary(src) [37324800.0, 37324800.0, 281865888.0, 7.552, 3.45, 0.0, 10.0] >>> print summary(src, bounds=(4, 6)) [37324800.0, 1772928.0, 9023566.0, 5.09, 0.573, 4.122, 5.929] >>> print summary(src, bounds=(4, 6), mean_only=True) 5.09
History
0.1.0 (2016-10-12)
First release on PyPI.
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
Built Distribution
Hashes for winston-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a43f5c5279e3f0a435ed0f1600cc6379b9f3b77e907d2495f3013d2706577c3 |
|
MD5 | 215a13a5f1b697c05b1d8b80b16b98fd |
|
BLAKE2b-256 | f33b43cb6b54e57c23d17bd713ecc3f98e4fa90c2f8e4264209804646f214a54 |